32 double _magnetizationMagnitude = 1.e7;
35 double _sigmaRoughness = 0.;
36 int _effectiveSLD = 0;
40 Options NBilayers(
int n)
45 Options angle(
double angle)
50 Options magnetizationMagnitude(
double M)
52 _magnetizationMagnitude = M;
55 Options thicknessFe(
double t)
60 Options thicknessNi(
double t)
65 Options sigmaRoughness(
double r)
70 Options effectiveSLD(
int i)
85 FeNiBilayer(Options opt = {})
86 : NBilayers(opt._NBilayers)
88 , magnetizationMagnitude(opt._magnetizationMagnitude)
89 , thicknessFe(opt._thicknessFe)
90 , thicknessNi(opt._thicknessNi)
91 , sigmaRoughness(opt._sigmaRoughness)
92 , effectiveSLD(opt._effectiveSLD)
93 , roughnessModel(opt._roughnessModel)
95 if (angle != 0. && effectiveSLD != 0.)
96 throw std::runtime_error(
"Cannot perform scalar computation "
97 "for non-colinear magnetization");
99 magnetizationVector =
kvector_t(magnetizationMagnitude * std::sin(angle),
100 magnetizationMagnitude * std::cos(angle), 0);
101 sample = constructSample();
104 MultiLayer* release() {
return sample.release(); }
107 static constexpr
auto sldFe =
complex_t{8.02e-06, 0};
108 static constexpr
auto sldAu =
complex_t{4.6665e-6, 0};
109 static constexpr
auto sldNi =
complex_t{9.4245e-06, 0};
113 double magnetizationMagnitude;
116 double sigmaRoughness;
122 std::unique_ptr<MultiLayer> sample;
124 std::unique_ptr<MultiLayer> constructSample();
133 std::unique_ptr<MultiLayer> FeNiBilayer::constructSample()
135 auto sample = std::make_unique<MultiLayer>();
140 ?
MaterialBySLD(
"Fe", sldFe.real(), sldFe.imag(), magnetizationVector)
141 :
MaterialBySLD(
"Fe", sldFe.real() + effectiveSLD * rhoMconst * magnetizationMagnitude,
145 auto m_Substrate =
MaterialBySLD(
"Au", sldAu.real(), sldAu.imag());
147 Layer l_Fe{m_Fe, thicknessFe};
148 Layer l_Ni{m_Ni, thicknessNi};
151 sample->addLayer(
Layer{m_ambient});
153 for (
auto i = 0; i < NBilayers; ++i) {
154 sample->addLayerWithTopRoughness(l_Fe, roughness);
155 sample->addLayerWithTopRoughness(l_Ni, roughness);
158 sample->addLayerWithTopRoughness(
Layer{m_Substrate}, roughness);
159 sample->setRoughnessModel(roughnessModel);
165 auto sample = FeNiBilayer{Options()};
166 return sample.release();
171 auto sample = FeNiBilayer{
173 return sample.release();
178 auto sample = FeNiBilayer{
180 return sample.release();
185 auto sample = FeNiBilayer{Options().angle(38. *
Units::deg)};
186 return sample.release();
191 auto sample = FeNiBilayer{Options()
195 return sample.release();
200 auto sample = FeNiBilayer{Options()
204 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 in a MultiLayer sample.
Our sample model: a stack of layers one below the other.
RoughnessModel roughnessModel() const
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 deg
static constexpr double angstrom