BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
Slice Class Reference
Collaboration diagram for Slice:

Public Member Functions

 Slice (double thickness, const Material &material)
 
 Slice (double thickness, const Material &material, const LayerRoughness &top_roughness)
 
 Slice (const Slice &other)
 
 Slice (Slice &&other)
 
Sliceoperator= (const Slice &other)
 
 ~Slice ()
 
void setMaterial (const Material &material)
 
Material material () const
 
double thickness () const
 
const LayerRoughnesstopRoughness () const
 
complex_t scalarReducedPotential (kvector_t k, double n_ref) const
 
Eigen::Matrix2cd polarizedReducedPotential (kvector_t k, double n_ref) const
 
void initBField (kvector_t h_field, double b_z)
 
kvector_t bField () const
 
void invertBField ()
 

Static Public Attributes

static constexpr double Magnetic_Permeability = 4e-7 * M_PI
 

Private Attributes

double m_thickness
 
Material m_material
 
kvector_t m_B_field
 
std::unique_ptr< LayerRoughnessmP_top_roughness
 

Detailed Description

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

Definition at line 27 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 }
kvector_t m_B_field
cached value of magnetic induction
Definition: Slice.h:63
Material material() const
Definition: Slice.cpp:63
std::unique_ptr< LayerRoughness > mP_top_roughness
Definition: Slice.h:64
double thickness() const
Definition: Slice.cpp:68
Material m_material
Definition: Slice.h:62
double m_thickness
Definition: Slice.h:61

◆ Slice() [2/4]

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

Definition at line 24 of file Slice.cpp.

26  top_roughness.clone()}
27 {
28 }
LayerRoughness * clone() const
Returns a clone of this ISample object.

◆ Slice() [3/4]

Slice::Slice ( const Slice other)

Definition at line 30 of file Slice.cpp.

33 {
34  if (other.mP_top_roughness) {
35  mP_top_roughness.reset(other.mP_top_roughness->clone());
36  }
37 }

References mP_top_roughness.

◆ Slice() [4/4]

Slice::Slice ( Slice &&  other)

Definition at line 39 of file Slice.cpp.

40  : m_thickness{other.m_thickness}, m_material{std::move(other.m_material)},
41  m_B_field{other.m_B_field}, mP_top_roughness{std::move(other.mP_top_roughness)}
42 {
43 }

◆ ~Slice()

Slice::~Slice ( )
default

Member Function Documentation

◆ operator=()

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

Definition at line 45 of file Slice.cpp.

46 {
47  m_thickness = other.m_thickness;
48  m_material = other.m_material;
49  m_B_field = other.m_B_field;
50  if (other.mP_top_roughness) {
51  mP_top_roughness.reset(other.mP_top_roughness->clone());
52  }
53  return *this;
54 }

References m_B_field, m_material, m_thickness, and mP_top_roughness.

◆ setMaterial()

void Slice::setMaterial ( const Material material)

Definition at line 58 of file Slice.cpp.

59 {
61 }

References m_material, and material().

Here is the call graph for this function:

◆ material()

Material Slice::material ( ) const

Definition at line 63 of file Slice.cpp.

64 {
65  return m_material;
66 }

References m_material.

Referenced by setMaterial().

◆ thickness()

double Slice::thickness ( ) const

Definition at line 68 of file Slice.cpp.

69 {
70  return m_thickness;
71 }

References m_thickness.

◆ topRoughness()

const LayerRoughness * Slice::topRoughness ( ) const

Definition at line 73 of file Slice.cpp.

74 {
75  return mP_top_roughness.get();
76 }

References mP_top_roughness.

◆ 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 78 of file Slice.cpp.

79 {
80  complex_t n = m_material.refractiveIndex(2.0 * M_PI / k.mag());
81  return MaterialUtils::ScalarReducedPotential(n, k, n_ref);
82 }
std::complex< double > complex_t
Definition: Complex.h:20
#define M_PI
Definition: MathConstants.h:39
double mag() const
Returns magnitude of the vector.
complex_t refractiveIndex(double wavelength) const
Returns refractive index.
Definition: Material.cpp:49
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:

◆ 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 84 of file Slice.cpp.

85 {
86  complex_t n = m_material.refractiveIndex(2.0 * M_PI / k.mag());
88 }
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:

◆ 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 90 of file Slice.cpp.

91 {
93  m_B_field.setZ(b_z);
94 }
void setZ(const T &a)
Sets z-component in cartesian coordinate system.
Definition: BasicVector3D.h:75
kvector_t magnetization() const
Get the magnetization (in A/m)
Definition: Material.cpp:79
static constexpr double Magnetic_Permeability
Definition: Slice.h:58

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

Here is the call graph for this function:

◆ bField()

kvector_t Slice::bField ( ) const
inline

Definition at line 54 of file Slice.h.

54 { return m_B_field; }

References m_B_field.

◆ invertBField()

void Slice::invertBField ( )

Definition at line 96 of file Slice.cpp.

97 {
99 }

References m_B_field.

Member Data Documentation

◆ Magnetic_Permeability

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

Definition at line 58 of file Slice.h.

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

◆ m_thickness

double Slice::m_thickness
private

Definition at line 61 of file Slice.h.

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

◆ m_material

Material Slice::m_material
private

◆ m_B_field

kvector_t Slice::m_B_field
private

cached value of magnetic induction

Definition at line 63 of file Slice.h.

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

◆ mP_top_roughness

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

Definition at line 64 of file Slice.h.

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


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