hermit.fenics.spaces

Space-descriptor plumbing – normalise / build dolfinx FunctionSpaces from a compact (family, degree[, value_shape]) tuple, plus the single definition of the RM-shell mixed state space.

Pure FEniCSx (DOLFINx 0.9 / 0.11), no CSDL. _ELEMENTS / state_space used to live on ShellPDE directly; they are factored out here so ShellPDE and the new ShellDomain both call the same code instead of each building the mixed element by hand.

Functions

is_discontinuous(→ bool)

True for DG / DQ / Quadrature spaces -- the single definition, which

make_space(mesh, space)

Build the dolfinx FunctionSpace for a (possibly un-normalised) space

normalize_space(space)

Normalise a space descriptor to (family: str, degree: int, value_shape: tuple).

state_space(mesh[, element])

The mixed (displacement, rotation) state space for the R-M shell -- e.g. CG2xCG1

Module Contents

hermit.fenics.spaces.is_discontinuous(space) → bool

True for DG / DQ / Quadrature spaces – the single definition, which hermit.fenics.ops._space_is_dg delegates to. "Quadrature" counts: its dofs are per-quadrature-point values, with no continuity across cells.

hermit.fenics.spaces.make_space(mesh, space)

Build the dolfinx FunctionSpace for a (possibly un-normalised) space descriptor.

Ordinary families go through the plain functionspace element tuple. "Quadrature" must go through basix.ufl.quadrature_element – it is not a valid plain family string for functionspace. Note: any UFL measure that later touches a quadrature-space coefficient needs a matching metadata={"quadrature_degree": d} or dolfinx errors; that is the caller’s job, not this constructor’s.

hermit.fenics.spaces.normalize_space(space)

Normalise a space descriptor to (family: str, degree: int, value_shape: tuple).

Accepted input: ("Lagrange", 1) / ("CG", 2) / ("DG", 0) / ("DQ", 1) / ("Quadrature", 2), each optionally with a third element giving the value shape, e.g. ("DG", 0, (3, 3)) / ("Lagrange", 1, (3,)). A scalar space normalises to value_shape == (). "CG" normalises to "Lagrange" so ("CG", 1) and ("Lagrange", 1) are the same space – equal tuples, one cache entry.

hermit.fenics.spaces.state_space(mesh, element='CG2CG1')

The mixed (displacement, rotation) state space for the R-M shell – e.g. CG2xCG1 for element="CG2CG1". Ported verbatim from ShellPDE.__init__.