BornAgain  1.19.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 reflection and scattering
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 {
27  m_progress_counter = std::make_unique<DelayedProgressCounter>(p_progress, 100);
28 }
29 
31 {
32  m_layout_comps.emplace_back(p_layout_comp);
33  p_layout_comp->mergeRegionMap(m_region_map);
34 }
35 
37 {
38  m_roughness_comp.reset(p_roughness_comp);
39 }
40 
42 {
43  m_spec_comp.reset(p_spec_comp);
44 }
45 
47 {
48  for (auto& layout_comp : m_layout_comps)
49  layout_comp->compute(elem);
50 
51  if (m_roughness_comp) // also check absence of matrix RT coefficients
52  m_roughness_comp->compute(elem);
53 
54  if (m_spec_comp) // also check absence of matrix RT coefficients
55  m_spec_comp->compute(elem);
56 
58  m_progress_counter->stepProgress();
59 }
Defines class DWBASingleComputation.
Defines class DelayedProgressCounter.
Defines class GISASSpecularComputation.
Defines class ParticleLayoutComputation.
Defines class RoughMultiLayerComputation.
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
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.