BornAgain  1.19.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 reflection and scattering
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 #ifdef SWIG
16 #error no need to expose this header to Swig
17 #endif
18 
19 #ifndef USER_API
20 #ifndef BORNAGAIN_CORE_COMPUTATION_DWBASINGLECOMPUTATION_H
21 #define BORNAGAIN_CORE_COMPUTATION_DWBASINGLECOMPUTATION_H
22 
24 #include <map>
25 #include <memory>
26 #include <vector>
27 
31 class ProgressHandler;
33 class SimulationElement;
34 
35 //! Class that handles all the computations involved in GISAS (particles, roughness,...) for
36 //! a single detector bin.
37 //!
38 //! Called by DWBASimulation on each detector bin.
39 //!
40 //! @ingroup algorithms_internal
41 
43 public:
46 
47  void setProgressHandler(ProgressHandler* p_progress);
48 
52  void compute(SimulationElement& elem) const;
53 
54 private:
55  std::vector<std::unique_ptr<ParticleLayoutComputation>> m_layout_comps;
56  std::unique_ptr<RoughMultiLayerComputation> m_roughness_comp;
57  std::unique_ptr<GISASSpecularComputation> m_spec_comp;
58  std::unique_ptr<DelayedProgressCounter> m_progress_counter;
59  std::map<size_t, std::vector<HomogeneousRegion>> m_region_map;
60 };
61 
62 #endif // BORNAGAIN_CORE_COMPUTATION_DWBASINGLECOMPUTATION_H
63 #endif // USER_API
Defines struct HomogeneousRegion, and declares fct createAveragedMaterial.
Class that handles all the computations involved in GISAS (particles, roughness,.....
std::unique_ptr< GISASSpecularComputation > m_spec_comp
void addLayoutComputation(ParticleLayoutComputation *p_layout_comp)
std::map< size_t, std::vector< HomogeneousRegion > > m_region_map
std::unique_ptr< DelayedProgressCounter > m_progress_counter
void compute(SimulationElement &elem) const
void setRoughnessComputation(RoughMultiLayerComputation *p_roughness_comp)
void setProgressHandler(ProgressHandler *p_progress)
void setSpecularBinComputation(GISASSpecularComputation *p_spec_comp)
std::unique_ptr< RoughMultiLayerComputation > m_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.