BornAgain  1.19.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 reflection and scattering
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 #ifdef SWIG
16 #error no need to expose this header to Swig
17 #endif
18 
19 #ifndef USER_API
20 #ifndef BORNAGAIN_CORE_COMPUTATION_PARTICLELAYOUTCOMPUTATION_H
21 #define BORNAGAIN_CORE_COMPUTATION_PARTICLELAYOUTCOMPUTATION_H
22 
24 #include <map>
25 #include <memory>
26 #include <vector>
27 
29 class ProcessedLayout;
30 class SimulationElement;
31 class SimulationOptions;
32 
33 //! Computes the scattering contribution from one particle layout.
34 //! Used by DWBAComputation.
35 //! @ingroup algorithms_internal
36 
38 public:
39  ParticleLayoutComputation(const ProcessedLayout& layout, const SimulationOptions& options,
40  bool polarized);
42 
43  void compute(SimulationElement& elem) const;
44 
45  //! Merges its region map into the given one (notice non-const reference parameter)
46  void mergeRegionMap(std::map<size_t, std::vector<HomogeneousRegion>>& region_map) const;
47 
48 private:
50  const std::map<size_t, std::vector<HomogeneousRegion>> m_region_map;
51  std::unique_ptr<const IInterferenceFunctionStrategy> m_interference_function_strategy;
52 };
53 
54 #endif // BORNAGAIN_CORE_COMPUTATION_PARTICLELAYOUTCOMPUTATION_H
55 #endif // USER_API
Defines struct HomogeneousRegion, and declares fct createAveragedMaterial.
Base class of all interference function strategy classes.
Computes the scattering contribution from one particle layout.
ParticleLayoutComputation(const ProcessedLayout &layout, const SimulationOptions &options, bool polarized)
const ProcessedLayout & m_layout
const std::map< size_t, std::vector< HomogeneousRegion > > m_region_map
std::unique_ptr< const IInterferenceFunctionStrategy > m_interference_function_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.
matrixFFVector_t polarized(const SimulationElement &sim_element, const std::vector< FormFactorCoherentSum > &ff_wrappers)