19 std::map<
int, std::shared_ptr<Medium>>
const& media,
22 auto const material_ids = materialIDs(mesh);
24 int const max_material_id =
27 : *std::max_element(begin(*material_ids), end(*material_ids));
29 if (!material_ids && media.size() > 1)
32 "More than one porous medium definition (namely {}) is present in "
33 "the project file, but no MaterialIDs are present in the bulk "
38 if (max_material_id >
static_cast<int>(media.size() - 1))
41 "The maximum value of MaterialIDs in mesh is {:d}. As the given "
42 "number of porous media definitions in the project file is {:d}, "
43 "the maximum value of MaterialIDs in mesh must be {:d} (index "
45 max_material_id, media.size(), max_material_id - 1);
48 if (max_material_id <
static_cast<int>(media.size() - 1))
51 "There are {:d} porous medium definitions in the project file but "
52 "only {:d} different values in the MaterialIDs vector/data_array "
54 media.size(), max_material_id - 1);
56 return {media, material_ids};