28 template <
typename PT>
31 std::string
const& property_name,
32 PT new_property_value,
33 int restrict_to_material_id,
36 auto*
const pv = MeshLib::getOrCreateMeshProperty<PT>(
41 ERR(
"Values of the PropertyVector are not assigned to cells.");
47 auto is_node_outside = [&outside](
auto const* node_ptr)
48 {
return outside[node_ptr->getID()]; };
50 auto const* material_ids =
53 if (restrict_to_material_id != -1 && !material_ids)
56 "Restriction of resetting a property in a polygonal region "
57 "requires that a MaterialIDs data array is available in the "
61 auto has_element_required_material_id = [&](
int const element_id)
63 return restrict_to_material_id == -1 ||
64 (*material_ids)[element_id] == restrict_to_material_id;
69 decltype(is_node_outside))>;
70 auto is_element_outside =
72 decltype(is_node_outside)>)
74 decltype(is_node_outside)>);
76 for (std::size_t j(0); j < mesh.
getElements().size(); ++j)
79 if (is_element_outside(elem->
getNodes(),
85 if (has_element_required_material_id(elem->
getID()))
87 (*pv)[j] = new_property_value;
Definition of the Element class.
Definition of the GEOObjects class.
void ERR(char const *fmt, Args const &... args)
Definition of the Mesh class.
Definition of the Node class.
Definition of the Polygon class.
virtual Node *const * getNodes() const =0
Get array of element nodes.
virtual unsigned getNumberOfNodes() const =0
virtual std::size_t getID() const final
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 const &name) const
Definition of readMeshFromFile function.