BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
DWBASingleComputation Class Reference
Collaboration diagram for DWBASingleComputation:

Public Member Functions

 DWBASingleComputation ()
 
 ~DWBASingleComputation ()
 
 DWBASingleComputation (DWBASingleComputation &&other)
 
void setProgressHandler (ProgressHandler *p_progress)
 
void addLayoutComputation (ParticleLayoutComputation *p_layout_comp)
 
void setRoughnessComputation (RoughMultiLayerComputation *p_roughness_comp)
 
void setSpecularBinComputation (GISASSpecularComputation *p_spec_comp)
 
void compute (SimulationElement &elem) const
 
const std::map< size_t, std::vector< HomogeneousRegion > > & regionMap () const
 

Private Attributes

std::vector< std::unique_ptr< ParticleLayoutComputation > > m_layout_comps
 
std::unique_ptr< RoughMultiLayerComputationmP_roughness_comp
 
std::unique_ptr< GISASSpecularComputationmP_spec_comp
 
std::unique_ptr< DelayedProgressCountermP_progress_counter
 
std::map< size_t, std::vector< HomogeneousRegion > > m_region_map
 

Detailed Description

Class that handles all the computations involved in GISAS (particles, roughness,...) for a single detector bin.

Called by DWBASimulation on each detector bin.

Definition at line 37 of file DWBASingleComputation.h.

Constructor & Destructor Documentation

◆ DWBASingleComputation() [1/2]

DWBASingleComputation::DWBASingleComputation ( )
default

◆ ~DWBASingleComputation()

DWBASingleComputation::~DWBASingleComputation ( )
default

◆ DWBASingleComputation() [2/2]

DWBASingleComputation::DWBASingleComputation ( DWBASingleComputation &&  other)
default

Member Function Documentation

◆ setProgressHandler()

void DWBASingleComputation::setProgressHandler ( ProgressHandler p_progress)

Definition at line 27 of file DWBASingleComputation.cpp.

28 {
29  mP_progress_counter = std::make_unique<DelayedProgressCounter>(p_progress, 100);
30 }
std::unique_ptr< DelayedProgressCounter > mP_progress_counter

References mP_progress_counter.

Referenced by DWBAComputation::runProtected().

◆ addLayoutComputation()

void DWBASingleComputation::addLayoutComputation ( ParticleLayoutComputation p_layout_comp)

Definition at line 32 of file DWBASingleComputation.cpp.

33 {
34  m_layout_comps.emplace_back(p_layout_comp);
35  p_layout_comp->mergeRegionMap(m_region_map);
36 }
std::map< size_t, std::vector< HomogeneousRegion > > m_region_map
std::vector< std::unique_ptr< ParticleLayoutComputation > > m_layout_comps
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)

References m_layout_comps, m_region_map, and ParticleLayoutComputation::mergeRegionMap().

Referenced by DWBAComputation::DWBAComputation().

Here is the call graph for this function:

◆ setRoughnessComputation()

void DWBASingleComputation::setRoughnessComputation ( RoughMultiLayerComputation p_roughness_comp)

Definition at line 38 of file DWBASingleComputation.cpp.

39 {
40  mP_roughness_comp.reset(p_roughness_comp);
41 }
std::unique_ptr< RoughMultiLayerComputation > mP_roughness_comp

References mP_roughness_comp.

Referenced by DWBAComputation::DWBAComputation().

◆ setSpecularBinComputation()

void DWBASingleComputation::setSpecularBinComputation ( GISASSpecularComputation p_spec_comp)

Definition at line 43 of file DWBASingleComputation.cpp.

44 {
45  mP_spec_comp.reset(p_spec_comp);
46 }
std::unique_ptr< GISASSpecularComputation > mP_spec_comp

References mP_spec_comp.

Referenced by DWBAComputation::DWBAComputation().

◆ compute()

void DWBASingleComputation::compute ( SimulationElement elem) const

Definition at line 48 of file DWBASingleComputation.cpp.

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 }

References m_layout_comps, mP_progress_counter, mP_roughness_comp, and mP_spec_comp.

Referenced by DWBAComputation::runProtected().

◆ regionMap()

const std::map< size_t, std::vector< HomogeneousRegion > > & DWBASingleComputation::regionMap ( ) const

Retrieves a map of regions for the calculation of averaged layers.

Definition at line 64 of file DWBASingleComputation.cpp.

65 {
66  return m_region_map;
67 }

References m_region_map.

Member Data Documentation

◆ m_layout_comps

std::vector<std::unique_ptr<ParticleLayoutComputation> > DWBASingleComputation::m_layout_comps
private

Definition at line 55 of file DWBASingleComputation.h.

Referenced by addLayoutComputation(), and compute().

◆ mP_roughness_comp

std::unique_ptr<RoughMultiLayerComputation> DWBASingleComputation::mP_roughness_comp
private

Definition at line 56 of file DWBASingleComputation.h.

Referenced by compute(), and setRoughnessComputation().

◆ mP_spec_comp

std::unique_ptr<GISASSpecularComputation> DWBASingleComputation::mP_spec_comp
private

Definition at line 57 of file DWBASingleComputation.h.

Referenced by compute(), and setSpecularBinComputation().

◆ mP_progress_counter

std::unique_ptr<DelayedProgressCounter> DWBASingleComputation::mP_progress_counter
private

Definition at line 58 of file DWBASingleComputation.h.

Referenced by compute(), and setProgressHandler().

◆ m_region_map

std::map<size_t, std::vector<HomogeneousRegion> > DWBASingleComputation::m_region_map
private

Definition at line 59 of file DWBASingleComputation.h.

Referenced by addLayoutComputation(), and regionMap().


The documentation for this class was generated from the following files: