firedrakeproject / fiat

This is FIAT. FIAT was previously maintained as part of the FEniCS project (https://github.com/fenics/fiat)
GNU Lesser General Public License v3.0
5 stars 7 forks source link

More Lagrange variants #51

Open pbrubeck opened 10 months ago

pbrubeck commented 10 months ago
  1. Should we have a single base class for Lagrange and DiscontinuousLagrange?

  2. If we want equispaced and GL variants of Discontinuous Lagrange, we need to change the current topological DOF ordering of DiscontinousLagrange, as there are no GL points on facets.

  3. GaussRadau should subclass Lagrange, but these nodes are not available in recursivenodes.

rckirby commented 10 months ago

Should we have a single base class for Lagrange and DiscontinuousLagrange?

Removing redundant code is always a good thing if we can do it without other complications.

If we want equispaced and GL variants of Discontinuous Lagrange, we need to change the current topological DOF ordering of DiscontinousLagrange, as there are no GL points on facets.

Yes, it's fine to let DG nodes "geometrically" live on facets, just not "topologically". The set of allowable CG node sets is smaller than that of allowable DG ones.

Here is a possibility: The Lagrange base class takes a variant of point type and builds that point set. Then, the CG subclass associates the points with particular facets (this can be done up to reasonable tolerance by converting to barycentric coordinates, BTW). This gives a list mapping each point id to the dimension/facet to which it's attached. We build entity_ids essentially by reversing this mapping (going from dimension/facet to integer). The DG subclass just topologically associates everything with codimension 0. OTher than this, the logic is the same for both classes.

The gotcha is that not all variants that are legal for DG are legal for CG, so we need a guard in the CG subclass that raises an exception if variant is not in some set that works.

GaussRadau should subclass Lagrange, but these nodes are not available in recursivenodes.

These are absolutely essential for Irksome (the main if not only use case). We could proceed by having make_lattice say "if variant is radau, do something, else ask recursivenodes".

pbrubeck commented 4 months ago

Except for the point about Raudau, this was mostly addressed in https://github.com/firedrakeproject/fiat/pull/64.

We now have two different DualSets for DiscontinuousLagrange, one for Broken CG (with points on facets), and another for interior points.

rckirby commented 4 months ago

Do we want to close this issue now if it's mostly resolved, then open a new one for any outstanding bits?