fem.gmsh.gmsh_topology

fem.gmsh.gmsh_topology(
    geometry,
    *,
    geometry_format='step',
    target_size,
    order=2,
    algorithm=HXT,
    optimize=True,
    classify_angle=CLASSIFY_ANGLE,
    verbose=False,
)

Mesh a solid with Gmsh — the whole of the opaque part, and no more.

Nothing here knows about patches. What comes back is what Gmsh alone can say: node positions, cells, and which entity owns each node, expressed as the surface tags whose closure the node lies on (:func:assign_ownership is what turns those into patches). Keeping the cut here is what lets the mesher live behind a Tesseract — a container can be handed a file and cannot be handed a scene, whose patch fields are live Python callables.

Parameters

Name Type Description Default
geometry str The file’s contents (ASCII): a STEP solid, or the dual-contour surface as STL (:func:surface_stl). required
geometry_format str "step" or "stl". 'step'
target_size float Uniform element size in the file’s own units. required
order int 1 for TET4, 2 for TET10. 2
algorithm int Gmsh’s Mesh.Algorithm3D; :data:HXT by default. HXT
optimize bool Run Gmsh’s tet optimizer after generation. True
classify_angle float STL only — see :data:CLASSIFY_ANGLE. CLASSIFY_ANGLE
verbose bool Let Gmsh write to the terminal. False

Returns

Name Type Description
dict[str, Any] points (n, 3), cells (t, 4\|10) in meshio order, entity_dim (n,), bounding_surfaces (n, k) of surface tags (-1 padded), num_surface, num_corner_points, edge_parents (None at order 1), bounds (2, 3), cad_entities, and the timings.

Raises

Name Type Description
ImportError If the gmsh extra is not installed.
RuntimeError If the geometry carries no solid, or Gmsh makes no tets.
ValueError If order is not 1 or 2, or the format is unknown.