28 double thicknessInX0 =
static_cast<double>(slab1.
thicknessInX0()) +
30 double thicknessInL0 =
static_cast<double>(slab1.
thicknessInL0()) +
34 float x0 = thickness / thicknessInX0;
35 float l0 = thickness / thicknessInL0;
38 double molarAmount1 =
static_cast<double>(mat1.molarDensity()) *
40 double molarAmount2 =
static_cast<double>(mat2.molarDensity()) *
42 double molarAmount = molarAmount1 + molarAmount2;
45 if (not(0.0 < molarAmount)) {
51 float molarDensity = molarAmount /
thickness;
71 double weight1 = molarAmount1 / molarAmount;
72 double weight2 = molarAmount2 / molarAmount;
73 float ar = weight1 * mat1.Ar() + weight2 * mat2.Ar();
74 float z = weight1 * mat1.Z() + weight2 * mat2.Z();
76 return {Material::fromMolarDensity(x0, l0, ar, z, molarDensity),