Take the embedded superdegree per direction on a tensor product cell - #287
Merged
Conversation
The embedded superdegree is the degree of the smallest Lagrange space that holds the element. On a cell that is not a simplex, a Lagrange space has a given degree in each direction, so a Q7 space has an embedded superdegree of 7. Adding the degree of each factor gave 14. The same space on a hexahedron already gave 7, so the two cells that hold it disagreed. UFL estimates a quadrature degree from this property, and FIAT then applies that degree to each direction of the cell. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
pbrubeck
commented
Aug 22, 2026
pbrubeck
commented
Aug 22, 2026
Co-authored-by: Pablo Brubeck <brubeck@protonmail.com>
pbrubeck
commented
Aug 22, 2026
pbrubeck
commented
Aug 22, 2026
Co-authored-by: Pablo Brubeck <brubeck@protonmail.com>
mscroggs
approved these changes
Aug 24, 2026
mscroggs
left a comment
There was a problem hiding this comment.
Looks correct to me for tensor product elements
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.
The problem
TensorProductElement.embedded_superdegreeadds the degree of each factor.UFL defines the embedded superdegree as the degree of the smallest Lagrange
space that holds this element. The docstring of that property says that the
Lagrange space of degree 1 on a quadrilateral holds the polynomial
xy. ALagrange space on a cell that is not a simplex is therefore a space of a given
degree in each direction, not a space of a given total degree.
A Q7 space on a
quadrilateral * intervalcell has degree 7 in each direction.The smallest Lagrange space that holds it is the Q7 space itself, so the
embedded superdegree is 7. The property gives 14, because it adds 7 and 7.
The same space on a hexahedron gives 7, because a hexahedron element is not a
tensor product element. Two cells that hold the same space therefore give
different answers.
UFL estimates a quadrature degree from this property. For
inner(grad(u), grad(v))*dxon the extruded cell, UFL gives 26 in place of 14.FIAT then applies 26 to each direction of the cell.
The change
embedded_superdegreenow takes the largest embedded superdegree of thefactors. The definition of the property does not change.
Effect
An extruded mesh of quadrilaterals, with the fix in FEniCS/ufl#506.
inner(grad(u), grad(v))*dxinner(curl(u), curl(v))*dxEach matrix agrees with a rule of degree 32 to machine precision.
AI declaration: written with Claude Code (Claude Opus 5).