fem.backends.SolverBackend

fem.backends.SolverBackend()

Protocol every FEM backend implements.

points may be a traced JAX array; implementations must return JAX arrays participating in the surrounding autodiff graph (adjoint VJP at minimum). cells and BC index arrays are static.

Methods

Name Description
elastic Solve small-strain linear elasticity; returns displacement (N, 3).
thermal Solve -div(k grad T) = q; returns per-node temperature (N,).

elastic

fem.backends.SolverBackend.elastic(
    points,
    cells,
    bcs,
    *,
    youngs,
    poisson,
    base_points=None,
    body_force=None,
)

Solve small-strain linear elasticity; returns displacement (N, 3).

youngs and poisson are scalars or per-element (C,) arrays (see :meth:thermal). body_force optionally prescribes a body force density in N/m^3 — density * gravity for self-weight — shaped (3,) or (C, 3); None means no body force.

thermal

fem.backends.SolverBackend.thermal(
    points,
    cells,
    bcs,
    *,
    conductivity,
    source,
    base_points=None,
)

Solve -div(k grad T) = q; returns per-node temperature (N,).

conductivity is either a scalar (one material for the whole domain) or a per-element (C,) array sampled from the scene’s material field (:mod:cadjoint.fem.properties); a backend that cannot represent a heterogeneous field says so rather than silently averaging.

base_points is a concrete snapshot of the node positions used for problem construction (BC bookkeeping) when points is a traced array; it defaults to points itself.