45 template <
typename PROPERTY_TYPE>
47 PROPERTY_TYPE
const property_value)
50 property_name, property_value, property_value,
false);
69 template <
typename PROPERTY_TYPE>
71 std::string
const& property_name,
72 PROPERTY_TYPE
const min_property_value,
73 PROPERTY_TYPE
const max_property_value,
82 catch (std::runtime_error
const& e)
84 ERR(
"{:s}", e.what());
86 "Value-based element removal currently only works for "
91 std::vector<std::size_t> matchedIDs;
97 if ((*pv)[i] < min_property_value ||
98 (*pv)[i] > max_property_value)
100 matchedIDs.push_back(i);
108 if ((*pv)[i] >= min_property_value &&
109 (*pv)[i] <= max_property_value)
111 matchedIDs.push_back(i);
116 return matchedIDs.size();
123 std::size_t
searchByContent(
double eps = std::numeric_limits<double>::epsilon());
129 bool const invert =
false);
136 void updateUnion(
const std::vector<std::size_t> &vec);
Definition of the AABB class.
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Definition of mesh-related Enumerations.
Definition of the Mesh class.
Class AABB is an axis aligned bounding box around a given set of geometric points of (template) type ...
void updateUnion(const std::vector< std::size_t > &vec)
Updates the vector of marked elements with values from vec.
std::size_t searchByBoundingBox(GeoLib::AABB const &aabb, bool const invert=false)
const std::vector< std::size_t > & getSearchedElementIDs() const
return marked elements
std::size_t searchByElementType(MeshElemType eleType)
Marks all elements of the given element type.
std::size_t searchByNodeIDs(const std::vector< std::size_t > &nodes)
Marks all elements connecting to any of the given nodes.
std::size_t searchByPropertyValueRange(std::string const &property_name, PROPERTY_TYPE const min_property_value, PROPERTY_TYPE const max_property_value, bool outside_of)
std::size_t searchByContent(double eps=std::numeric_limits< double >::epsilon())
Marks all elements with a volume smaller than eps.
ElementSearch(const MeshLib::Mesh &mesh)
std::size_t searchByPropertyValue(std::string const &property_name, PROPERTY_TYPE const property_value)
const MeshLib::Mesh & _mesh
The mesh from which elements should be removed.
std::vector< std::size_t > _marked_elements
The vector of element indices that should be removed.
Properties & getProperties()
PropertyVector< T > const * getPropertyVector(std::string_view name) const
std::size_t getNumberOfTuples() const
MeshElemType
Types of mesh elements supported by OpenGeoSys. Values are from VTKCellType enum.