40 return {mat1,
static_cast<float>(
thickness)};
43 double thicknessInX0 =
static_cast<double>(slab1.
thicknessInX0()) +
45 double thicknessInL0 =
static_cast<double>(slab1.
thicknessInL0()) +
49 float x0 = thickness / thicknessInX0;
50 float l0 = thickness / thicknessInL0;
53 double molarAmount1 =
static_cast<double>(mat1.molarDensity()) *
55 double molarAmount2 =
static_cast<double>(mat2.molarDensity()) *
57 double molarAmount = molarAmount1 + molarAmount2;
60 if (not(0.0 < molarAmount)) {
66 float molarDensity = molarAmount /
thickness;
86 double molarWeight1 = molarAmount1 / molarAmount;
87 double molarWeight2 = molarAmount2 / molarAmount;
88 float ar = molarWeight1 * mat1.Ar() + molarWeight2 * mat2.Ar();
107 if (mat1.Z() != 0 && mat2.Z() != 0) {
108 z = exp(thicknessWeight1 * log(mat1.Z()) +
109 thicknessWeight2 * log(mat2.Z()));
111 z = thicknessWeight1 * mat1.Z() + thicknessWeight2 * mat2.Z();
114 return {Material::fromMolarDensity(x0, l0, ar, z, molarDensity),