API reference#

ogstools package#

ogstools.cli(check=False)[source]#

Allows access to ogs binary tools via python and performs checks to see if OGS is installed correctly.

Parameters:

check (bool) – If True, verify that OGS is available on PATH and warn if multiple versions are found.

Return type:

Any

Example cli().vtkdiff(“file1.vtu”, “file2.vtu”)

Returns:

A CLI object that supports ogs command line tools.

Return type:

Any

ogstools.status(verbose=False)[source]#
Checks if OGS is installed correctly. It prints detailed error message if OGS is not installed correctly.
param verbose:

If verbose is True it prints always the status of related environment variables. (OGS_BIN_PATH, PATH, virtual environment)

Returns:

True if OGS is installed correctly, False otherwise.

Return type:

bool

ogstools.meshes_from_gmsh(filename, dim=0, reindex=True, log=True, meshname='domain')[source]#

Deprecated since version 0.7.1.

Use Meshes. from_gmsh() instead. Generates pyvista unstructured grids from a gmsh mesh (.msh).

Extracts domain-, boundary- and physical group-submeshes.

Parameters:
  • filename (Path) – Gmsh mesh file (.msh) as input data

  • dim (int | list[int]) – Spatial dimension (1, 2 or 3), trying automatic detection, if not given. If multiple dimensions are provided, all elements of these dimensions are embedded in the resulting domain mesh.

  • reindex (bool) – Physical groups / regions / Material IDs to be renumbered consecutively beginning with zero.

  • log (bool) – If False, silence log messages

  • meshame – The name of the domain mesh.

Returns:

A dictionary of names and corresponding meshes

Return type:

dict[str, Mesh]

Subpackages#

Submodules#