[dune-functions] Global Id of dune-function basis DOFs

Simon Praetorius simon.praetorius at tu-dresden.de
Tue Jun 11 12:42:11 CEST 2019


Sorry, maybe my explanation was not clear or irritating.

I try to parallelize dune-functions bases. This should be possible
somehow, at least for some of the bases.

Since bases have different continuity properties, a purely generic
implementation is not possible. So, one has to provide this continuity
information for each basis in some way. On a local domain, the DOFs get
a continuous or discontinuous index from the LocalView. But on
distributed grids, this information is not given, currently.

The Dune::ParallelIndexSet and RemoteIndexSet..., provide a way to
associate a local index with a global index (and maybe with some
additional attributes). This requires to identify the DOFs in a
distributed grid.

Can this information be added to the GlobalBasis or BasisNode
implementations? Those data structures already define local continuity
of DOFs. Shouldn't it be possible to also add global continuity information?

Assuming, we have a global id for each DOF in each leaf basis node
>> separately, one could easily create a global basis global id, by adding
>> some shift, corresponding to the position in the basis tree, to each
>> node DOF global id. But, how to obtain the global id of the DOFs in a
>> basis node?
> You can not apply such a shift, as an id is not required to be a number. All that we require is, that an id is ordered and hashable.

This shift was related to a concrete idea to implement the ID.
Essentially what you need is some identification of the node in the tree
+ the DOF id of a local basis on that node. So, some kind of tuple, e.g.
for LagrangeDG

(treePath, localDofId)

where localDofId could be something like

localDofId := (global-elementId, localDofIndex)

(There are multiple other ways to identify a LagrangeDG DOF)

For continuous Lagrange DOFs it is a bit more delicate. For low order
Lagrange, we can assume that there is <= 1 DOFs per entity and one could
use something like

localDofId := (global-entityId, localIndexOnEntity)

where localIndexOnEntity==0 and the entity is extracted from the localKey.

So, each basis node needs a different handling of the identification of
DOFs.

For other bases than Lagrange, one might need additional information to
make it continuous, like a global unique orientation of facets. Since we
have ordered global entity ids this should be possible to provide.

I don't know all bases in detail, so there might be a basis, where this
global continuity information is harder to obtain.

Either I define a functions/class GlobalDOFId that specialized for each
PreBasis type and calculates the global id for a local DOF, or this can
be added to the PreBasis implementation directly. (The first option is
not so nice, since the PreBasis types change from dune-functions version
to version. Currently I have to support the dune-functions 2.6 class
signature and the 2.7 PreBasis type, and with some other MR in
dune-functions this type changes again. So a simple specialization is a
bit annoying)

Best,
Simon

PS: there is a more complete sketch in the branch

https://gitlab.dune-project.org/simon.praetorius/dune-functions/tree/feature/global_dof_ids

where this global ID is implemented for Lagrange, LAgrangeDG, Power,
Composite, and TaylorHood PreBases.

>
> The simplest way to generate a final I'd is to take the Multiindex and use the entity id instead of the geometryindex/entityindex pair. Alternatively one could just append the per-entity numbering to the entity-id (in the sense of a tuple).
>
> Ciao
> Christian
>
>> For a LagrangeDG basis, one could think of a global id easily, e.g. the
>> global element id + a local key of the local DOF. but for the
>> continuous
>> Lagrange basis it is already "slightly" more complicated, since the
>> connectivity of multiple DOFs per entity can not easily be determined,
>> without the help of some non dune-core functionality, like the
>> TwistUtilities from dune-fem. Also, one can not distinguish the
>> LagrangeNode and the LagrangeDGNode, since they are just aliases. So,
>> it
>> is difficult to specialize a user-defined function, based on the node
>> type (that i receive when walking through the basis tree using
>> forEachLeafNode, for example)
>>
>> A first thought was, that maybe one should extend the GlobalBasis with
>> some kind of GlobalIdSet (similar to what is in the grid) that uniquely
>> identifies the DOFs in a distributed grid. If this is in the basis, one
>> does not need to walk through the nodes manually and write for each
>> possible basis a wrapper function, but the writer of a basis has to
>> think about a possible parallel global id for the DOFs.
>>
>> See also
>>
>>> https://gitlab.mn.tu-dresden.de/snippets/2
>> for a sketch of the implementation.
>>
>> One probably should add a GlobalView next to LocalView or something
>> similar to the GlobalBasis to initialize the global ids only when
>> needed. (the names local and global have multiple meanings here, this
>> should be clarified)
>>
>> Do you think this is a extension that could be implemented? Maybe it is
>> not possible for all types of dune-function bases.
>>
>> Best wishes,
>> Simon
>>
>>
>>
>>
>> _______________________________________________
>> dune-functions mailing list
>> dune-functions at lists.dune-project.org
>> https://lists.dune-project.org/mailman/listinfo/dune-functions




More information about the dune-functions mailing list