BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
ScatteringSimulation.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sim/Simulation/ScatteringSimulation.h
6 //! @brief Defines class ScatteringSimulation.
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 #ifndef BORNAGAIN_SIM_SIMULATION_SCATTERINGSIMULATION_H
16 #define BORNAGAIN_SIM_SIMULATION_SCATTERINGSIMULATION_H
17 
19 
20 class MultiLayer;
21 
22 //! GISAS simulation.
23 //!
24 //! Holds an instrument and sample model.
25 //! Computes the scattered intensity as function of 2D detector coordinates.
26 //! @ingroup simulation
27 
29 public:
31  ~ScatteringSimulation() override = default;
32 
33  std::string className() const final { return "ScatteringSimulation"; }
34 
35  //! Returns the total number of the intensity values in the simulation result
36  size_t intensityMapSize() const override;
37 
38 #ifndef SWIG
39  ICoordSystem* createCoordSystem() const override;
40 
41 private:
42  SimulationResult pack_result() override;
43 
44  //! Put into a clean state for running a simulation
45  void prepareSimulation() override;
46 
47  //! Initializes the vector of ISimulation elements
48  void initElementVector() override;
49 #endif // SWIG
50 };
51 
52 #endif // BORNAGAIN_SIM_SIMULATION_SCATTERINGSIMULATION_H
Defines interface ISimulation2D.
An incident neutron or x-ray beam.
Definition: Beam.h:28
Interface to provide axis translations to different units for simulation output.
Definition: ICoordSystem.h:40
Abstract detector interface.
Definition: IDetector.h:57
Abstract base class of simulations that generate 2D patterns.
Definition: ISimulation2D.h:34
IDetector & detector()
Definition: ISimulation2D.h:58
Beam & beam()
Definition: ISimulation2D.h:57
const MultiLayer * sample() const
Our sample model: a stack of layers one below the other.
Definition: MultiLayer.h:43
std::string className() const final
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
ICoordSystem * createCoordSystem() const override
ScatteringSimulation(const Beam &beam, const MultiLayer &sample, const IDetector &detector)
void initElementVector() override
Initializes the vector of ISimulation elements.
size_t intensityMapSize() const override
Returns the total number of the intensity values in the simulation result.
void prepareSimulation() override
Put into a clean state for running a simulation.
~ScatteringSimulation() override=default
SimulationResult pack_result() override
Sets m_result.
Wrapper around Datafield that also provides unit conversions.