15 std::string
const&
name,
17 std::size_t n_components)
19 std::map<std::string, PropertyVectorBase*>::const_iterator it(
20 _properties.find(
name)
22 if (it != _properties.end()) {
23 ERR(
"A property of the name '{:s}' is already assigned to the mesh.",
39 std::string
const&
name,
40 std::size_t n_prop_groups,
41 std::vector<std::size_t>
const& item2group_mapping,
43 std::size_t n_components)
46 std::map<std::string, PropertyVectorBase*>::const_iterator it(
47 _properties.find(
name)
49 if (it != _properties.end()) {
50 ERR(
"A property of the name '{:s}' already assigned to the mesh.",
56 for (std::size_t k(0); k<item2group_mapping.size(); k++) {
57 std::size_t
const group_id (item2group_mapping[k]);
58 if (group_id >= n_prop_groups) {
59 ERR(
"The mapping to property {:d} for item {:d} is not in the "
60 "correct range [0,{:d}).",
61 group_id, k, n_prop_groups);
68 std::pair<std::string, PropertyVectorBase*>(
71 item2group_mapping,
name, mesh_item_type, n_components)
79 bool Properties::existsPropertyVector(std::string
const&
name)
const
81 auto it(_properties.find(
name));
83 if (it == _properties.end())
92 bool Properties::existsPropertyVector(std::string
const&
name,
94 int const number_of_components)
const
96 auto const it = _properties.find(
name);
97 if (it == _properties.end())
103 if (property ==
nullptr)
107 if (property->getMeshItemType() != mesh_item_type)
111 if (property->getNumberOfGlobalComponents() != number_of_components)
118 template <
typename T>
120 std::string
const&
name)
const
122 auto it(_properties.find(
name));
123 if (it == _properties.end())
125 OGS_FATAL(
"The PropertyVector '{:s}' is not available in the mesh.",
131 "The PropertyVector '{:s}' has a different type than the requested "
138 template <
typename T>
141 auto it(_properties.find(
name));
142 if (it == _properties.end())
145 "A PropertyVector with the specified name '{:s}' is not available.",
151 "The PropertyVector '{:s}' has a different type than the requested "
158 template <
typename T>
161 int const n_components)
const
163 auto const it = _properties.find(
name);
164 if (it == _properties.end())
167 "A PropertyVector with name '{:s}' does not exist in the mesh.",
172 if (property ==
nullptr)
175 "Could not cast the data type of the PropertyVector '{:s}' to "
176 "requested data type.",
179 if (property->getMeshItemType() != item_type)
182 "The PropertyVector '{:s}' has type '{:s}'. A '{:s}' field is "
186 if (property->getNumberOfGlobalComponents() != n_components)
189 "PropertyVector '{:s}' has {:d} components, {:d} components are "
191 name, property->getNumberOfGlobalComponents(), n_components);
196 template <
typename T>
199 int const n_components)
201 auto const it = _properties.find(
name);
202 if (it == _properties.end())
205 "A PropertyVector with name '{:s}' does not exist in the mesh.",
210 if (property ==
nullptr)
213 "Could not cast the data type of the PropertyVector '{:s}' to "
214 "requested data type.",
217 if (property->getMeshItemType() != item_type)
220 "The PropertyVector '{:s}' has type '{:s}'. A '{:s}' field is "
224 if (property->getNumberOfGlobalComponents() != n_components)
227 "PropertyVector '{:s}' has {:d} components, {:d} components are "
229 name, property->getNumberOfGlobalComponents(), n_components);
void ERR(char const *fmt, Args const &... args)
const char * toString(mgis::behaviour::Behaviour::Kinematic kin)
Converts MGIS kinematic to a string representation.