editMaterialID is a tool to edit the material ID of mesh elements in three different ways. It is possible to:
USAGE:
editMaterialID {-r|-c|-s} [-e <point|line|quad|hex|tri|tet|pris|pyra>]
[-n <number>][-m <number>] ... -o <file name> -i <file name [--] [--version] [-h]
Where:
-r, --replace
(OR required) replace material IDs
-- OR --
-c, --condense
(OR required) condense material IDs
-- OR --
-s, --specify
(OR required) specify material IDs by element types (-e)
-e <point|line|quad|hex|tri|tet|pris|pyra>, --element-type <point|line
|quad|hex|tri|tet|pris|pyra>
element type
-n <number>, --new-material-id <number>
new material id
-m <number>, --current-material-id <number> (accepted multiple times)
current material id to be replaced
-o <file name>, --mesh-output-file <file name>
(required) the name of the file the mesh will be written to
-i <file name>, --mesh-input-file <file name>
(required) the name of the file containing the input mesh
--, --ignore_rest
Ignores the rest of the labeled arguments following this flag.
--version
Displays version information and exits.
-h, --help
Displays usage information and exits.
editMaterialID -i mesh_layered.vtu -o mesh_newID.vtu -r -m 4 -n 24
output:
[2023-02-23 16:19:09.663] [ogs] [info] Mesh read: 2915 nodes, 4609 elements.
[2023-02-23 16:19:09.664] [ogs] [info] Replacing material ID...
[2023-02-23 16:19:09.664] [ogs] [info] The MaterialIDs of the input file: [0, 1, 2, 3, 4, 5, 6]
[2023-02-23 16:19:09.664] [ogs] [info] 4 -> 24
[2023-02-23 16:19:09.664] [ogs] [info] The MaterialIDs of the output file: [0, 1, 2, 3, 5, 6, 24]
editMaterialID -i mesh_newID.vtu -o mesh_newID_c.vtu -c
output:
[2023-02-23 16:20:21.688] [ogs] [info] Mesh read: 2915 nodes, 4609 elements.
[2023-02-23 16:20:21.688] [ogs] [info] Condensing material ID...
[2023-02-23 16:20:21.688] [ogs] [info] The MaterialIDs of the input file: [0, 4, 5, 6, 14, 42, 53]
[2023-02-23 16:20:21.688] [ogs] [info] The MaterialIDs of the output file: [0, 1, 2, 3, 4, 5, 6]
Fig.1 The upper image shows a mesh with material IDs [0,4,5,6,14,42,53]. The lower one the same mesh with material IDs [0,1,2,3,4,5,6] after applying --condense.
editMaterialID -i mesh_newID.vtu -o mesh_specified.vtu -s -e tet -n 66
output:
[2023-02-23 16:21:44.629] [ogs] [info] Mesh read: 2915 nodes, 4609 elements.
[2023-02-23 16:21:44.629] [ogs] [info] Specifying material ID...
[2023-02-23 16:21:44.629] [ogs] [info] The MaterialIDs of the input file: [0, 4, 5, 6, 14, 42, 53]
[2023-02-23 16:21:44.629] [ogs] [info] updated 88 elements
[2023-02-23 16:21:44.630] [ogs] [info] The MaterialIDs of the output file: [0, 4, 5, 6, 14, 42, 53, 66]
No material ID was lost as no MaterialID referred only to tetrahedra before. That is why only a new MaterialID is gained by this process.
This article was written by Julian Heinze. If you are missing something or you find an error please let us know.
Generated with Hugo 0.122.0
in CI job 504124
|
Last revision: November 12, 2024
Commit: [BL/MPI] Use MPI_COMM_WORLD in reduceMin 4aae83e
| Edit this page on