BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
SpecularComputation.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Core/Computation/SpecularComputation.h
6 //! @brief Defines class SpecularComputation.
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_SPECULARCOMPUTATION_H
21 #define BORNAGAIN_CORE_COMPUTATION_SPECULARCOMPUTATION_H
22 
24 
25 class MultiLayer;
28 
29 //! Performs a single-threaded specular computation with given sample.
30 //!
31 //! Controlled by the multi-threading machinery in ISimulation::runSingleSimulation().
32 //!
33 //! @ingroup algorithms_internal
34 
36  using SpecularElementIter = std::vector<SpecularSimulationElement>::iterator;
37 
38 public:
39  SpecularComputation(const MultiLayer& multilayer, const SimulationOptions& options,
40  ProgressHandler& progress, SpecularElementIter begin_it,
41  SpecularElementIter end_it, bool forcePolarized=false);
43 
44 private:
45  void runProtected() override;
46 
47  //! these iterators define the span of detector bins this simulation will work on
49  mutable std::unique_ptr<SpecularComputationTerm> m_computation_term;
50 };
51 
52 #endif // BORNAGAIN_CORE_COMPUTATION_SPECULARCOMPUTATION_H
53 #endif // USER_API
Defines interface IComputation.
Interface for a single-threaded computation with given range of SimulationElements and ProgressHandle...
Definition: IComputation.h:39
Our sample model: a stack of layers one below the other.
Definition: MultiLayer.h:41
Maintains information about progress of a computation.
Collect the different options for simulation.
Computes the specular scattering.
Performs a single-threaded specular computation with given sample.
std::unique_ptr< SpecularComputationTerm > m_computation_term
std::vector< SpecularSimulationElement >::iterator SpecularElementIter
void runProtected() override
const SpecularElementIter m_begin_it
these iterators define the span of detector bins this simulation will work on
const SpecularElementIter m_end_it
SpecularComputation(const MultiLayer &multilayer, const SimulationOptions &options, ProgressHandler &progress, SpecularElementIter begin_it, SpecularElementIter end_it, bool forcePolarized=false)
~SpecularComputation() override
Data stucture containing both input and output of a single image pixel for specular simulation.