Skip to content

Check that equivalent cells compile a form the same way - #5375

Merged
pbrubeck merged 5 commits into
mainfrom
pbrubeck/tp-embedded-superdegree
Aug 25, 2026
Merged

Check that equivalent cells compile a form the same way#5375
pbrubeck merged 5 commits into
mainfrom
pbrubeck/tp-embedded-superdegree

Conversation

@pbrubeck

@pbrubeck pbrubeck commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Closes the discrepancy left over from #5223. A hexahedron and a quadrilateral times an interval hold the same space, but the same form did not reach the same kernel on the two cells:

Extruded FIAT
Local assembly FLOPs with spectral mode is 3.79e+05
8.668326017584192
Hex FIAT
Local assembly FLOPs with spectral mode is 2.46e+05
15.785334586022751

UFL estimates a quadrature degree from the element's embedded superdegree. A tensor product element summed that over its factors, so Q3 x P3 reported 6 where the hexahedral Q3 reported 3, and every cell built as a tensor product was integrated at too high a degree. The overshoot compounds with nesting: interval x interval x interval costs 8.5x the hexahedral flop count at degree 3, against 3.9x for quadrilateral x interval.

test_equivalent_cells compiles the Helmholtz form and its action on each pair of equivalent cells and asserts the flop counts agree. All six parametrisations fail on main and pass with firedrakeproject/fiat#287.

The fix itself is in FIAT (firedrakeproject/fiat#287, branch pbrubeck/tp-embedded-superdegree) and in UFL (FEniCS/ufl#506, merged), which stops reducing the estimated degree on cells that are not simplices.

Stacked on #5377, which is needed for the test suite to run at all.

DROP BEFORE MERGE

The second commit installs the FIAT branch over the pinned main after CI has installed everything else. Drop it once firedrakeproject/fiat#287 merges.


AI was used in preparing this contribution (Claude Code).

🤖 Generated with Claude Code

@pbrubeck
pbrubeck force-pushed the pbrubeck/tp-embedded-superdegree branch 2 times, most recently from 101ea81 to 713e88b Compare August 24, 2026 09:22
@pbrubeck
pbrubeck changed the base branch from main to pbrubeck/loopy-main August 24, 2026 09:22
@pbrubeck pbrubeck added the base:main Run this PR using a main (dev) build label Aug 24, 2026
@pbrubeck
pbrubeck force-pushed the pbrubeck/loopy-main branch from a56d0cd to 5c03143 Compare August 24, 2026 09:35
@pbrubeck
pbrubeck force-pushed the pbrubeck/tp-embedded-superdegree branch 2 times, most recently from 483b983 to 5237ffb Compare August 24, 2026 09:36
@pbrubeck
pbrubeck changed the base branch from pbrubeck/loopy-main to main August 24, 2026 20:26
@pbrubeck
pbrubeck force-pushed the pbrubeck/tp-embedded-superdegree branch 2 times, most recently from 221a1d4 to bd8034c Compare August 25, 2026 13:13
connorjward and others added 4 commits August 25, 2026 14:13
Imperial have culled a bunch of old accounts.
The latest release breaks loopy.

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Connor Ward <c.ward20@imperial.ac.uk>
A hexahedron and a quadrilateral times an interval hold the same space,
so the same form must reach the same kernel on both. Firedrake issue
5223 left them apart: the quadrature degree UFL estimates comes from the
element's embedded superdegree, which a tensor product element summed
over its factors instead of taking per direction, so every cell built as
a tensor product was integrated at too high a degree.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@pbrubeck
pbrubeck force-pushed the pbrubeck/tp-embedded-superdegree branch from bd8034c to 7b0046a Compare August 25, 2026 13:13
@pbrubeck
pbrubeck requested a review from connorjward August 25, 2026 13:13
@pbrubeck
pbrubeck merged commit b5ce0f5 into main Aug 25, 2026
6 of 7 checks passed
@pbrubeck
pbrubeck deleted the pbrubeck/tp-embedded-superdegree branch August 25, 2026 17:09
pbrubeck added a commit that referenced this pull request Aug 26, 2026
---------

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

Labels

base:main Run this PR using a main (dev) build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants