20 : std::vector<
Slice>((std::vector<
Slice>)other)
21 , m_roughness_model(other.roughnessModel())
34 double top = this->back().zBottom();
36 std::unique_ptr<ZLimits> zRange;
40 zRange = std::make_unique<ZLimits>(top - thickness, top);
41 this->emplace_back(
Slice(*zRange, material, {}, roughness));
51 const double slice_thickness = thickness / n;
52 addSlice(slice_thickness, material, roughness);
53 for (
size_t i = 1; i < n; ++i)
61 const double M_z0 = this->at(0).material().magnetization().z();
62 const double H_z = externalField.z() + M_z0;
63 for (
Slice& slice : *
this)
70 return std::any_of(this->cbegin(), this->cend(), [](
const Slice& slice) ->
bool {
71 return slice.
material().isMagneticMaterial();
77 if (i_slice + 1 < size())
78 return (*
this)[i_slice + 1].topRoughness();
Defines the macro ASSERT.
#define ASSERT(condition)
Defines class SliceStack.
A roughness of interface between two layers.
A wrapper for underlying material implementation.
SliceStack(const RoughnessModel roughness_model)
SliceStack setBField(const R3 &externalField)
void addTopSlice(double zbottom, const Material &material)
void addNSlices(size_t n, double thickness, const Material &material, const LayerRoughness *roughness=nullptr)
Adds n times the same slice to the stack.
const LayerRoughness * bottomRoughness(size_t i_slice) const
void addSlice(double thickness, const Material &material, const LayerRoughness *roughness=nullptr)
bool containsMagneticMaterial() const
Data structure containing the data of a single slice, for calculating the Fresnel coefficients.
void initBField(R3 h_field, double h_z)
Initializes the magnetic B field from a given ambient field strength H.
const Material & material() const
An interval. Limits are of type double, and may be infinite. Used for the z-coordinate,...
static constexpr double inf