Convert mesh files between formats supported by MOAB, optionally extracting subsets of the input.
mbconvert uses the MOAB library to translate between mesh file formats or to extract subsets of a mesh file. The output file type is determined from the file extension when -f is not given. Use -l to list supported file formats.
id_list arguments accept individual IDs or ranges separated by commas (e.g. 1,5,10-15,20). Lists may not contain spaces.
Any combination of subset options can be specified (repeating a flag with a different id-list is allowed); the output contains the union. With no subset options the entire input mesh is written.
Writer- and reader-specific option strings for the -o and -O flags are documented in ../README.IO.
| Flag | Description |
|---|---|
-h | Print help to stdout and exit. |
-l | List supported file formats and exit. |
-f <format> | Specify the output file format explicitly. |
-t | Print read/write timing data. |
-g | Enable verbose / debug output. |
-I <dim> | Generate internal / adjacent entities of dimension <dim> (1 or 2). |
-- | Treat all subsequent arguments as file names (lets file names begin with -). |
| Flag | Description |
|---|---|
-a <sat_file> | ACIS SAT file dumped by the .cub reader. Equivalent to -O SAT_FILE=<sat_file>. |
-A | Tell the .cub reader to not dump a SAT file (deprecated; current default). |
| Flag | Description |
|---|---|
-o <option> | Pass a writer option. Repeat for multiple options. |
-O <option> | Pass a reader option. Repeat for multiple options. |
Note: lowercase
-ois for writes; uppercase-Ois for reads. (The oldermbconvert.manpage had these descriptions swapped; this doc and the in-binary help have it right.)
The most commonly used writer options:
WRITE_FORMAT={SCRIP|ESMF|DOMAIN} — Force NetCDF output into a specific grid layout, regardless of the source mesh's __MESH_TYPE tag. See Cross-format NetCDF conversion below.PARALLEL=WRITE_PART — Set automatically by -M; rarely needed by hand.| Flag | Description |
|---|---|
-P | Append .<rank> to the output file name (per-rank files). |
-p | Replace every % in input and output file names with the world-comm rank. |
-M[0\|1\|2] | Read/write in parallel; optional value selects resolve_shared_ents (1) or exchange_ghosts (2) on top. |
-z <file> | Read Metis partition info for an MPAS grid file and emit an .h5m partition. |
| Flag | Description |
|---|---|
-B | Use the TempestRemap Exodus reader, then convert to MOAB. |
-b | Convert a MOAB mesh and write via the TempestRemap Exodus writer. |
-S | Scale a climate mesh to the unit sphere. |
-i <tag> | Name of the global-DoF tag to use with mbtempest. |
-r <order> | Order of the field DoF (FV=1, SE=[1..N]). |
Each of the following flags is followed by an ID list (commas, hyphens for ranges; no spaces):
| Flag | Selects |
|---|---|
-v | Geometric volumes |
-s | Geometric surfaces |
-c | Geometric curves |
-V | Geometric vertices |
-m | Material sets (blocks) |
-d | Dirichlet sets (nodesets) |
-n | Neumann sets (sidesets) |
-D | Parallel partitioning sets (PARALLEL_PARTITION) |
| Flag | Description |
|---|---|
-1 | Edges |
-2 | Triangles, quads, polygons |
-3 | Tets, hexes, prisms, etc. (Vertices are always exported.) |
The new WRITE_FORMAT option lets you re-emit the mesh in a different NetCDF grid layout. Source can be any reader-supported format — NetCDF (MPAS/HOMME/CAM/SCRIP/ESMF/Domain), HDF5 (.h5m), Exodus (.exo), VTK, etc.
WRITE_FORMAT overrides the source mesh's stored __MESH_TYPE tag, so the same input can be emitted in any of the three grid layouts above.
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Usage error (bad flag or missing argument) |
| 2 | Read error (file open / parse failed) |
| 3 | Write error (writer rejected the file or set) |
| 4 | Other error (e.g. internal MOAB failure) |
| 5 | Entity / set not found for a subset filter |
README.IO — full list of writer- and reader-specific optionsmbconvert.man — man page version of this documentation