9 #include <boost/test/unit_test.hpp>
18 static constexpr
auto eps = 2 * std::numeric_limits<float>::epsilon();
20 BOOST_AUTO_TEST_SUITE(material_properties)
36 MaterialSlab
a(Material::fromMolarDensity(1., 2., 3., 4., 5.), 1.);
37 MaterialSlab
b(Material::fromMolarDensity(2., 4., 6., 8., 10.), 2.);
38 MaterialSlab
c(Material::fromMolarDensity(4., 8., 12., 16., 20.), 3.);
40 MaterialSlab abc(components);
43 CHECK_CLOSE_REL(abc.thickness() / abc.material().X0(), abc.thicknessInX0(),
45 CHECK_CLOSE_REL(abc.thickness() / abc.material().L0(), abc.thicknessInL0(),
50 a.thickness() + b.thickness() + c.thickness(),
eps);
52 a.thicknessInX0() + b.thicknessInX0() + c.thicknessInX0(),
55 a.thicknessInL0() + b.thicknessInL0() + c.thicknessInL0(),
59 (a.thickness() * a.material().massDensity() +
60 b.thickness() * b.material().massDensity() +
61 c.thickness() * c.material().massDensity()) /
62 (a.thickness() + b.thickness() + c.thickness()),
73 BOOST_CHECK_NE(mat, halfMat);
74 BOOST_CHECK_EQUAL(halfMat, halfScaled);
82 BOOST_AUTO_TEST_SUITE_END()