BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
DWBAComputation.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sim/Computation/DWBAComputation.h
6 //! @brief Defines class DWBAComputation.
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_SIM_COMPUTATION_DWBACOMPUTATION_H
21 #define BORNAGAIN_SIM_COMPUTATION_DWBACOMPUTATION_H
22 
24 #include <vector>
25 
26 class DiffuseElement;
29 class reSample;
31 class SimulationOptions;
32 
33 //! Provides function that performs a single-threaded DWBA computation
34 //! for a range of DiffuseElement%s.
35 //!
36 //! Handles progress counter and interrupts, runs loop over DiffuseElement%s,
37 //! delegates all further work to DWBATerm.
38 //!
39 //! Controlled by the multi-threading machinery in ISimulation::runSingleSimulation().
40 
41 class DWBAComputation : public IComputation {
42 public:
43  DWBAComputation(const reSample& re_sample, const SimulationOptions& options,
44  ProgressHandler& progress,
45  std::vector<std::unique_ptr<DiffuseElement>>::iterator begin_it,
46  std::vector<std::unique_ptr<DiffuseElement>>::iterator end_it);
47  ~DWBAComputation() override;
48 
49 private:
50  //! Performs a single-threaded DWBA computation for a DiffuseElement%s
51  //! in range m_begin_it ... m_end_it. Results are stored in those elements.
52  void runProtected() override;
53 
54  std::vector<std::unique_ptr<DiffuseElement>>::iterator m_begin_it, m_end_it;
55  const std::unique_ptr<const GISASSpecularContribution> m_specular_contrib;
56  const std::unique_ptr<const RoughMultiLayerContribution> m_roughness_contrib;
57  const std::vector<std::unique_ptr<const ParticleLayoutContribution>> m_layout_contribs;
58 };
59 
60 #endif // BORNAGAIN_SIM_COMPUTATION_DWBACOMPUTATION_H
61 #endif // USER_API
Defines interface IComputation.
Provides function that performs a single-threaded DWBA computation for a range of DiffuseElements.
void runProtected() override
Performs a single-threaded DWBA computation for a DiffuseElements in range m_begin_it ....
const std::unique_ptr< const RoughMultiLayerContribution > m_roughness_contrib
const std::vector< std::unique_ptr< const ParticleLayoutContribution > > m_layout_contribs
const std::unique_ptr< const GISASSpecularContribution > m_specular_contrib
~DWBAComputation() override
std::vector< std::unique_ptr< DiffuseElement > >::iterator m_end_it
std::vector< std::unique_ptr< DiffuseElement > >::iterator m_begin_it
DWBAComputation(const reSample &re_sample, const SimulationOptions &options, ProgressHandler &progress, std::vector< std::unique_ptr< DiffuseElement >>::iterator begin_it, std::vector< std::unique_ptr< DiffuseElement >>::iterator end_it)
Data stucture containing both input and output of a single detector cell.
Computes the specular signal in the bin where q_parallel = 0. Used by DWBAComputation.
Interface for a single-threaded computation with given range of DiffuseElements and ProgressHandler.
Definition: IComputation.h:37
Computes the scattering contribution from one particle layout. Instances are created and used by DWBA...
Maintains information about progress of a computation.
Computes the diffuse reflection from the rough interfaces of a sample. Used by DWBAComputation.
Collect the different options for simulation.SimulationOptions.
Data structure that contains all the necessary data for scattering calculations.
Definition: ReSample.h:41