- fileThe filename to read.
C++ Type:MeshFileName
Unit:(no unit assumed)
Controllable:No
Description:The filename to read.
FileMeshGenerator
Read a mesh from a file.
Supported File Formats
The FileMeshGenerator
is the default type for MOOSE and as the name suggests it reads the mesh from an external file. MOOSE supports reading and writing a large number of formats and could be extended to read more.
Reading with the FileMeshGenerator
. These capabilities are inherited from the libMesh file IO readers.
Extension | Description |
---|---|
.e, .exd | Sandia's ExodusII format |
.bxt | DynaIO |
.cpr | Checkpoint file |
.fro | ACDL's surface triangulation file |
.mat | Matlab triangular ASCII file |
.msh | GMSH ASCII file |
.n, .nem | Sandia's Nemesis format |
.node, .ele; .poly | TetGen ASCII file |
.inp | Abaqus .inp format |
.off | OFF |
.ucd | AVS's ASCII UCD format |
.unv | I-deas Universal format |
.xda, .xdr | libMesh formats |
.vtk, .pvtu | Visualization Toolkit |
Writing (using the Outputs block). We list these formats here for convenience if you are considering using MOOSE as a mesh file converter.
Extension | Description | Output type |
---|---|---|
.e, .exd | Sandia's ExodusII format | Exodus |
.cpr | Checkpoint file | Checkpoint |
.dat | Tecplot ASCII file | Tecplot |
.gmv | LANL's GMV (General Mesh Viewer) format | GMV |
.n, .nem | Sandia's Nemesis format | Nemesis |
.plt | Tecplot binary file | Tecplot |
.xda, .xdr | libMesh formats | XDA/XDR |
.vtk, .pvtu | Visualization Toolkit | VTK |
These formats (for writing meshes) are supported by libMesh and could easily be added to MOOSE if needed:
Extension | Description |
---|---|
.fro | ACDL's surface triangulation file |
.mesh, .meshb | Medit |
.msh | GMSH ASCII file |
.node, .ele; .poly | TetGen ASCII file |
.ucd | AVS's ASCII UCD format |
Unsupported File Formats
These file formats are unsupported, however, using other tools they can be converted to supported formats. In general, the mesh must respect the limitations of the target format for a successful conversion.
Tools offering conversion capabilities:
The conversion capabilities to be able to read those files are summarized here for convenience:
Extension | Description | Conversion tool | Target format |
---|---|---|---|
.msh | ANSYS msh | meshio | Exodus |
.avs | AVS-UCD | meshio | Exodus |
.cgns | CGNS | meshio/Paraview | Exodus |
.xml | DOLFIN xml | meshio | Exodus |
.case | EnSight | Paraview | Exodus |
.f3grid | FLAC3D | meshio | Exodus |
.grdecl | Eclipse | em2ex | Exodus |
.csv | Leapfrog Geothermal | em2ex | Exodus |
.h5m | H5M | meshio | Exodus |
.mdpa | Kratos/MDPA | meshio | Exodus |
.mesh, .meshb | Medit | meshio | Exodus |
.med | MED/Salome | meshio | Exodus |
.bdf/.fem/.nas | Nastran | meshio | Exodus |
.vol | Netgen | meshio | Exodus |
Neuroglancer | meshio | Exodus | |
.obj | OBJ | meshio | Exodus |
.post, .dato | PERMAS | meshio | Exodus |
.ply | PLY | meshio | Exodus |
.stl | STL | meshio | Exodus |
.svg | SVG | meshio | Exodus |
.su2 | SU2 | meshio | Exodus |
.ugrid | UGRID | meshio | Exodus |
.tin | WKT TIN | meshio | Exodus |
.xdmf, .xmf | XDMF | meshio | Exodus |
Extra element integer
When reading a mesh file in Sandia's ExodusII format, users can use parameter exodus_extra_element_integers
to load elemental variables for setting extra element integers of the mesh. The names of the extra element integers will be the same as the names of the element variables in the mesh file.
Exodus restart
This generator can also be used for restarting variables from the Exodus file format. In order to indicate that the mesh file can be used to restart variables, simply set the parameter use_for_exodus_restart = true
. The initial_from_file_var
parameter must also be set in the variables sub-block as described in Restart in order to perform variable restart.
Additional documentation about restarting from Exodus may be found in the restart-recovery page.
Loading a split mesh
Mesh splits usually do not require a FileMeshGenerator
, they can be performed and loaded from the command line. The only use case for loading a split mesh using a FileMeshGenerator
is to perform additional mesh generation on the split. For example, a 2D split mesh can be pre-split before extrusion to avoid ever having to load the full 3D mesh in serial.
To load a split mesh using the FileMeshGenerator
, split your mesh as usual using the command line:
- mpirun -n 4 <executable> -i <input_file> --split-mesh 16 --split-file mesh_splitted
then load it with the FileMeshGenerator
input parameter by using distributed meshes with the command line option:
- mpirun -n 4 <executable> -i <input_file> --distributed-mesh
Input file:
[fmg]
type = FileMeshGenerator
file = 'mesh_splitted.cpr'
[]
Input Parameters
- allow_renumberingTrueWhether to allow the mesh to renumber nodes and elements, if not overridden by a global parameter or by a requirement (e.g. an exodus restart or a constraint matrix) that disables renumbering.
Default:True
C++ Type:bool
Unit:(no unit assumed)
Controllable:No
Description:Whether to allow the mesh to renumber nodes and elements, if not overridden by a global parameter or by a requirement (e.g. an exodus restart or a constraint matrix) that disables renumbering.
- exodus_extra_element_integersThe variable names in the mesh file for loading extra element integers
C++ Type:std::vector<std::string>
Unit:(no unit assumed)
Controllable:No
Description:The variable names in the mesh file for loading extra element integers
- skip_partitioningFalseTrue to skip partitioning, only after this mesh generator, because the mesh was pre-split for example.
Default:False
C++ Type:bool
Unit:(no unit assumed)
Controllable:No
Description:True to skip partitioning, only after this mesh generator, because the mesh was pre-split for example.
- use_for_exodus_restartFalseTrue to indicate that the mesh file this generator is reading can be used for restarting variables
Default:False
C++ Type:bool
Unit:(no unit assumed)
Controllable:No
Description:True to indicate that the mesh file this generator is reading can be used for restarting variables
Optional Parameters
- clear_spline_nodesFalseIf clear_spline_nodes=true, IsoGeometric Analyis spline nodes and constraints are removed from an IGA mesh, after which only C^0 Rational-Bernstein-Bezier elements will remain.
Default:False
C++ Type:bool
Unit:(no unit assumed)
Controllable:No
Description:If clear_spline_nodes=true, IsoGeometric Analyis spline nodes and constraints are removed from an IGA mesh, after which only C^0 Rational-Bernstein-Bezier elements will remain.
- constraint_matrixThe name of a constraint matrix file to apply to the mesh
C++ Type:MatrixFileName
Unit:(no unit assumed)
Controllable:No
Description:The name of a constraint matrix file to apply to the mesh
- discontinuous_spline_extractionFalseIf discontinuous_spline_extraction=true, Rational-Bernstein-Bezier elements extracted from a spline mesh will be disconnected from neighboring elements, coupled only via their extraction operators. This may be less efficient than the default C^0 extracted mesh, but may be necessary if the extracted mesh is non-conforming.
Default:False
C++ Type:bool
Unit:(no unit assumed)
Controllable:No
Description:If discontinuous_spline_extraction=true, Rational-Bernstein-Bezier elements extracted from a spline mesh will be disconnected from neighboring elements, coupled only via their extraction operators. This may be less efficient than the default C^0 extracted mesh, but may be necessary if the extracted mesh is non-conforming.
Isogeometric Analysis (Iga) And Other Mesh Constraint Options Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Unit:(no unit assumed)
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Unit:(no unit assumed)
Controllable:No
Description:Set the enabled status of the MooseObject.
- save_with_nameKeep the mesh from this mesh generator in memory with the name specified
C++ Type:std::string
Unit:(no unit assumed)
Controllable:No
Description:Keep the mesh from this mesh generator in memory with the name specified
Advanced Parameters
- nemesisFalseWhether or not to output the mesh file in the nemesisformat (only if output = true)
Default:False
C++ Type:bool
Unit:(no unit assumed)
Controllable:No
Description:Whether or not to output the mesh file in the nemesisformat (only if output = true)
- outputFalseWhether or not to output the mesh file after generating the mesh
Default:False
C++ Type:bool
Unit:(no unit assumed)
Controllable:No
Description:Whether or not to output the mesh file after generating the mesh
- show_infoFalseWhether or not to show mesh info after generating the mesh (bounding box, element types, sidesets, nodesets, subdomains, etc)
Default:False
C++ Type:bool
Unit:(no unit assumed)
Controllable:No
Description:Whether or not to show mesh info after generating the mesh (bounding box, element types, sidesets, nodesets, subdomains, etc)