[Draft] Implement infrastructure to restrict the support of a basis to a subdomain of the gridView
- builds upon !491
- The idea is to write something like
auto stokesPreBasis = composite(power<dim>(lagrange<2>()), lagrange<1>()); auto darcyPreBasis = lagrange<1>(); auto multiDomainPreBasis = multiDomainComposite(domainInfo, restrict(stokesPreBasis, subdomain(0)), restrict(darcyPreBasis, subdomain(1)));
-
domainInfo
knows how the domain \Omega is split up into subdomains \Omega_0, \Omega_1, ... - The infrastructure should in the end be flexible enough to also support the use-case of Cut-Cell discretizations, this means...
- while in this example we could handle everything at the level of the leaf nodes, without (or at least with negligable) performance loss, this is not the case in general
- for cut-cells the leafs need to have information about the actual geometry, i.e. after intersection the background cell with the geometry. These geometric constructions should only be done once for the whole tree, when binding to a new background cell, as they are usually costly.
- this is the reason that
multiDomainComposite
already gets thedomainInfo
and can thus (potentially) do a lot of calculations directly in the root-node. - I would also like to truncate the tree traversal early on in order to speedup index calculation in the
bind
.
- For these reason the workflow is now (intended, not every implemented yet) as follows:
-
multiDomainComposite
creates a newMultiDomainGridView
, which holds thedomainInfo
- with the help of
domainInfo
theMultiDomainGridView
creates and holds the set ofRestrictedGridView
objects. - the underlying
CompositePreBasis
is the initialized with this newMultiDomainGridView
. - in the factory for the
RestrictedPreBasis
we now get theMultiDomainGridView
and from this retrieve theRestrictedGridView
for the respective subdomain. -
[partially done] creating a
localView
now requires creating a modifiedTypeTree
tree, in particular containingRestrictedNode<...>
entries which wrap the original nodes and by this allow us to provide specialbind
methods in these nodes. -
[not done yet] upon
localView
bind theMultiDomainPreBasis
can already handle those calculations that are common for all subdomains by callingdomainInfo.bind(e)
. - when traversing the
localView.tree()
duringlocalView.bind(e)
, theRestrictedNode<...>
wrappers can check whether this element is part of the subdomain by checkingrestrictedGridView.contains(e)
. If the element is not contained, the traversal does not process this sub-tree further and thesize
andoffset
entry are left is their default-initialized state (in particularsize==0
). - When calling
finiteElement()
on a restricted leaf-node (possibly implicitly restricted, like in the Stokes subdomain above) we return aRestrictedLocalFiniteElement<...>
wrapper, which can be disabled, if we are outside of the subdomain. - Practically the
RestrictedLocalFiniteElement<...>
only return asize() -> 0
if theRestrictedNode<...>.size() == 0
or forwards to the underlyingLocalFiniteElement
if the node is "active".
-
Note:
This is work in progress! There are still a couple of rough edges and not every intended feature is already implemented. Currently the basisTest
fails in many ways for multiDomain
spaces. I also would like to have a shortcut to be able to directly use restricted
on a single leaf node space, without the need of multiDomainComposite
, perhaps like preBasis = restricted(lagrange<1>(), subdomain(0), domainInfo)
.