9 #include <boost/test/unit_test.hpp>
19 BOOST_AUTO_TEST_SUITE(material_properties)
35 MaterialSlab a(Material::fromMolarDensity(1., 2., 3., 4., 5.), 1.);
36 MaterialSlab b(Material::fromMolarDensity(2., 4., 6., 8., 10.), 2.);
37 MaterialSlab
c(Material::fromMolarDensity(4., 8., 12., 16., 20.), 3.);
38 std::vector<MaterialSlab> components = {a, b, c};
39 MaterialSlab abc(components);
42 CHECK_CLOSE_REL(abc.thickness() / abc.material().X0(), abc.thicknessInX0(),
44 CHECK_CLOSE_REL(abc.thickness() / abc.material().L0(), abc.thicknessInL0(),
49 a.thickness() + b.thickness() + c.thickness(),
eps);
51 a.thicknessInX0() + b.thicknessInX0() + c.thicknessInX0(),
54 a.thicknessInL0() + b.thicknessInL0() + c.thicknessInL0(),
58 (a.thickness() * a.material().massDensity() +
59 b.thickness() * b.material().massDensity() +
60 c.thickness() * c.material().massDensity()) /
61 (a.thickness() + b.thickness() + c.thickness()),
72 BOOST_CHECK_NE(mat, halfMat);
73 BOOST_CHECK_EQUAL(halfMat, halfScaled);
81 BOOST_AUTO_TEST_SUITE_END()