firedrakeproject / firedrake

Firedrake is an automated system for the portable solution of partial differential equations using the finite element method (FEM)
https://firedrakeproject.org
Other
482 stars 157 forks source link

MG: embedded transfer support for non-point variants #3596

Closed pbrubeck closed 1 month ago

pbrubeck commented 1 month ago

Description

The MG transfer kernels assume Lagrange elements with point evaluation, and they produce an error when the element we want to transfer does not have point evaluation DOFs.

We have CG/DG element variants that are not Lagrange, for instance the "fdm" and "integral" (a.k.a. hierarchical) variants. To transfer functions with these elements we must use an embedding space with a point variant.

Note that CG1 and DG0 would always have point evaluation DOFs regardless of the variant, and we can easily detect this from the FInAT element instance. UFL elements can only tell us about the family, variant, and degree. So in order to ensure that the element at hand is Lagrange, it'd be better to cache the MG tranfers with a key derived from the FInAT element.