Skip to content

Add verification for Ferrite.jl - #576

Open
fredrikekre wants to merge 1 commit into
DefElement:mainfrom
fredrikekre:fe/ferrite-verification
Open

Add verification for Ferrite.jl#576
fredrikekre wants to merge 1 commit into
DefElement:mainfrom
fredrikekre:fe/ferrite-verification

Conversation

@fredrikekre

Copy link
Copy Markdown
Contributor

Implement verification for Ferrite.jl elements.

This is written by a 🤖 but I have reviewed it. The Ferrite side of
things look correct but please have a look so that this integrates with
the existing code in the way you prefer. See commit message for
more details.

Implement the verify() method for the Ferrite.jl implementation and
enable verification. Verification compares basis functions tabulated by
Ferrite against symfem, checking entity DOF layout, spanned space, and
continuity.

Ferrite is called from Python using juliacall. The import is done
lazily inside verify() so that a missing juliacall is reported as a
missing library, and so that Julia is only initialized inside the
forked worker processes of verify.py.

Ferrite defines hypercube reference cells on [-1, 1]^d whereas
DefElement uses [0, 1]^d; the remaining cells have identical
coordinates up to vertex numbering. Tabulation points are therefore
mapped accordingly. Since all of these maps are uniform scalings, the
Piola maps of H(div)/H(curl) elements reduce to constant scalar
factors, which the span-based verification checks are insensitive to,
so no explicit Piola transformation is needed.

The vertex permutation between the Ferrite and DefElement cells, and
the matching of edges and faces, is computed at runtime from
Ferrite.reference_coordinates/reference_edges/reference_faces and
symfem's reference cells rather than being hard-coded per cell. Entity
DOFs are queried from the scalar base interpolation (Ferrite does not
define the entity DOF queries for vectorized interpolations) and
expanded component-fastest for vdim parameters. The cell interior DOFs
are computed as the complement of the lower-dimensional entity DOFs
since Ferrite associates the DOFs of discontinuous interpolations with
no entity.

All 63 implemented examples pass verification: Lagrange (17),
discontinuous Lagrange (21), Crouzeix-Raviart/Rannacher-Turek (4),
bubble enriched Lagrange (1), serendipity (1), Raviart-Thomas (5),
Nedelec (4), Brezzi-Douglas-Marini (1) and vector Lagrange/Q/bubble
enriched Lagrange (9).

The verification CI jobs in test-and-build.yml and verification.yml
now install Julia (julia-actions/setup-julia) and juliacall so that
the Ferrite verification can run there.

Also fix the element name vector-bubble-enriched-Lagrange in the
"--test auto" list in verify.py: the filename is lowercase, so this
element was silently skipped by the verification job in PR CI.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant