34 double _magnetizationMagnitude = 1.e7;
35 double _thicknessFe = 100. * Units::angstrom;
36 double _thicknessNi = 40. * Units::angstrom;
37 double _sigmaRoughness = 0.;
38 int _effectiveSLD = 0;
39 RoughnessModel _roughnessModel = RoughnessModel::TANH;
42 Options NBilayers(
int n)
47 Options angle(
double angle)
52 Options magnetizationMagnitude(
double M)
54 _magnetizationMagnitude = M;
57 Options thicknessFe(
double t)
62 Options thicknessNi(
double t)
67 Options sigmaRoughness(
double r)
72 Options effectiveSLD(
int i)
77 Options roughnessModel(RoughnessModel rm)
88 FeNiBilayer(Options opt = {})
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();
103 MultiLayer* release() {
return sample.release(); }
106 static constexpr
auto sldFe = complex_t{8.02e-06, 0};
107 static constexpr
auto sldAu = complex_t{4.6665e-6, 0};
108 static constexpr
auto sldNi = complex_t{9.4245e-06, 0};
112 double magnetizationMagnitude;
115 double sigmaRoughness;
117 RoughnessModel roughnessModel;
121 std::unique_ptr<MultiLayer> sample;
123 std::unique_ptr<MultiLayer> constructSample();
128 const complex_t FeNiBilayer::sldFe;
129 const complex_t FeNiBilayer::sldAu;
130 const complex_t FeNiBilayer::sldNi;
132 std::unique_ptr<MultiLayer> FeNiBilayer::constructSample()
134 auto sample = std::make_unique<MultiLayer>();
136 auto m_ambient = MaterialBySLD(
"Ambient", 0.0, 0.0);
139 ? MaterialBySLD(
"Fe", sldFe.real(), sldFe.imag(), magnetizationVector)
140 : MaterialBySLD(
"Fe", sldFe.real() + effectiveSLD * rhoMconst * magnetizationMagnitude,
143 auto m_Ni = MaterialBySLD(
"Ni", sldNi.real(), sldNi.imag());
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);
162 MultiLayer* FeNiBilayerBuilder::buildSample()
const
164 auto sample = FeNiBilayer{Options()};
165 return sample.release();
168 MultiLayer* FeNiBilayerTanhBuilder::buildSample()
const
170 auto sample = FeNiBilayer{
171 Options().sigmaRoughness(2. * Units::angstrom).roughnessModel(RoughnessModel::TANH)};
172 return sample.release();
175 MultiLayer* FeNiBilayerNCBuilder::buildSample()
const
177 auto sample = FeNiBilayer{
178 Options().sigmaRoughness(2. * Units::angstrom).roughnessModel(RoughnessModel::NEVOT_CROCE)};
179 return sample.release();
182 MultiLayer* FeNiBilayerSpinFlipBuilder::buildSample()
const
184 auto sample = FeNiBilayer{Options().angle(38. * Units::degree)};
185 return sample.release();
188 MultiLayer* FeNiBilayerSpinFlipTanhBuilder::buildSample()
const
190 auto sample = FeNiBilayer{Options()
191 .angle(38 * Units::degree)
192 .sigmaRoughness(2. * Units::angstrom)
193 .roughnessModel(RoughnessModel::TANH)};
194 return sample.release();
197 MultiLayer* FeNiBilayerSpinFlipNCBuilder::buildSample()
const
199 auto sample = FeNiBilayer{Options()
200 .angle(38 * Units::degree)
201 .sigmaRoughness(2. * Units::angstrom)
202 .roughnessModel(RoughnessModel::NEVOT_CROCE)};
203 return sample.release();
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)
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.
Defines some unit conversion factors and other constants in namespace Units.
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.