Set Properties in Polygonal Region


The tool ResetPropertiesInPolygonalRegion changes the property values of all elements of a mesh mesh in which at least one node of the element lies within the cylindrical volume defined through a given polygon polygon_name within the geometry geometry to a new value.

The new value must be of one of the data types, either integer {1, 2, 3, …} (new_int_value), character {‘a’, ‘b’, ‘c’, …} (new_character_value), or boolean {true,false} (new_boolean_value). The new value must fit the chosen property type of name_of_property.

The polygon must be located within a plane. A node is located in the cylindrical volume iff (i.e. if and only if) the node’s orthogonal projection to the plane of the polygon lies in the polygon, i.e. the plane can be defined in any arbitrary direction in 3d space.

In combination with a threshold filter the tool can also be used to cut out some region of the mesh. The tool can be also used in combination with the tool removeMeshElements.

The tool writes a new mesh modified_mesh.


    -m [mesh]
    -r [MaterialID]
    -n [name_of_property, default MaterialIDs]
    -i [new_int_value, optional]
    -c [new_character_value, optional]
    -b [new_boolean_value, optional]
    -g [geometry]
    -p [polygon_name]
    -o [modified_mesh.vtu]

By default all nodes of an element have to be inside the polygon to set the property on the element. By specifying the boolean switch any_of at the command line the criterion for element selection changes to ‘at least one node has to be inside the polygon’.


First Example

Input mesh
Shows the input mesh with the material ID 0 (red). Furthermore, the input polygon is sketched.

Shows the result. The material ids for the mesh cells have at least one node within the polygonal region changed to the value 1 and are colored now in blue.

Example usage:

    -m TestCube.vtu
    -n ValidCells
    -c B
    -g TestPolylines.gml
    -p Back
    -o TestCube-BackPolylinePropertyChange.vtu

Creates a new property “ValidCells” and sets the value for the property of elements in the polygonal region “Back” to “B”.

Second Example

Second example
The left figure shows the input mesh (transparent) with the original 10 layers symbolized by the different colours. At the bottom of the cube two regions are depicted by their bounding polygons. The intermediate mesh in the middle figure was generated by the following command:

    -m hex_5x5x5.vtu
    -g Regions.gml
    -p Region1
    -n MaterialIDs
    -i 11
    -r 2
    -o hex_5x5x5_Region1-Layer1.vtu

Here the elements with the material ID of 11 are displayed non-transparent.

The final mesh containing 12 material groups is represented in the right figure and was created by the command

    -m hex_5x5x5_Region1-Layer2.vtu
    -g Regions.gml
    -p Region2
    -n MaterialIDs
    -i 12
    -r 5
    -o hex_5x5x5_Region1-Layer2_Region2-Layer5.vtu

Again, the elements that are assigned to the new material group 12 are displayed non-transparent.

Download links for the files necessary to reproduce this example are at the end of this site.


This workflow was successful used in the INFLUINS project cutting out the Unstrut catchment from a 3d geological structure model:

Fischer, T. and Naumov, D. and Sattler, S. and Kolditz, O. and Walther, M. (2015): GO2OGS 1.0: a versatile workflow to integrate complex geological information with fault data into numerical simulation models. Geosci. Model Dev., vol. 8, p. 3681--3694, DOI:10.5194/gmd-8-3681-2015

This article was written by Thomas Fischer. If you are missing something or you find an error please let us know.
Generated with Hugo 0.117.0 in CI job 362666 | Last revision: July 12, 2023
Commit: [PL/SSD] Rename x_dot to x_prev 04a8fec8  | Edit this page on