BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
Slice.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Resample/Slice/Slice.h
6 //! @brief Defines class Slice.
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_SLICE_H
21 #define BORNAGAIN_RESAMPLE_SLICE_SLICE_H
22 
23 #include "Resample/Slice/ZLimits.h"
25 #include <memory>
26 
27 class LayerRoughness;
28 
29 //! Data structure containing the data of a single slice, for calculating the Fresnel coefficients.
30 
31 class Slice {
32 public:
33  Slice(const ZLimits& zRange, Material material, const R3& B_field,
34  const LayerRoughness* roughness);
35  Slice(const Slice& other);
36  Slice(Slice&& other);
37  ~Slice();
38 
39  void setMaterial(const Material& material);
40  const Material& material() const;
41 
42  double zBottom() const;
43  double zTop() const;
44  double zTopOr0() const;
45  double thicknessOr0() const;
46  const LayerRoughness* topRoughness() const;
47 
48  //! Return the potential term that is used in the one-dimensional Fresnel calculations
49  complex_t scalarReducedPotential(R3 k, double n_ref) const;
50 
51  //! Return the potential term that is used in the one-dimensional Fresnel calculations
52  //! in the presence of magnetization
53  SpinMatrix polarizedReducedPotential(R3 k, double n_ref) const;
54 
55  //! Initializes the magnetic B field from a given ambient field strength H
56  void initBField(R3 h_field, double h_z);
57  R3 bField() const { return m_B_field; }
58 
59  void invertBField();
60 
61 private:
64  R3 m_B_field; //!< cached value of magnetic induction
66 };
67 
68 #endif // BORNAGAIN_RESAMPLE_SLICE_SLICE_H
69 #endif // USER_API
Defines and implements class Material.
Defines class ZLimits.
A roughness of interface between two layers.
A wrapper for underlying material implementation.
Definition: Material.h:35
Data structure containing the data of a single slice, for calculating the Fresnel coefficients.
Definition: Slice.h:31
SpinMatrix polarizedReducedPotential(R3 k, double n_ref) const
Return the potential term that is used in the one-dimensional Fresnel calculations in the presence of...
Definition: Slice.cpp:87
R3 bField() const
Definition: Slice.h:57
const ZLimits m_zRange
Definition: Slice.h:62
complex_t scalarReducedPotential(R3 k, double n_ref) const
Return the potential term that is used in the one-dimensional Fresnel calculations.
Definition: Slice.cpp:81
double zBottom() const
Definition: Slice.cpp:56
double thicknessOr0() const
Definition: Slice.cpp:71
void initBField(R3 h_field, double h_z)
Initializes the magnetic B field from a given ambient field strength H.
Definition: Slice.cpp:93
R3 m_B_field
cached value of magnetic induction
Definition: Slice.h:64
void invertBField()
Definition: Slice.cpp:100
void setMaterial(const Material &material)
Definition: Slice.cpp:46
double zTop() const
Definition: Slice.cpp:61
const Material & material() const
Definition: Slice.cpp:51
const LayerRoughness *const m_top_roughness
Definition: Slice.h:65
const LayerRoughness * topRoughness() const
Definition: Slice.cpp:76
Material m_material
Definition: Slice.h:63
double zTopOr0() const
Definition: Slice.cpp:66
Slice(const ZLimits &zRange, Material material, const R3 &B_field, const LayerRoughness *roughness)
Definition: Slice.cpp:22
An interval. Limits are of type double, and may be infinite. Used for the z-coordinate,...
Definition: ZLimits.h:32