BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
Slice Class Reference

Description

Data structure containing the data of a single slice, for calculating the Fresnel coefficients.

Definition at line 31 of file Slice.h.

Collaboration diagram for Slice:
[legend]

Public Member Functions

 Slice (const Slice &other)
 
 Slice (const ZLimits &zRange, Material material, const R3 &B_field, const LayerRoughness *roughness)
 
 Slice (Slice &&other)
 
 ~Slice ()
 
R3 bField () const
 
void initBField (R3 h_field, double h_z)
 Initializes the magnetic B field from a given ambient field strength H. More...
 
void invertBField ()
 
const Materialmaterial () const
 
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 magnetization. More...
 
complex_t scalarReducedPotential (R3 k, double n_ref) const
 Return the potential term that is used in the one-dimensional Fresnel calculations. More...
 
void setMaterial (const Material &material)
 
double thicknessOr0 () const
 
const LayerRoughnesstopRoughness () const
 
double zBottom () const
 
double zTop () const
 
double zTopOr0 () const
 

Private Attributes

R3 m_B_field
 cached value of magnetic induction More...
 
Material m_material
 
const LayerRoughness *const m_top_roughness
 
const ZLimits m_zRange
 

Constructor & Destructor Documentation

◆ Slice() [1/3]

Slice::Slice ( const ZLimits zRange,
Material  material,
const R3 &  B_field,
const LayerRoughness roughness 
)

Definition at line 22 of file Slice.cpp.

24  : m_zRange(zRange)
25  , m_material(std::move(material))
26  , m_B_field(B_field)
27  , m_top_roughness(roughness)
28 {
29 }
const ZLimits m_zRange
Definition: Slice.h:62
R3 m_B_field
cached value of magnetic induction
Definition: Slice.h:64
const Material & material() const
Definition: Slice.cpp:51
const LayerRoughness *const m_top_roughness
Definition: Slice.h:65
Material m_material
Definition: Slice.h:63

◆ Slice() [2/3]

Slice::Slice ( const Slice other)

Definition at line 31 of file Slice.cpp.

32  : Slice(other.m_zRange, other.m_material, other.m_B_field, other.m_top_roughness)
33 {
34 }
Slice(const ZLimits &zRange, Material material, const R3 &B_field, const LayerRoughness *roughness)
Definition: Slice.cpp:22

◆ Slice() [3/3]

Slice::Slice ( Slice &&  other)

Definition at line 36 of file Slice.cpp.

37  : m_zRange{other.m_zRange}
38  , m_material{std::move(other.m_material)}
39  , m_B_field{other.m_B_field}
41 {
42 }

◆ ~Slice()

Slice::~Slice ( )
default

Member Function Documentation

◆ bField()

R3 Slice::bField ( ) const
inline

Definition at line 57 of file Slice.h.

57 { return m_B_field; }

References m_B_field.

◆ initBField()

void Slice::initBField ( R3  h_field,
double  h_z 
)

Initializes the magnetic B field from a given ambient field strength H.

Definition at line 93 of file Slice.cpp.

94 {
95  static constexpr double Magnetic_Permeability = 4e-7 * M_PI;
96  m_B_field = Magnetic_Permeability * (h_field + m_material.magnetization());
97  m_B_field.setZ(Magnetic_Permeability * h_z);
98 }
#define M_PI
Definition: Constants.h:44
R3 magnetization() const
Get the magnetization (in A/m)
Definition: Material.cpp:78

References m_B_field, m_material, M_PI, and Material::magnetization().

Referenced by SliceStack::setBField().

Here is the call graph for this function:

◆ invertBField()

void Slice::invertBField ( )

Definition at line 100 of file Slice.cpp.

101 {
102  m_B_field = -m_B_field;
103 }

References m_B_field.

◆ material()

const Material & Slice::material ( ) const

◆ polarizedReducedPotential()

SpinMatrix Slice::polarizedReducedPotential ( R3  k,
double  n_ref 
) const

Return the potential term that is used in the one-dimensional Fresnel calculations in the presence of magnetization.

