[dune-functions] Binding to non-leaf entities in dune-functions 2.6
Simon Praetorius
simon.praetorius at tu-dresden.de
Tue Nov 20 15:00:56 CET 2018
Hi Carsten,
In you explanation, you explained why a LocalView is not bindable to an
element that is not part of the GridView of the basis. That makes
perfectly sense. Also, there are some Basis implementations, like
BSplineBasis, that call gridView functions in the bind(Element) method
of the BasisNode, so in general it can not be bound to a non-GridView
element, you are right.
Creating a LocalFiniteElement, on the other hand, should be independent
of the GridView, since the dune-localfunctions module does not know
anything about a GridView at all. This is what you need in grid adaption
and this is the way the discretization modules, like dune-pdelabs,
implement some adaption routines. You do not need the full LocalView,
you just need the LocalFiniteElement.
The problem is now: How do I get the LocalFiniteElement associated to a
GlobalBasis (Leaf-)Node. Since there is no general factory for
finiteElements, like the PQkLocalFiniteElementCache in Lagrange nodes,
or the RaviartThomasLocalFiniteElementMap for the ravier thomas nodes,
and the FiniteElement type alone does not allow the construction, I need
to get it somewhere. Either I write an own factory that gets a global
basis and walk through the basis nodes and extracts the FiniteElement
type and then manually associate to each type a factory or I need
something to get this from the node itself, since there all the
factories are already encoded but not accessible.
The BSplineBasis is somehow special, since the LocalFiniteElement is
parametrized with the GridView.
Any idea how to get a local finite-element otherwise?
Simon
Am 20.11.18 um 05:25 schrieb Carsten Gräser:
> Hi Simon,
>
> Am 20.11.18 um 07:27 schrieb Simon Praetorius:
> [...]
>> if you want to access the finiteElement() of a leaf basis node, you have
>> to bind it to an element, since, e.g. LagrangeNode uses a
>> FiniteElementCache that gives you a different FiniteElement depending on
>> the element type. Binding a TypeTree to an element could be done using
>> the free function `bindTree(tree, element)` from
>> dune/functions/functionspacebases/nodes.hh. But therefore you need a
>> mutable tree object. The LocalView gives you only a const& to the
>> TypeTree. An option would be to simply create a copy of the tree and
>> bind this copy to the element, i.e.
> please don't do this! Notice that bindTree() is not part of the
> user interface and the tree should not be copyable by the user.
- bindTree() is a function in namespace Dune::Functions, not in Impl,
Imp, or Detail, or any other sub namespace. That it is not described in
any pdf document does not mean it is not an interface method, right? So,
what makes it a non-interface function?
- But, the tree is copyable. If you intent to disallow this, then, add a
comment or make the copy-constructor not accessible.
>
>> The tree traversal does not require a bound tree, so you could also bind
>> the leaf node directly to an element, i.e.
> As described in my reply to Felix Müller this leads to undefined
> behavior. While the current implementation does give you some
> finite element, there's no guarantee on its type and it may
> as well terminate with an error or kill your kitten.
>
> Best,
> Carsten
>
More information about the dune-functions
mailing list