34 double _magnetizationMagnitude = 1.e7;
37 double _sigmaRoughness = 0.;
38 int _effectiveSLD = 0;
54 _magnetizationMagnitude = M;
89 : NBilayers(opt._NBilayers), angle(opt._angle),
90 magnetizationMagnitude(opt._magnetizationMagnitude), thicknessFe(opt._thicknessFe),
91 thicknessNi(opt._thicknessNi), sigmaRoughness(opt._sigmaRoughness),
92 effectiveSLD(opt._effectiveSLD), roughnessModel(opt._roughnessModel)
94 if (angle != 0. && effectiveSLD != 0.)
95 throw std::runtime_error(
"Cannot perform scalar computation "
96 "for non-colinear magnetization");
98 magnetizationVector =
kvector_t(magnetizationMagnitude * std::sin(angle),
99 magnetizationMagnitude * std::cos(angle), 0);
100 sample = constructSample();
123 std::unique_ptr<MultiLayer> constructSample();
132 std::unique_ptr<MultiLayer> FeNiBilayer::constructSample()
134 auto sample = std::make_unique<MultiLayer>();
139 ?
MaterialBySLD(
"Fe", sldFe.real(), sldFe.imag(), magnetizationVector)
144 auto m_Substrate =
MaterialBySLD(
"Au", sldAu.real(), sldAu.imag());
146 Layer l_Fe{m_Fe, thicknessFe};
147 Layer l_Ni{m_Ni, thicknessNi};
150 sample->addLayer(
Layer{m_ambient});
152 for (
auto i = 0; i < NBilayers; ++i) {
153 sample->addLayerWithTopRoughness(l_Fe, roughness);
154 sample->addLayerWithTopRoughness(l_Ni, roughness);
157 sample->addLayerWithTopRoughness(
Layer{m_Substrate}, roughness);
158 sample->setRoughnessModel(roughnessModel);
164 auto sample = FeNiBilayer{Options()};
165 return sample.release();
170 auto sample = FeNiBilayer{
172 return sample.release();
177 auto sample = FeNiBilayer{
179 return sample.release();
184 auto sample = FeNiBilayer{Options().angle(38. *
Units::degree)};
185 return sample.release();
190 auto sample = FeNiBilayer{Options()
194 return sample.release();
199 auto sample = FeNiBilayer{Options()
203 return sample.release();
std::complex< double > complex_t
Defines various sample builder classes to test polarized specular computations.
Defines class LayerRoughness.
Factory functions used to create material instances.
Defines class MultiLayer.
Defines the values of physical constants (SI)
Defines some unit conversion factors and other constants in namespace Units.
BasicVector3D< double > kvector_t
MultiLayer * buildSample() const
MultiLayer * buildSample() const
MultiLayer * buildSample() const
MultiLayer * buildSample() const
MultiLayer * buildSample() const
MultiLayer * buildSample() const
A roughness of interface between two layers.
A layer, with thickness (in nanometer) and material.
Our sample model: a stack of layers one below the other.
RoughnessModel roughnessModel() const
Creates the sample demonstrating an Fe-Ni Bilayer with and without roughness.
FeNiBilayer(Options opt={})
RoughnessModel roughnessModel
double magnetizationMagnitude
std::unique_ptr< MultiLayer > sample
kvector_t magnetizationVector
Options thicknessNi(double t)
Options angle(double angle)
Options effectiveSLD(int i)
Options sigmaRoughness(double r)
Options thicknessFe(double t)
Options magnetizationMagnitude(double M)
Options roughnessModel(RoughnessModel rm)
constexpr double g_factor_n
neutron g-factor
constexpr double h_bar
Reduced Plank constant, J s.
constexpr double m_n
Neutron mass, kg.
constexpr double mu_N
Nuclear magneton ( ), J/T.
static constexpr double angstrom
static constexpr double degree