18 std::unique_ptr<MaterialSpatialDistributionMap>
20 std::map<
int, std::shared_ptr<Medium>>
const& media,
25 int const max_material_id =
28 : *std::max_element(begin(*material_ids), end(*material_ids));
30 if (max_material_id >
static_cast<int>(media.size() - 1))
33 "The maximum value of MaterialIDs in mesh is {:d}. As the given "
34 "number of porous media definitions in the project file is {:d}, "
35 "the maximum value of MaterialIDs in mesh must be {:d} (index "
37 max_material_id, media.size(), max_material_id - 1);
40 if (max_material_id <
static_cast<int>(media.size() - 1))
43 "There are {:d} porous medium definitions in the project file but "
44 "only {:d} different values in the MaterialIDs vector/data_array "
46 media.size(), max_material_id - 1);
48 return std::make_unique<MaterialSpatialDistributionMap>(media,
void WARN(char const *fmt, Args const &... args)
Definition of the Mesh class.
std::unique_ptr< MaterialSpatialDistributionMap > createMaterialSpatialDistributionMap(std::map< int, std::shared_ptr< Medium >> const &media, MeshLib::Mesh const &mesh)
PropertyVector< int > const * materialIDs(Mesh const &mesh)