32 std::string
const& property_name,
33 PT new_property_value,
34 int restrict_to_material_id,
42 ERR(
"Values of the PropertyVector are not assigned to cells.");
48 auto is_node_outside = [&outside](
auto const* node_ptr)
49 {
return outside[node_ptr->getID()]; };
51 auto const* material_ids =
54 if (restrict_to_material_id != -1 && !material_ids)
57 "Restriction of resetting a property in a polygonal region "
58 "requires that a MaterialIDs data array is available in the "
62 auto has_element_required_material_id = [&](
int const element_id)
64 return restrict_to_material_id == -1 ||
65 (*material_ids)[element_id] == restrict_to_material_id;
70 decltype(is_node_outside))>;
71 auto is_element_outside =
73 decltype(is_node_outside)>)
75 decltype(is_node_outside)>);
77 for (std::size_t j(0); j < mesh.
getElements().size(); ++j)
80 if (is_element_outside(elem->
getNodes(),
86 if (has_element_required_material_id(elem->
getID()))
88 (*pv)[j] = new_property_value;
Definition of the Element class.
Definition of the GEOObjects class.
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition of the Mesh class.
Definition of the Node class.
Definition of the Polygon class.
virtual unsigned getNumberOfNodes() const =0
virtual Node *const * getNodes() const =0
Get array of element nodes.
std::size_t getID() const
Returns the ID of the element.
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
Properties & getProperties()
PropertyVector< T > const * getPropertyVector(std::string_view name) const
PropertyVector< T > * getOrCreateMeshProperty(Mesh &mesh, std::string const &property_name, MeshItemType const item_type, int const number_of_components)
Definition of readMeshFromFile function.