9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/unit_test.hpp>
31 std::vector<double> rPos = {0., 1., 2.};
32 std::vector<double> xPos = {0., 1., 2.};
33 std::vector<double> yPos = {0., 1., 2.};
34 std::vector<double> zPos = {0., 1., 2.};
37 std::vector<Material> material_rz;
38 for (
int i = 0;
i < 9;
i++) {
42 auto localToGlobalBin_rz = [](std::array<size_t, 2> binsRZ,
43 std::array<size_t, 2> nBinsRZ) {
44 return (binsRZ.at(1) * nBinsRZ.at(0) + binsRZ.at(0));
50 std::vector<size_t> nBins_rz = {rPos.size(), zPos.size()};
51 std::vector<double> minima_rz = {0., 0.};
52 std::vector<double> maxima_rz = {3., 3.};
53 BOOST_CHECK(mapper_rz.getNBins() == nBins_rz);
56 BOOST_CHECK(mapper_rz.getMin() == minima_rz);
59 BOOST_CHECK(mapper_rz.getMax() == maxima_rz);
62 std::vector<Material> material_xyz;
63 for (
int i = 0;
i < 27;
i++) {
67 auto localToGlobalBin_xyz = [](std::array<size_t, 3> binsXYZ,
68 std::array<size_t, 3> nBinsXYZ) {
69 return (binsXYZ.at(0) * (nBinsXYZ.at(1) * nBinsXYZ.at(2)) +
70 binsXYZ.at(1) * nBinsXYZ.at(2) + binsXYZ.at(2));
77 std::vector<size_t> nBins_xyz = {xPos.size(), yPos.size(), zPos.size()};
78 std::vector<double> minima_xyz = {0., 0., 0.};
79 std::vector<double> maxima_xyz = {3., 3., 3.};
80 BOOST_CHECK(mapper_xyz.getNBins() == nBins_xyz);
83 BOOST_CHECK(mapper_xyz.getMin() == minima_xyz);
86 BOOST_CHECK(mapper_xyz.getMax() == maxima_xyz);
92 auto value0_rz = mapper_rz.getMaterial(pos0_rz);
93 auto value1_rz = mapper_rz.getMaterial(pos1_rz);
94 auto value2_rz = mapper_rz.getMaterial(pos2_rz);
97 localToGlobalBin_rz({{0, 0}}, {{rPos.size(), zPos.size()}}));
99 localToGlobalBin_rz({{1, 1}}, {{rPos.size(), zPos.size()}}));
101 localToGlobalBin_rz({{2, 2}}, {{rPos.size(), zPos.size()}}));
113 auto value0_xyz = mapper_xyz.getMaterial(pos0_xyz);
114 auto value1_xyz = mapper_xyz.getMaterial(pos1_xyz);
115 auto value2_xyz = mapper_xyz.getMaterial(pos2_xyz);
117 Material mat0_xyz = material_xyz.at(localToGlobalBin_xyz(
118 {{0, 0, 0}}, {{xPos.size(), yPos.size(), zPos.size()}}));
119 Material mat1_xyz = material_xyz.at(localToGlobalBin_xyz(
120 {{1, 1, 1}}, {{xPos.size(), yPos.size(), zPos.size()}}));
121 Material mat2_xyz = material_xyz.at(localToGlobalBin_xyz(
122 {{2, 2, 2}}, {{xPos.size(), yPos.size(), zPos.size()}}));