Remove Mesh Elements
General
The tool removeMeshElements removes those elements from a given input mesh that fulfills a user specified criterion. The resulting mesh will be written to the specified output file. The user can choose between 4 different removal criteria:
- Remove elements based on assigned properties, for instance material ids. Elements with properties outside of the given range are removed.
- Remove elements by element type, for instance remove line elements.
- Remove elements that have zero volume.
- Remove elements based on an axis aligned bounding box. Elements where at least one point is located outside the specified bounding box (or - if the “invert”-flag is set - inside the bounding box) are removed.
One possible application is to cut out a smaller mesh out of a bigger one either by specifying a bounding box or by marking the inner/outer region with a unique MaterialID using the tool SetPropertiesInPolygonalRegion .
Another application is to cut out patches of a (top) surface (tool ExtractSurface ) for assigning boundary conditions.
Usage
removeMeshElements -i <input-mesh> -o <output-mesh>
[-n <property_name>] [--int-property-value <number value>] ...
[--element-type <element type>] ...
[--zero-volume] ...
[--x-min <value>] [--x-max <value>] [--y-min <value>] [--y-max <value>] [--z-min <value>] [--z-max <value>] [--invert]Each particular line with optional arguments refers to one of the different removal criteria mentioned in the general section.
The corresponding element types differ from VTK cell types and can be found in MeshLib/MeshEnums.cpp.
Examples
removeMeshElements -i TestCube-ResetPropertiesInPolygonalRegion.vtu -o TestCube-removeMeshElements.vtu -n MaterialIDs --int-property-value 1 --int-property-value 2 --int-property-value 3Applications
The tool was used to cut the Unstrut catchment out of the Thuringian syncline model and to remove some geological units not necessary for the modeling within the INFLUINS project, see reference [GO2OGS].
This article was written by Thomas Fischer. If you are missing something or you find an error please reach out
to us on our forum.
Generated with Hugo 0.164.0
in CI job 825193
|
Last revision: April 20, 2026
Commit: refactor(MeshLib): remove PropertyVector::push_back 870422dde
| Edit this page on