14#include <spdlog/fmt/bundled/core.h>
15#include <spdlog/fmt/bundled/ranges.h>
17#include <range/v3/view/map.hpp>
25 return const_cast<Medium*
>(
31 std::size_t
const element_id)
const
33 auto const material_id =
38 if (
auto const it =
media_.find(material_id); it !=
media_.end())
40 return it->second.get();
49 assert(material_id == 0);
50 ERR(
"No MaterialIDs given in the mesh therefore default material id = "
53 auto keys =
media_ | ranges::views::keys;
57 ERR(
"Single medium for material id {} is defined.",
58 fmt::join(keys,
", "));
62 ERR(
"Media for material ids {} are defined.", fmt::join(keys,
", "));
64 OGS_FATAL(
"No medium for material id {} found for element {}.", material_id,
69 std::size_t
const element_id)
const
71 auto const material_id =
76 "There is no medium definition for element {:d} with material "
77 "ID {:d}. Please define a medium for each material.",
78 element_id, material_id);
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition of the Mesh class.
void checkElementHasMedium(std::size_t const element_id) const
MeshLib::PropertyVector< int > const *const material_ids_
Medium * getMedium(std::size_t element_id)
std::map< int, std::shared_ptr< Medium > > const & media_