Skip to content

mesh

Mesh transfer from the shared native-2D pipeline to DEVSIM.

The BoundaryMode pipeline writes the cross-section mesh in um (msh v2.2). DEVSIM's silicon physics parameters are cm-based, so the same mesh is rewritten with coordinates scaled to cm before create_gmsh_mesh loads it. Physical groups (region and contact names) are preserved verbatim — this is a unit conversion, not a second meshing path.

Functions:

  • line_group_points –

    Node coordinates of a named dim-1 physical group of a gmsh mesh.

  • write_scaled_msh –

    Write a copy of a gmsh v2.2 mesh with scaled node coordinates.

line_group_points

line_group_points(path: str | Path, group: str) -> NDArray[float64]

Node coordinates of a named dim-1 physical group of a gmsh mesh.

Parameters:

  • path (str | Path) –

    Mesh path (msh v2.2).

  • group (str) –

    Physical-group name of a set of curves.

Returns:

  • NDArray[float64] –

    The (n, 2) in-plane coordinates of the group's distinct nodes,

  • NDArray[float64] –

    in the mesh's own unit.

Raises:

  • ValueError –

    When the mesh holds no line group of that name, or no line cells at all.

write_scaled_msh

write_scaled_msh(src: str | Path, dst: str | Path, *, scale: float = UM_TO_CM) -> Path

Write a copy of a gmsh v2.2 mesh with scaled node coordinates.

Parameters:

  • src (str | Path) –

    Source mesh path (msh v2.2, coordinates in um).

  • dst (str | Path) –

    Destination mesh path.

  • scale (float, default: UM_TO_CM ) –

    Multiplicative coordinate scale (default um -> cm).

Returns:

  • Path –

    The destination path.