BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
Slice Class Reference

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

Collaboration diagram for Slice:
[legend]

Public Member Functions

 Slice (const Slice &other)
 
 Slice (double thickness, const Material &material)
 
 Slice (double thickness, const Material &material, const LayerRoughness &top_roughness)
 
 Slice (Slice &&other)
 
 ~Slice ()
 
kvector_t bField () const
 
void initBField (kvector_t h_field, double b_z)
 Initializes the magnetic B field from a given ambient field strength H. More...
 
void invertBField ()
 
const Materialmaterial () const
 
Sliceoperator= (const Slice &other)
 
Eigen::Matrix2cd polarizedReducedPotential (kvector_t 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 (kvector_t 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 thickness () const
 
const LayerRoughnesstopRoughness () const
 

Static Public Attributes

static constexpr double Magnetic_Permeability = 4e-7 * M_PI
 

Private Attributes

kvector_t m_B_field
 cached value of magnetic induction More...
 
Material m_material
 
double m_thickness
 
std::unique_ptr< LayerRoughnessm_top_roughness
 

Detailed Description

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

Definition at line 32 of file Slice.h.

Constructor & Destructor Documentation

◆ Slice() [1/4]

Slice::Slice ( double  thickness,
const Material material 
)

Definition at line 19 of file Slice.cpp.

21 {
22 }
std::unique_ptr< LayerRoughness > m_top_roughness
Definition: Slice.h:68
kvector_t m_B_field
cached value of magnetic induction
Definition: Slice.h:67
const Material & material() const
Definition: Slice.cpp:69
double thickness() const
Definition: Slice.cpp:74
Material m_material
Definition: Slice.h:66
double m_thickness
Definition: Slice.h:65

◆ Slice() [2/4]

Slice::Slice ( double  thickness,
const Material material,
const LayerRoughness top_roughness 
)

Definition at line 24 of file Slice.cpp.

27  , m_B_field{}
28  , m_top_roughness{top_roughness.clone()}
29 {
30 }
LayerRoughness * clone() const
Returns a clone of this ISampleNode object.

◆ Slice() [3/4]

Slice::Slice ( const Slice other)

Definition at line 32 of file Slice.cpp.

33  : m_thickness{other.m_thickness}
34  , m_material{other.m_material}
35  , m_B_field{other.m_B_field}
36  , m_top_roughness{}
37 {
38  if (other.m_top_roughness) {
39  m_top_roughness.reset(other.m_top_roughness->clone());
40  }
41 }

References m_top_roughness.

◆ Slice() [4/4]

Slice::Slice ( Slice &&  other)

Definition at line 43 of file Slice.cpp.

44  : m_thickness{other.m_thickness}
45  , m_material{std::move(other.m_material)}
46  , m_B_field{other.m_B_field}
47  , m_top_roughness{std::move(other.m_top_roughness)}
48 {
49 }

◆ ~Slice()

Slice::~Slice ( )
default

Member Function Documentation

◆ bField()

kvector_t Slice::bField ( ) const
inline

Definition at line 58 of file Slice.h.

58 { return m_B_field; }

References m_B_field.

◆ initBField()

void Slice::initBField ( kvector_t  h_field,
double  b_z 
)

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

Definition at line 96 of file Slice.cpp.

97 {
99  m_B_field.setZ(b_z);
100 }
void setZ(const T &a)
Sets z-component in cartesian coordinate system.
Definition: BasicVector3D.h:74
kvector_t magnetization() const
Get the magnetization (in A/m)
Definition: Material.cpp:76
static constexpr double Magnetic_Permeability
Definition: Slice.h:62

References m_B_field, m_material, Magnetic_Permeability, Material::magnetization(), and BasicVector3D< T >::setZ().

Here is the call graph for this function:

◆ invertBField()

void Slice::invertBField ( )

Definition at line 102 of file Slice.cpp.

103 {
104  m_B_field = -m_B_field;
105 }

References m_B_field.

◆ material()

const Material & Slice::material ( ) const

Definition at line 69 of file Slice.cpp.

70 {
71  return m_material;
72 }

References m_material.

Referenced by setMaterial().

◆ operator=()

Slice & Slice::operator= ( const Slice other)

Definition at line 51 of file Slice.cpp.

52 {
53  m_thickness = other.m_thickness;
54  m_material = other.m_material;
55  m_B_field = other.m_B_field;
56  if (other.m_top_roughness) {
57  m_top_roughness.reset(other.m_top_roughness->clone());
58  }
59  return *this;
60 }

References m_B_field, m_material, m_thickness, and m_top_roughness.

◆ polarizedReducedPotential()

Eigen::Matrix2cd Slice::polarizedReducedPotential ( kvector_t  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 90 of file Slice.cpp.

91 {
92  complex_t n = m_material.refractiveIndex(2.0 * M_PI / k.mag());
94 }
std::complex< double > complex_t
Definition: Complex.h:20
#define M_PI
Definition: Constants.h:44
double mag() const
Returns magnitude of the vector.
complex_t refractiveIndex(double wavelength) const
Returns refractive index.
Definition: Material.cpp:46
Eigen::Matrix2cd PolarizedReducedPotential(complex_t n, kvector_t b_field, kvector_t 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, BasicVector3D< T >::mag(), MaterialUtils::PolarizedReducedPotential(), and Material::refractiveIndex().

Here is the call graph for this function:

◆ scalarReducedPotential()

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

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

Definition at line 84 of file Slice.cpp.

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

References m_material, M_PI, BasicVector3D< T >::mag(), Material::refractiveIndex(), and MaterialUtils::ScalarReducedPotential().

Here is the call graph for this function:

◆ setMaterial()

void Slice::setMaterial ( const Material material)

Definition at line 64 of file Slice.cpp.

65 {
67 }

References m_material, and material().

Here is the call graph for this function:

◆ thickness()

double Slice::thickness ( ) const

Definition at line 74 of file Slice.cpp.

75 {
76  return m_thickness;
77 }

References m_thickness.

◆ topRoughness()

const LayerRoughness * Slice::topRoughness ( ) const

Definition at line 79 of file Slice.cpp.

80 {
81  return m_top_roughness.get();
82 }

References m_top_roughness.

Member Data Documentation

◆ m_B_field

kvector_t Slice::m_B_field
private

cached value of magnetic induction

Definition at line 67 of file Slice.h.

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

◆ m_material

Material Slice::m_material
private

◆ m_thickness

double Slice::m_thickness
private

Definition at line 65 of file Slice.h.

Referenced by operator=(), and thickness().

◆ m_top_roughness

std::unique_ptr<LayerRoughness> Slice::m_top_roughness
private

Definition at line 68 of file Slice.h.

Referenced by Slice(), operator=(), and topRoughness().

◆ Magnetic_Permeability

constexpr double Slice::Magnetic_Permeability = 4e-7 * M_PI
staticconstexpr

Definition at line 62 of file Slice.h.

Referenced by initBField(), and ProcessedSample::initBFields().


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