BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
DWBASingleComputation.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Core/Computation/DWBASingleComputation.h
6 //! @brief Defines class DWBASingleComputation.
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_DWBASINGLECOMPUTATION_H
16 #define BORNAGAIN_CORE_COMPUTATION_DWBASINGLECOMPUTATION_H
17 
19 #include <map>
20 #include <memory>
21 #include <vector>
22 
26 class ProgressHandler;
28 class SimulationElement;
29 
30 //! Class that handles all the computations involved in GISAS (particles, roughness,...) for
31 //! a single detector bin.
32 //!
33 //! Called by DWBASimulation on each detector bin.
34 //!
35 //! @ingroup algorithms_internal
36 
38 {
39 public:
43 
44  void setProgressHandler(ProgressHandler* p_progress);
45 
49  void compute(SimulationElement& elem) const;
50 
51  //! Retrieves a map of regions for the calculation of averaged layers
52  const std::map<size_t, std::vector<HomogeneousRegion>>& regionMap() const;
53 
54 private:
55  std::vector<std::unique_ptr<ParticleLayoutComputation>> m_layout_comps;
56  std::unique_ptr<RoughMultiLayerComputation> mP_roughness_comp;
57  std::unique_ptr<GISASSpecularComputation> mP_spec_comp;
58  std::unique_ptr<DelayedProgressCounter> mP_progress_counter;
59  std::map<size_t, std::vector<HomogeneousRegion>> m_region_map;
60 };
61 
62 #endif // BORNAGAIN_CORE_COMPUTATION_DWBASINGLECOMPUTATION_H
Defines struct HomogeneousRegion, and declares fct createAveragedMaterial.
Class that handles all the computations involved in GISAS (particles, roughness,.....
std::unique_ptr< DelayedProgressCounter > mP_progress_counter
std::unique_ptr< GISASSpecularComputation > mP_spec_comp
void addLayoutComputation(ParticleLayoutComputation *p_layout_comp)
std::map< size_t, std::vector< HomogeneousRegion > > m_region_map
const std::map< size_t, std::vector< HomogeneousRegion > > & regionMap() const
Retrieves a map of regions for the calculation of averaged layers.
void compute(SimulationElement &elem) const
DWBASingleComputation(DWBASingleComputation &&other)
void setRoughnessComputation(RoughMultiLayerComputation *p_roughness_comp)
void setProgressHandler(ProgressHandler *p_progress)
void setSpecularBinComputation(GISASSpecularComputation *p_spec_comp)
std::unique_ptr< RoughMultiLayerComputation > mP_roughness_comp
std::vector< std::unique_ptr< ParticleLayoutComputation > > m_layout_comps
Counter for reporting progress (with delay interval) in a threaded computation.
Computes the specular signal in the bin where q_parallel = 0.
Computes the scattering contribution from one particle layout.
Maintains information about progress of a computation.
Computes the diffuse reflection from the rough interfaces of a multilayer.
Data stucture containing both input and output of a single detector cell.