BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
UnitConverterUtils.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Core/Simulation/UnitConverterUtils.h
6 //! @brief Declares utilities for unit converters.
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_UNITCONVERTERUTILS_H
16 #define BORNAGAIN_CORE_SIMULATION_UNITCONVERTERUTILS_H
17 
19 
20 class Instrument;
21 class Simulation;
22 template <class T> class OutputData;
23 
24 //! Namespace enclosing a number of utilities/helpers for unit converters
25 
27 {
28 
29 //! Returns zero-valued output data array in specified units
30 std::unique_ptr<OutputData<double>> createOutputData(const IUnitConverter& converter,
31  Axes::Units units);
32 
33 //! Helper factory function to use in GISASSimulation. Depending on the type of detector,
34 //! returns either RectangularConverter or SphericalConverter.
35 std::unique_ptr<IUnitConverter> createConverterForGISAS(const Instrument& instrument);
36 
37 std::unique_ptr<IUnitConverter> createConverter(const Simulation& simulation);
38 } // namespace UnitConverterUtils
39 
40 #endif // BORNAGAIN_CORE_SIMULATION_UNITCONVERTERUTILS_H
Defines interface IUnitConverter and possible axis units.
Interface to provide axis translations to different units for simulation output.
Assembles beam, detector and their relative positions with respect to the sample.
Definition: Instrument.h:34
Template class to store data of any type in multi-dimensional space.
Definition: OutputData.h:33
Pure virtual base class of OffSpecularSimulation, GISASSimulation and SpecularSimulation.
Definition: Simulation.h:38
Namespace enclosing a number of utilities/helpers for unit converters.
std::unique_ptr< IUnitConverter > createConverter(const Simulation &simulation)
std::unique_ptr< OutputData< double > > createOutputData(const IUnitConverter &converter, Axes::Units units)
Returns zero-valued output data array in specified units.
std::unique_ptr< IUnitConverter > createConverterForGISAS(const Instrument &instrument)
Helper factory function to use in GISASSimulation.