BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ParticleLayoutComputation.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Core/Computation/ParticleLayoutComputation.h
6 //! @brief Defines class ParticleLayoutComputation.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************** //
14 
15 #ifndef BORNAGAIN_CORE_COMPUTATION_PARTICLELAYOUTCOMPUTATION_H
16 #define BORNAGAIN_CORE_COMPUTATION_PARTICLELAYOUTCOMPUTATION_H
17 
19 #include <map>
20 #include <memory>
21 #include <vector>
22 
24 class ProcessedLayout;
25 class SimulationElement;
26 class SimulationOptions;
27 
28 //! Computes the scattering contribution from one particle layout.
29 //! Used by DWBAComputation.
30 //! @ingroup algorithms_internal
31 
33 {
34 public:
35  ParticleLayoutComputation(const ProcessedLayout* p_layout, const SimulationOptions& options,
36  bool polarized);
38 
39  void compute(SimulationElement& elem) const;
40 
41  //! Merges its region map into the given one (notice non-const reference parameter)
42  void mergeRegionMap(std::map<size_t, std::vector<HomogeneousRegion>>& region_map) const;
43 
44 private:
46  std::unique_ptr<const IInterferenceFunctionStrategy> mP_strategy;
48  std::map<size_t, std::vector<HomogeneousRegion>> m_region_map;
49 };
50 
51 #endif // BORNAGAIN_CORE_COMPUTATION_PARTICLELAYOUTCOMPUTATION_H
Defines struct HomogeneousRegion, and declares fct createAveragedMaterial.
Base class of all interference function strategy classes.
Computes the scattering contribution from one particle layout.
const ProcessedLayout * mp_layout
std::map< size_t, std::vector< HomogeneousRegion > > m_region_map
ParticleLayoutComputation(const ProcessedLayout *p_layout, const SimulationOptions &options, bool polarized)
std::unique_ptr< const IInterferenceFunctionStrategy > mP_strategy
void compute(SimulationElement &elem) const
void mergeRegionMap(std::map< size_t, std::vector< HomogeneousRegion >> &region_map) const
Merges its region map into the given one (notice non-const reference parameter)
Data structure that contains preprocessed data for a single layout.
Data stucture containing both input and output of a single detector cell.
Collect the different options for simulation.