Vtu2Grid
Introduction
This utility rasterizes an existing 3D mesh at a given resolution. The result is a (quasi-)structured grid (consisting of hexahedral elements) with the same extent as the input mesh. Cell properties are mapped onto the grid (sampled at centre-points of each cube), while node properties are ignored. For large raster sizes, an undersampling of the original mesh is possible.
Usage
Vtu2Grid -i <input.vtu> -o <output.vtu> -x <floating point number>
[-y <floating point number>] [-z <floating point number>]
Where:
-i <input.vtu>, --input <input.vtu>
(required) the 3D input mesh (*.vtu, *.msh)
-o <output.vtu>, --output <output.vtu>
(required) the output grid (*.vtu)
-x <floating point number>, --cellsize-x <floating point number>
(required) edge length of cubes in x-direction (longitude) or all
directions, if y and z are not set
-y <floating point number>, --cellsize-y <floating point number>
edge length of cubes in y-direction (latitude)
-z <floating point number>, --cellsize-z <floating point number>
edge length of cubes in z-direction (depth)The x/y/z-parameters determine the raster size. If only x is given, all raster cells will be (equilateral) cubes. If all three parameters are specified, the programme will create rectangular cuboid cells.
Simple example
Command:
Vtu2Grid -i input.vtu -o output.vtu -x 200
Command:
Vtu2Grid -i input.vtu -o output.vtu -x 100
Command:
Vtu2Grid -i input.vtu -o output.vtu -x 50
Command:
Vtu2Grid -i input.vtu -o output.vtu -x 50 -y 50 -z 10
Application
This utility can be used to convert complex unstructured 3D meshes with a numerically challenging geometry into simple, rasterized meshes. This will (significantly) increase the number of elements but prevents numerical issues during a subsequent simulation, thus exchanging a challenging model setup with a longer runtime. As such, the output mesh allows to quickly set-up a working model of region of interest to get first results that allow for informed decisions for a more realistic model using the unstructured input mesh.
This article was written by Karsten Rink. 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