Closed connorjward closed 2 months ago
I'm surprised this makes any difference, as for P and Q spaces, the embedded sub- and superdegrees are the same.
At least, they're the same for the elements coming from Basix. Maybe this isn't true for elements from FInAT?
I'm surprised this makes any difference, as for P and Q spaces, the embedded sub- and superdegrees are the same.
At least, they're the same for the elements coming from Basix. Maybe this isn't true for elements from FInAT?
They differ for tensor product elements. We encountered the issue on extruded meshes.
At least, they're the same for the elements coming from Basix.
They shouldn't be for Q
, no? e.g. Q1 on quadrilaterals has a basis $\text{span} \{1, x, y, x y \}$ which has an embedding superdegree of 2.
Embedded degrees are defined in terms of the span of Lagrange on the current cell:
This is important for pyramids, where rational functions like $\frac{x}{1-z}$ are included in the polysets, so talking about standard polynomial degrees doesn't make sense.
Longer term, I think we should add information about the traces of elements (#298), as I think we should be asking here whether the traces on the edge are linear, which the embedded degrees don't really capture. But happy to merge this in the meantime, just updating TSFC branches to try to get those tests to pass...
Embedded degrees are defined in terms of the span of Lagrange on the current cell:
[...]
This is important for pyramids, where rational functions like x1−z are included in the polysets, so talking about standard polynomial degrees doesn't make sense.
I agree that if the basis is non-polynomial it doesn't make much sense.
However, my reading of the docstring you quoted still suggests that Q1 should be advertising an embedded_superdegree
of 2. Since the complete polynomial space that spans the Q1 basis is of degree 2. Am I misunderstanding?
However, my reading of the docstring you quoted still suggests that Q1 should be advertising an
embedded_superdegree
of 2. Since the complete polynomial space that spans the Q1 basis is of degree 2. Am I misunderstanding?
My intended reading of "This returns the degree of the lowest degree Lagrange space such that the polynomial space of the Lagrange space is a superspace of this element's polynomial space" is "This returns the degree of the lowest degree Lagrange space on the cell on which this element is defined such that the polynomial space of the Lagrange space is a superspace of this element's polynomial space", ie for elements on quads, it returns the degree of the Lagrange/Q space in which it's embedded.
We were discussing this at PDESoft, and I was leaning towards your reading being better. But since thinking about pyramids I'm less sure, and remember why I made it this way.
Lagrange/Q space
Also this assumes that everyone overloads the name "Lagrange" in the same way I do which is in no way a safe assumption.
Also this assumes that everyone overloads the name "Lagrange" in the same way I do which is in no way a safe assumption.
Yeah, I think this is probably one aspect of the confusion. I suspect it is better to talk in terms of spans of polynomial sets, rather than names for this.
But since thinking about pyramids I'm less sure, and remember why I made it this way.
AIUI (and I haven't really done anything with pyramids), if these have rational basis functions then there is no polynomial space that spans the basis. And so one should return None
.
So I'm not quite sure how the "complete polynomial space" reading conflicts: there is no such space, so one returns None.
So I'm not quite sure how the "complete polynomial space" reading conflicts: there is no such space, so one returns None.
It can still be useful to know which "degree" the elements on pyramids are included in, for example for telling if the edges of the pyramid are straight.
Thought to return to later: If #298 is done, do we still need embedded degrees?
Fixes https://github.com/firedrakeproject/firedrake/issues/3612
To quote @dham: