18 std::string
const& property_name,
20 int const number_of_components)
22 if (property_name.empty())
25 "Trying to get or to create a mesh property with empty name.");
28 auto numberOfMeshItems = [&mesh, &item_type]() -> std::size_t
41 "getOrCreateMeshProperty cannot handle other "
42 "types than Node, Cell, or IntegrationPoint.");
49 DBUG(
"Reusing existing property vector '{}' on mesh '{}'.",
53 mesh.
getProperties().template getPropertyVector<T>(property_name);
55 if (
auto const mit = result->getMeshItemType(); mit != item_type)
58 "Found mesh item type '{}' for mesh property '{}' on mesh "
59 "'{}', but expected a '{}' property.",
63 if (
auto const ncomp = result->getNumberOfGlobalComponents();
64 ncomp != number_of_components)
67 "Found {} components for mesh property '{}' on mesh '{}', but "
68 "expected {} components.",
69 ncomp, property_name, mesh.
getName(), number_of_components);
75 auto const size = result->size();
76 auto const size_expected =
77 numberOfMeshItems() * number_of_components;
78 if (size != size_expected)
81 "Actual and expected size of property '{}' on mesh '{}' do "
82 "not match: {} != {}.",
83 property_name, mesh.
getName(), size, size_expected);
91 property_name, item_type, numberOfMeshItems(),
92 number_of_components);