hermit.fenics.spaces ==================== .. py:module:: hermit.fenics.spaces .. autoapi-nested-parse:: Space-descriptor plumbing -- normalise / build ``dolfinx`` ``FunctionSpace``\s 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. .. !! processed by numpydoc !! Functions --------- .. autoapisummary:: hermit.fenics.spaces.is_discontinuous hermit.fenics.spaces.make_space hermit.fenics.spaces.normalize_space hermit.fenics.spaces.state_space Module Contents --------------- .. py:function:: 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. .. !! processed by numpydoc !! .. py:function:: 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. .. !! processed by numpydoc !! .. py:function:: 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. .. !! processed by numpydoc !! .. py:function:: 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__``. .. !! processed by numpydoc !!