BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
GISASSimulation.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Core/Simulation/GISASSimulation.h
6 //! @brief Defines class GISASSimulation.
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_CORE_SIMULATION_GISASSIMULATION_H
16 #define BORNAGAIN_CORE_SIMULATION_GISASSIMULATION_H
17 
20 
21 class MultiLayer;
22 class ISampleBuilder;
23 
24 //! Main class to run a Grazing-Incidence Small-Angle Scattering simulation.
25 //! @ingroup simulation
26 
28 public:
30 #ifndef SWIG
31  GISASSimulation(const Beam& beam, const IDetector& detector);
32 #endif // SWIG
35 
36  GISASSimulation* clone() const override { return new GISASSimulation(*this); }
37 
38  void accept(INodeVisitor* visitor) const override { visitor->visit(this); }
39 
40  //! Put into a clean state for running a simulation
41  void prepareSimulation() override;
42 
43  //! Returns the results of the simulation in a format that supports unit conversion and export
44  //! to numpy arrays
45  SimulationResult result() const override;
46 
47  //! Sets beam parameters from here (forwarded to Instrument)
48  void setBeamParameters(double wavelength, double alpha_i, double phi_i);
49 
50  //! Returns the total number of the intensity values in the simulation result
51  size_t intensityMapSize() const override;
52 
53 private:
54  GISASSimulation(const GISASSimulation& other);
55 
56  //! Initializes the vector of ISimulation elements
57  void initSimulationElementVector() override;
58 
59  void initialize();
60 };
61 
62 #endif // BORNAGAIN_CORE_SIMULATION_GISASSIMULATION_H
Defines interface ISimulation2D.
Defines class SimulationElement.
An incident neutron or x-ray beam.
Definition: Beam.h:27
Main class to run a Grazing-Incidence Small-Angle Scattering simulation.
void initSimulationElementVector() override
Initializes the vector of ISimulation elements.
GISASSimulation * clone() const override
void setBeamParameters(double wavelength, double alpha_i, double phi_i)
Sets beam parameters from here (forwarded to Instrument)
void accept(INodeVisitor *visitor) const override
Calls the INodeVisitor's visit method.
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.
SimulationResult result() const override
Returns the results of the simulation in a format that supports unit conversion and export to numpy a...
Abstract detector interface.
Definition: IDetector.h:36
Visitor interface to visit ISampleNode objects.
Definition: INodeVisitor.h:146
virtual void visit(const BasicLattice2D *)
Definition: INodeVisitor.h:151
Interface to the class capable to build samples to simulate.
Abstract base class of OffSpecularSimulation and GISASSimulation.
Definition: ISimulation2D.h:27
const MultiLayer * sample() const
IDetector & detector()
Definition: ISimulation.h:63
Beam & beam()
Definition: ISimulation.h:58
Our sample model: a stack of layers one below the other.
Definition: MultiLayer.h:41
Wrapper around OutputData<double> that also provides unit conversions.