22 if (!name.ends_with(
"_ip"))
25 "The name of integration point data must end with '_ip'. '{}' "
30 return name.substr(0, name.size() - 3);
33template <
typename LocalAssemblersVector>
35 std::vector<std::unique_ptr<MeshLib::IntegrationPointWriter>>
const&
36 _integration_point_writer,
38 LocalAssemblersVector& local_assemblers,
39 bool const remove_name_suffix =
false)
41 for (
auto const& ip_writer : _integration_point_writer)
44 auto const& name = ip_writer->name();
49 auto const& mesh_property =
50 *mesh_properties.template getPropertyVector<double>(name);
53 if (mesh_property.getMeshItemType() !=
59 auto const ip_meta_data =
60 getIntegrationPointMetaData(mesh_properties, name);
63 if (ip_meta_data.n_components !=
64 mesh_property.getNumberOfGlobalComponents())
67 "Different number of components in meta data ({:d}) than in "
68 "the integration point field data for '{:s}': {:d}.",
69 ip_meta_data.n_components, name,
70 mesh_property.getNumberOfGlobalComponents());
73 INFO(
"Setting initial integration point data for '{}'", name);
75 auto const& name_transformed =
80 std::size_t position = 0;
81 for (
auto& local_asm : local_assemblers)
83 std::size_t
const integration_points_read =
84 local_asm->setIPDataInitialConditions(
85 name_transformed, &mesh_property[position],
86 ip_meta_data.integration_order);
91 position += integration_points_read * ip_meta_data.n_components;
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition of the class Properties that implements a container of properties.
Property manager on mesh items. Class Properties manages scalar, vector or matrix properties....
bool existsPropertyVector(std::string_view name) const
void setIPDataInitialConditions(std::vector< std::unique_ptr< MeshLib::IntegrationPointWriter > > const &_integration_point_writer, MeshLib::Properties const &mesh_properties, LocalAssemblersVector &local_assemblers, bool const remove_name_suffix=false)
std::string removeIPFieldDataNameSuffix(std::string const &name)
Removes the suffix '_ip' from the passed field name.