gmshrunner.py

class GmshRunner(gmsh_path=None)[source]

Bases: SimRunner

Used to call gmsh to create a mesh file to be used to run a finite element simulation. Implements the SimRunner abstract interface so that it can be used by the herd workflow manager.

__init__(gmsh_path=None)[source]

Initialiser for the GmshRunner.

Parameters:

gmsh_path (Path | None, optional) – Path to the gmsh executable, by default None

set_gmsh_app(gmsh_app)[source]

Sets path to the gmsh app.

Parameters:

gmsh_app (Path) – full path to the gmsh app.

Raises:

FileNotFoundError – gmsh app does not exist at the specified path.

get_input_file()[source]

get_input_path: the path to the input file to run gmsh with.

Returns:

Path | None – path to the gmsh *.geo file.

set_input_file(input_path)[source]

Sets the input geo file for gmsh.

Parameters:

input_file (Path) – Full path to the gmsh *.geo input file.

Raises:
  • FileNotFoundError – Not a .geo file

  • FileNotFoundError – Geo file does not exist

run(input_file=None, parse_only=True)[source]

Run the geo file to create the mesh.

Parameters:
  • input_file (Path | None) – Path to the .geo file containing the input. Can also be preset using set_input_file. Defaults to “” and ises the input file specified using set_input_file.

  • parse_only (bool :) – (Default value = True)

Raises:
  • RuntimeError – the path to the gmsh app is empty and must be specified first.

  • RuntimeError – the input file string is empty and must be specified first.

get_output_path()[source]

get_output_path: default return None for gmsh as there is no output to be read after the simulation has run. This information is stored in the exodus.

Returns:

Path | None – Default returns None.