Definition at line 87 of file Slice.cpp.

88 {
89  complex_t n = m_material.refractiveIndex(2.0 * M_PI / k.mag());
91 }
complex_t refractiveIndex(double wavelength) const
Returns refractive index.
Definition: Material.cpp:48
SpinMatrix PolarizedReducedPotential(complex_t n, R3 b_field, R3 k, double n_ref)
Function for calculating the reduced potential, used for obtaining the Fresnel coefficients (polarize...

References m_B_field, m_material, M_PI, MaterialUtils::PolarizedReducedPotential(), and Material::refractiveIndex().

Here is the call graph for this function:

◆ scalarReducedPotential()

complex_t Slice::scalarReducedPotential ( R3  k,
double  n_ref 
) const

Return the potential term that is used in the one-dimensional Fresnel calculations.

Definition at line 81 of file Slice.cpp.

82 {
83  complex_t n = m_material.refractiveIndex(2.0 * M_PI / k.mag());
84  return MaterialUtils::ScalarReducedPotential(n, k, n_ref);
85 }
complex_t ScalarReducedPotential(complex_t n, R3 k, double n_ref)
Function for calculating the reduced potential, used for obtaining the Fresnel coefficients (non-pola...

References m_material, M_PI, Material::refractiveIndex(), and MaterialUtils::ScalarReducedPotential().

Here is the call graph for this function:

◆ setMaterial()

void Slice::setMaterial ( const Material material)

Definition at line 46 of file Slice.cpp.

47 {
49 }

References m_material, and material().

Here is the call graph for this function:

◆ thicknessOr0()

double Slice::thicknessOr0 ( ) const

Definition at line 71 of file Slice.cpp.

72 {
73  return m_zRange.thicknessOr0();
74 }
double thicknessOr0() const
Definition: ZLimits.h:43

References m_zRange, and ZLimits::thicknessOr0().

Referenced by RoughMultiLayerContribution::get_sum8terms().

Here is the call graph for this function:

◆ topRoughness()

const LayerRoughness * Slice::topRoughness ( ) const

Definition at line 76 of file Slice.cpp.

77 {
78  return m_top_roughness;
79 }

References m_top_roughness.

Referenced by ProfileHelper::calculateProfile(), RoughMultiLayerContribution::compute(), and reSample::hasRoughness().

◆ zBottom()

double Slice::zBottom ( ) const

Definition at line 56 of file Slice.cpp.

57 {
58  return m_zRange.zBottom();
59 }
double zBottom() const
Definition: ZLimits.h:39

References m_zRange, and ZLimits::zBottom().

Here is the call graph for this function:

◆ zTop()

double Slice::zTop ( ) const

Definition at line 61 of file Slice.cpp.

62 {
63  return m_zRange.zTop();
64 }
double zTop() const
Definition: ZLimits.h:40

References m_zRange, and ZLimits::zTop().

Referenced by ProfileHelper::calculateProfile().

Here is the call graph for this function:

◆ zTopOr0()

double Slice::zTopOr0 ( ) const

Definition at line 66 of file Slice.cpp.

67 {
68  return m_zRange.zTopOr0();
69 }
double zTopOr0() const
Definition: ZLimits.h:41

References m_zRange, and ZLimits::zTopOr0().

Here is the call graph for this function:

Member Data Documentation

◆ m_B_field

R3 Slice::m_B_field
private

cached value of magnetic induction

Definition at line 64 of file Slice.h.

Referenced by bField(), initBField(), invertBField(), and polarizedReducedPotential().

◆ m_material

Material Slice::m_material
private

◆ m_top_roughness

const LayerRoughness* const Slice::m_top_roughness
private

Definition at line 65 of file Slice.h.

Referenced by topRoughness().

◆ m_zRange

const ZLimits Slice::m_zRange
private

Definition at line 62 of file Slice.h.

Referenced by thicknessOr0(), zBottom(), zTop(), and zTopOr0().


The documentation for this class was generated from the following files: