38 template <
typename PROPERTY_TYPE>
40 PROPERTY_TYPE
const property_value)
43 property_name, property_value, property_value,
false);
62 template <
typename PROPERTY_TYPE>
64 std::string
const& property_name,
65 PROPERTY_TYPE
const min_property_value,
66 PROPERTY_TYPE
const max_property_value,
72 pv =
_mesh.getProperties().getPropertyVector<PROPERTY_TYPE>(
75 catch (std::runtime_error
const& e)
77 ERR(
"{:s}", e.what());
79 "Value-based element removal currently only works for "
84 std::vector<std::size_t> matchedIDs;
90 if ((*pv)[i] < min_property_value ||
91 (*pv)[i] > max_property_value)
93 matchedIDs.push_back(i);
101 if ((*pv)[i] >= min_property_value &&
102 (*pv)[i] <= max_property_value)
104 matchedIDs.push_back(i);
109 return matchedIDs.size();
116 std::size_t
searchByContent(
double eps = std::numeric_limits<double>::epsilon());
122 bool const invert =
false);
129 void updateUnion(
const std::vector<std::size_t> &vec);
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
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.
constexpr std::size_t getNumberOfTuples() const
MeshElemType
Types of mesh elements supported by OpenGeoSys. Values are from VTKCellType enum.