Skip to content

Take the embedded superdegree per direction on a tensor product cell - #287

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

Take the embedded superdegree per direction on a tensor product cell#287
pbrubeck merged 3 commits into
mainfrom
pbrubeck/tp-embedded-superdegree

Conversation

@pbrubeck

Copy link
Copy Markdown

The problem

TensorProductElement.embedded_superdegree adds 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. A
Lagrange 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 * interval cell 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))*dx on the extruded cell, UFL gives 26 in place of 14.
FIAT then applies 26 to each direction of the cell.

The change

embedded_superdegree now takes the largest embedded superdegree of the
factors. The definition of the property does not change.

Effect

An extruded mesh of quadrilaterals, with the fix in FEniCS/ufl#506.

form points before points after flops before flops after
Q7 inner(grad(u), grad(v))*dx 3375 729 33,516,981 15,941,187
NCE7 inner(curl(u), curl(v))*dx 3375 729 253,603,812 115,918,062

Each matrix agrees with a rule of degree 32 to machine precision.

AI declaration: written with Claude Code (Claude Opus 5).

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>
Comment thread finat/ufl/tensorproductelement.py Outdated
Comment thread finat/ufl/tensorproductelement.py Outdated
Co-authored-by: Pablo Brubeck <brubeck@protonmail.com>
Comment thread finat/ufl/tensorproductelement.py Outdated
Comment thread finat/ufl/tensorproductelement.py Outdated
Co-authored-by: Pablo Brubeck <brubeck@protonmail.com>

@mscroggs mscroggs left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct to me for tensor product elements

@pbrubeck
pbrubeck merged commit 7e7f1bd into main Aug 25, 2026
9 checks passed
@pbrubeck
pbrubeck deleted the pbrubeck/tp-embedded-superdegree branch August 25, 2026 10:05
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.

2 participants