37 SolidMaterialsMap
const& constitutive_relations,
39 std::size_t
const element_id)
42 if (constitutive_relations.size() > 1 && material_ids ==
nullptr)
45 "There are {} constitutive relations provided in the project file "
46 "but no MaterialIDs could be found in the mesh.",
47 constitutive_relations.size());
50 int const material_id = ((constitutive_relations.size() == 1 &&
51 constitutive_relations.begin()->first == 0) ||
52 material_ids ==
nullptr)
54 : (*material_ids)[element_id];
56 auto const constitutive_relation = constitutive_relations.find(material_id);
57 if (constitutive_relation == end(constitutive_relations))
60 "No constitutive relation found for material id {:d} and element "
61 "{:d}. There are {:d} constitutive relations available, "
62 "corresponding to the ids: {}",
63 material_id, element_id, constitutive_relations.size(),
64 fmt::join(constitutive_relations | ranges::views::keys,
" "));
67 if (constitutive_relation->second ==
nullptr)
70 "The constitutive relation found for material id {:d} and element "
71 "{:d} is a nullptr, which is impossible.",
72 material_id, element_id);
75 return *constitutive_relation->second;