pyInclude.geometry.msh

gmsh import helpers for planar triangle meshes.

class pyInclude.geometry.msh.GmshElement(element_id, element_type, node_ids, physical_tag=None)

Bases: object

One gmsh element with enough metadata to build topology and cladding.

Parameters:
  • element_id (int)

  • element_type (int)

  • node_ids (tuple[int, ...])

  • physical_tag (int | None)

element_id: int

gmsh element id.

element_type: int

gmsh element type; only triangle type 2 is imported as topology.

node_ids: tuple[int, ...]

Node ids used by this element.

physical_tag: int | None = None

Optional physical group tag used to infer cladding cells.

class pyInclude.geometry.msh.Gmsh(nodes, elements, physical_names=<factory>, source=None)

Bases: object

gmsh-backed mesh data accepted by MeshTopology.

HASEonGPU currently only accepts two-dimensional triangle meshes and later extrudes them through numberOfLevels with a fixed thickness. Physical surface names containing cladding can populate claddingCellTypes on a GainMedium.

Parameters:
  • nodes (dict[int, tuple[float, float, float]])

  • elements (list[GmshElement])

  • physical_names (dict[int, dict[int, str]])

  • source (str | None)

nodes: dict[int, tuple[float, float, float]]

Node id to (x, y, z) coordinate mapping.

elements: list[GmshElement]

All gmsh elements read from the file.

physical_names: dict[int, dict[int, str]]

Physical names grouped by gmsh dimension and tag.

source: str | None = None

Original gmsh filename, if loaded from disk.

classmethod fromFile(filename)

Read a gmsh .msh file using the gmsh Python package.

topology(*, numberOfLevels=None, thickness=None)

Convert planar triangle elements into an extruded MeshTopology.

claddingCellTypes(topology)

Return triangle-wise cladding tags inferred from physical names.