mesh-generator v3.2.3¶
Mercurial revision 5803:7164e00e8f3d | 2026-08-18
Description¶
mesh-generator is a tool that generates a 2D mesh based on a given criteria file (.crt). It is designed to create high-quality meshes for oceanographic, coastal, or other geospatial applications.
Usage¶
mesh-generator [OPTIONS] criteria.crt
Options¶
General Options¶
Option |
Description |
|---|---|
|
Display help and exit. |
|
Generate density and limits but not the mesh. |
|
Root name for intermediate output files (default: |
|
Generate extra output files for debugging purposes. |
|
Check the sanity of mesh limits polygons. |
|
Skip the mesh reshaping step. |
|
Save mesh densities to |
Input/Output Options¶
Option |
Description |
|---|---|
|
Path to the bathymetry file. Can also be specified in the criteria file via |
|
Path to the mesh boundaries file (trigrid format). Disables |
|
Path to the genesis boundary descriptor. Disables |
|
Path to raw polygons for boundaries. |
|
Path to a mesh file to merge with the generated mesh. |
|
Path to the output mesh file (default: |
|
Path to the mesh density file. |
|
Path to a local mesh density prescription file. |
|
Path to a node file (used for triangulation). |
Mesh Generation Options¶
Option |
Description |
|---|---|
|
Resolution in kilometers. Used only when a node file is provided and no criteria file is given. |
|
Line definition mode between polygon vertices. |
|
Smoothing rate for mesh optimization. |
|
Enable polar grid mode. |
Examples¶
Basic Mesh Generation¶
Generate a mesh using a criteria file:
mesh-generator criteria.crt
Generate Mesh with Custom Output Name¶
Generate a mesh and specify a root name for output files:
mesh-generator --rootname my_mesh criteria.crt
Generate Mesh with Bathymetry¶
Generate a mesh using a custom bathymetry file:
mesh-generator -b bathymetry.nc criteria.crt
Generate Mesh with Boundaries¶
Generate a mesh using a boundaries file:
mesh-generator -f boundaries.trg criteria.crt
Generate Mesh with Raw Polygons¶
Generate a mesh using raw polygons for boundaries:
mesh-generator -p polygons.plg criteria.crt
Generate Mesh with Node File¶
Generate a mesh using a node file and a resolution:
mesh-generator -n nodes.txt -r 1000 criteria.crt
Generate Density and Limits Only¶
Generate density and limits without creating the mesh:
mesh-generator --limits-only criteria.crt
Merge with Existing Mesh¶
Generate a mesh and merge it with an existing mesh:
mesh-generator -m existing_mesh.nei criteria.crt
Debug Mode¶
Generate a mesh with extra debugging output:
mesh-generator --debug criteria.crt
Custom Line Mode¶
Generate a mesh with a specific line mode (e.g., ORTHODROMIC):
mesh-generator --line-mode ORTHODROMIC criteria.crt
Local Mesh Density Prescription¶
Generate a mesh with a local mesh density prescription:
mesh-generator -z local_density.txt criteria.crt
Check Mesh Limits¶
Check the sanity of mesh limits polygons:
mesh-generator --check-limits criteria.crt
Skip Mesh Reshaping¶
Generate a mesh without reshaping:
mesh-generator --no-reshape criteria.crt
Save Mesh Densities¶
Save mesh densities to a NetCDF file:
mesh-generator --show-map criteria.crt
Environment Variables¶
mesh-generator uses OpenMP for parallelization. Key environment variables:
Variable |
Description |
|---|---|
|
Number of threads to use. |
|
Runtime schedule type and chunk size. |
|
Enable/disable dynamic thread adjustment. |
|
Enable/disable nested parallelism. |
Example:
OMP_NUM_THREADS=4 mesh-generator criteria.crt
Notes¶
Criteria File:
The criteria file (
.crt) defines the mesh resolution, bathymetry, and other parameters.If no criteria file is provided, a node file and resolution (
-r) must be specified.
Boundary Files:
Use
-ffor mesh boundaries files (trigrid format).Use
-dfor genesis boundary descriptors.Use
-pfor raw polygons.Priority:
-f>-d>-p.
Bathymetry:
Can be specified via
-bor in the criteria file usingTOPOGRAPHY_FILE.
Output:
The default output mesh file is
<rootname>-mesh.nei.Use
-oto specify a custom output path.
Mesh Merging:
Use
-mto merge the generated mesh with an existing mesh.
Debugging:
Use
--debugto generate additional output files for troubleshooting.
Line Modes:
ORTHODROMIC: Great-circle lines (default).LOXODROMIC: Rhumb lines.CARTESIAN: Straight lines in a projected coordinate system.
Polar Grids:
Use
--polarfor polar grid generation.
See Also¶
OpenMP Documentation (for parallelization options)
NetCDF Format (for input/output files)