[dune-functions] Binding to non-leaf entities in dune-functions 2.6

Carsten Gräser graeser at mi.fu-berlin.de
Tue Nov 20 11:25:59 CET 2018


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.

> 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune-functions/attachments/20181120/2058ee81/attachment.sig>


More information about the dune-functions mailing list