Coarsening and refinement of global (pre)bases
This issue addresses a question raised already in Nov 2018 on the mailinglist (https://lists.dune-project.org/pipermail/dune-functions/2018-November/thread.html) regarding binding a prebasis or basis-node to a new gridview, e.g. when doing refinement or coarsening of the underlying grid. A final thought was, that we might need an interface change (maybe in the pre-basis) to rebind or coarsen/refine to a new grid element in another gridView that might be different from the one used to create the pre-basis.
I want to discuss:
- What input do we need to allow a construction of such a rebound pre-basis?
- Which bases need special treatment regarding coarsening/refinement?
- It is in some cases difficult to know in a generic interface which local-function to return on a coarser element/gridview. What kind of information do we need from the user as input to make that decision?
Example: hp-lagrange(dg) basis
On each element a different order for the local-basis could be used. There could even be different orders for face-basisfunctions and interior-basisfunctions. Those orders are stored somewhere in the global basis (thus in the pre-basis), or stored outside if just references in the pre-basis.
Coarsening happens in two phases:
- In the preAdapt step, for each element that might remain in the grid after adaption, we store in a persistent container data/coefficients that allows to reconstruct the function coefficients later. This requires a local finite-element on a level-gridview with a smaller refinement-level as the vanishing leaf element.
- In the adapt step after the grid was adapted, also the function data must be reconstructed from the stored data in the persistent container. Since the coefficients on the element that is now a leaf element was previously calculated in step 1, the data can be transferred directly without additional interpolation
Refinement also happens in two phases:
- In the preAdapt step, for all leaf elements the coefficients w.r.t. to the local basis are stored in a persistent container.
- In the adapt step after grid adaption, new leaf elements are created. For those leaf elements we go up in the hierarchy to find an elements that existed in the previous grid and has stored coefficients in the persistent container. If we know the local-function from the previous grid, we could now interpolate to the finite-element on the leaf-element.
In both cases, we need a local finite-element on an element that is not in our gridView. For the coarsening, we need to create a new local-finite element that will be in the pre-basis after grid adaption. In the refinement, we need to store/obtain the previous local-function on the old gridView.
Other Examples:
- RaviartThomas basis
- BrezziDouglasMarini basis
- Adaption of bspline bases is probably also a complicated topic