Add verification for Ferrite.jl - #576
Open
fredrikekre wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.