fem.tetmesh.TetMesh

fem.tetmesh.TetMesh(
    points,
    cells,
    num_surface,
    boundary_tris,
    base_points,
    max_step,
    grid=None,
    edge_parents=None,
    refinement=None,
    table=None,
    incidence=None,
)

A TET4/TET10 volume mesh whose boundary vertices are DC surface vertices.

Duck-compatible with :class:~cadjoint.studies.selection.NodeSelection resolution (num_points / points / all_boundary_faces / grid), so Nodes selections resolve on tet meshes unchanged (selections resolve to the corner boundary nodes; TET10 midside completion happens at BC assembly via :func:~cadjoint.fem.boundary.tet10_complete_nodes).

Attributes

Name Type Description
points np.ndarray Vertex positions, (N, 3) float64. The first num_surface rows are the DC surface vertices verbatim, followed by interior Steiner vertices; a TET10 mesh appends the shared midside nodes after all corner vertices.
cells np.ndarray Connectivity (meshio tetra/tetra10 order, positive volumes), (T, 4) or (T, 10) int32.
num_surface int Number of leading DC surface (corner) vertices.
boundary_tris np.ndarray Outward-oriented boundary corner triangles (faces used by exactly one tet), (M, 3) int64.
base_points np.ndarray Frozen nominal positions, (N, 3) — the anchor for :func:~cadjoint.fem.motion.recompute_tet_points (for TET10, midside rows are the midpoints of the corner base positions).
max_step float Newton re-projection displacement clamp.
grid GridSpec | None The DC sampling grid the surface came from (None when built from a raw surface).
edge_parents np.ndarray | None None for TET4. For TET10 the (E, 2) corner index pairs whose midpoints the appended midside nodes are (row k describes node num_corner_points + k; rows are sorted pairs in lexicographic order).
refinement dict[str, Any] | None What the automatic refinement ladder of :func:sdf_to_tet_mesh had to do to produce this mesh, or None when the mesh did not come through it (a raw surface, or a chain/tesseract fill). See :func:sdf_to_tet_mesh for the record’s shape.

Methods

Name Description
all_boundary_faces Boundary triangles as a :class:FaceGroup (nodes shaped (M, 3)).
elastic Linear elasticity on the direct jax-fem path, the only one that takes tets.
face_patch (nodes, faces): the spanning node set (midsides too on TET10) and the corner triangles.
moved Node positions under field: surface vertices re-projected, the interior following.
node_patch Corner boundary nodes, completed on TET10 with the midsides both of whose parents are in.
thermal Steady conduction on the direct jax-fem path, the only one that takes tets.

all_boundary_faces

fem.tetmesh.TetMesh.all_boundary_faces()

Boundary triangles as a :class:FaceGroup (nodes shaped (M, 3)).

elastic

fem.tetmesh.TetMesh.elastic(problem, *, placement=None, backend=None)

Linear elasticity on the direct jax-fem path, the only one that takes tets.

face_patch

fem.tetmesh.TetMesh.face_patch(selection)

(nodes, faces): the spanning node set (midsides too on TET10) and the corner triangles.

jax-fem selects a face for a surface map only when all its nodes are in the set, which is why the midsides come along.

moved

fem.tetmesh.TetMesh.moved(field, *, smooth_passes=0, design=None)

Node positions under field: surface vertices re-projected, the interior following.

A Gmsh mesh’s nodes come from the node_map plugin kind instead, which needs the design itself (design=(target, params)); the refusal for an unfilled kind is at declaration, in the optimiser.

node_patch

fem.tetmesh.TetMesh.node_patch(selection)

Corner boundary nodes, completed on TET10 with the midsides both of whose parents are in.

thermal

fem.tetmesh.TetMesh.thermal(problem, *, placement=None, backend=None)

Steady conduction on the direct jax-fem path, the only one that takes tets.