Skip to content

[Draft] Implement infrastructure to restrict the support of a basis to a subdomain of the gridView

Christian Engwer requested to merge multidomain into master
  • 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)));
    to create a single functions space basis, where the children only have support in certain subdomains.
  • 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 the domainInfo 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 new MultiDomainGridView, which holds the domainInfo
    • with the help of domainInfo the MultiDomainGridView creates and holds the set of RestrictedGridView objects.
    • the underlying CompositePreBasis is the initialized with this new MultiDomainGridView.
    • in the factory for the RestrictedPreBasis we now get the MultiDomainGridView and from this retrieve the RestrictedGridView for the respective subdomain.
    • [partially done] creating a localView now requires creating a modified TypeTree tree, in particular containing RestrictedNode<...> entries which wrap the original nodes and by this allow us to provide special bind methods in these nodes.
    • [not done yet] upon localView bind the MultiDomainPreBasis can already handle those calculations that are common for all subdomains by calling domainInfo.bind(e).
    • when traversing the localView.tree() during localView.bind(e), the RestrictedNode<...> wrappers can check whether this element is part of the subdomain by checking restrictedGridView.contains(e). If the element is not contained, the traversal does not process this sub-tree further and the size and offset entry are left is their default-initialized state (in particular size==0).
    • When calling finiteElement() on a restricted leaf-node (possibly implicitly restricted, like in the Stokes subdomain above) we return a RestrictedLocalFiniteElement<...> wrapper, which can be disabled, if we are outside of the subdomain.
    • Practically the RestrictedLocalFiniteElement<...> only return a size() -> 0 if the RestrictedNode<...>.size() == 0 or forwards to the underlying LocalFiniteElement 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).

Merge request reports

Loading