fem.recompute_points

fem.recompute_points(sdf, mesh)

Recompute hex-mesh vertex positions differentiably with frozen topology.

Interior lattice vertices stay at their frozen positions; the vertices recorded in mesh.snap_mask are re-projected onto the (possibly traced) SDF’s zero set with the same clamp used at extraction. Because connectivity, the snapped-vertex set, and the base lattice are all frozen, the output is a differentiable function of the SDF’s parameters — the mesh half of the design -> mesh -> FEM gradient chain.

Parameters

Name Type Description Default
sdf Callable[[Any], Any] Signed distance field, possibly closing over traced parameters. required
mesh HexMesh Mesh extracted at the nominal design by :func:~cadjoint.fem.hexmesh.sdf_to_hex_mesh. required

Returns

Name Type Description
Vertex positions as a JAX array shaped like mesh.points.