BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
DWBASingleComputation.cpp
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Core/Computation/DWBASingleComputation.cpp
6 //! @brief Implements 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 
20 
22 
24 
26 
28 {
29  mP_progress_counter = std::make_unique<DelayedProgressCounter>(p_progress, 100);
30 }
31 
33 {
34  m_layout_comps.emplace_back(p_layout_comp);
35  p_layout_comp->mergeRegionMap(m_region_map);
36 }
37 
39 {
40  mP_roughness_comp.reset(p_roughness_comp);
41 }
42 
44 {
45  mP_spec_comp.reset(p_spec_comp);
46 }
47 
49 {
50  for (auto& layout_comp : m_layout_comps) {
51  layout_comp->compute(elem);
52  }
53  if (mP_roughness_comp) { // also check absence of matrix RT coefficients
54  mP_roughness_comp->compute(elem);
55  }
56  if (mP_spec_comp) { // also check absence of matrix RT coefficients
57  mP_spec_comp->compute(elem);
58  }
59  if (mP_progress_counter) {
60  mP_progress_counter->stepProgress();
61  }
62 }
63 
64 const std::map<size_t, std::vector<HomogeneousRegion>>& DWBASingleComputation::regionMap() const
65 {
66  return m_region_map;
67 }
Defines class DWBASingleComputation.
Defines class DelayedProgressCounter.
Defines class GISASSpecularComputation.
Defines class ParticleLayoutComputation.
Defines class RoughMultiLayerComputation.
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
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
Computes the specular signal in the bin where q_parallel = 0.
Computes the scattering contribution from one particle layout.
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)
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.