GEOSX Mesh Tools

The geosx_mesh_tools python package includes tools for converting meshes from common formats (abaqus, etc.) to those that can be read by GEOSX (gmsh, vtk). See Python Tools Setup for details on setup instructions, and Using an External Mesh for a detailed description of how to use external meshes in GEOSX. The available console scripts for this package and its API are described below.

convert_abaqus

Compile an xml file with advanced features into a single file that can be read by GEOSX.

usage: convert_abaqus [-h] [-v] input output

Positional Arguments

input Input abaqus mesh file name
output Output gmsh/vtu mesh file name

Named Arguments

-v, --verbose

Increase verbosity level

Default: False

Note

For vtk format meshes, the user also needs to determine the region ID numbers and names of nodesets to import into GEOSX. The following shows how these could look in an input XML file for a mesh with three regions (REGIONA, REGIONB, and REGIONC) and six nodesets (xneg, xpos, yneg, ypos, zneg, and zpos):

<Problem>
  <Mesh>
    <VTKMesh
      name="external_mesh"
      file="mesh.vtu"
      regionAttribute="REGIONA-REGIONB-REGIONC"
      nodesetNames="{ xneg, xpos, yneg, ypos, zneg, zpos }"/>
  </Mesh>

  <ElementRegions>
    <CellElementRegion
      name="ALL"
      cellBlocks="{ 0_tetrahedra, 1_tetrahedra, 2_tetrahedra }"
      materialList="{ water, porousRock }"
      meshBody="external_mesh"/>
  </ElementRegions>
</Problem>

API

geosx_mesh_tools.abaqus_converter.convert_abaqus_to_gmsh(input_mesh: str, output_mesh: str, logger: logging.Logger = None) → int

Convert an abaqus mesh to gmsh 2 format, preserving nodeset information.

If the code encounters any issues with region/element indices, the conversion will attempt to continue, with errors indicated by -1 values in the output file.

Parameters:
  • input_mesh (str) – path of the input abaqus file
  • output_mesh (str) – path of the output gmsh file
  • logger (logging.Logger) – an instance of logging.Logger
Returns:

Number of potential warnings encountered during conversion

Return type:

int

geosx_mesh_tools.abaqus_converter.convert_abaqus_to_vtu(input_mesh: str, output_mesh: str, logger: logging.Logger = None) → int

Convert an abaqus mesh to vtu format, preserving nodeset information.

If the code encounters any issues with region/element indices, the conversion will attempt to continue, with errors indicated by -1 values in the output file.

Parameters:
  • input_mesh (str) – path of the input abaqus file
  • output_mesh (str) – path of the output vtu file
  • logger (logging.Logger) – a logger instance
Returns:

Number of potential warnings encountered during conversion

Return type:

int