BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
SliceStack.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Resample/Slice/SliceStack.h
6 //! @brief Defines class SliceStack.
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_RESAMPLE_SLICE_SLICESTACK_H
21 #define BORNAGAIN_RESAMPLE_SLICE_SLICESTACK_H
22 
23 #include "Resample/Slice/Slice.h" // TODO move back to cpp file
24 #include <heinz/Vectors3D.h>
25 
26 // - either get rid of m_roughness_model
27 // - or of inheritance from std::vector
28 
30 #include <vector>
31 
32 class LayerRoughness;
33 class Material;
34 class Slice;
35 
36 //! A stack of Slice%s.
37 
38 class SliceStack : public std::vector<Slice> {
39 public:
40  SliceStack(const RoughnessModel roughness_model)
41  : m_roughness_model(roughness_model)
42  {
43  }
44  SliceStack(const SliceStack& other);
45 
46  void addTopSlice(double zbottom, const Material& material);
47  void addSlice(double thickness, const Material& material,
48  const LayerRoughness* roughness = nullptr);
49  void addNSlices(size_t n, double thickness, const Material& material,
50  const LayerRoughness* roughness = nullptr);
51 
52  SliceStack setBField(const R3& externalField);
53 
54  bool containsMagneticMaterial() const;
55  const LayerRoughness* bottomRoughness(size_t i_slice) const;
56 
58 
59 private:
61 };
62 
63 #endif // BORNAGAIN_RESAMPLE_SLICE_SLICESTACK_H
64 #endif // USER_API
Define RoughnessModels enumerator and Python wrapper.
Defines class Slice.
A roughness of interface between two layers.
A wrapper for underlying material implementation.
Definition: Material.h:35
A stack of Slices.
Definition: SliceStack.h:38
SliceStack(const RoughnessModel roughness_model)
Definition: SliceStack.h:40
SliceStack setBField(const R3 &externalField)
Definition: SliceStack.cpp:57
void addTopSlice(double zbottom, const Material &material)
Definition: SliceStack.cpp:25
void addNSlices(size_t n, double thickness, const Material &material, const LayerRoughness *roughness=nullptr)
Adds n times the same slice to the stack.
Definition: SliceStack.cpp:46
const RoughnessModel m_roughness_model
Definition: SliceStack.h:60
const LayerRoughness * bottomRoughness(size_t i_slice) const
Definition: SliceStack.cpp:75
void addSlice(double thickness, const Material &material, const LayerRoughness *roughness=nullptr)
Definition: SliceStack.cpp:30
RoughnessModel roughnessModel() const
Definition: SliceStack.h:57
bool containsMagneticMaterial() const
Definition: SliceStack.cpp:68
Data structure containing the data of a single slice, for calculating the Fresnel coefficients.
Definition: Slice.h:31