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

Simon Praetorius simon.praetorius at tu-dresden.de
Wed Jun 12 11:06:58 CEST 2019


After a phone-call and some clarification, I can sum up this discussion.

The main issue is that in dune-functions LagrangeNode == LagrangeDGNode.
It is a type alias and thus the local basis with its local keys are
exactly the same. This is in contrast to the interpretation of
LagrangeDG bases, where we should have that all DOFs are associated to
the element and not to the subEntities. But, this is not the case in the
implementation. The local key should somehow also identify the global
connectivity of the basis via the association of DOFs to grid entities
(and the connectivity of these entities in the grid)

Assuming this, a global id can be "generically" obtained by

globalDofId := (tree-index, localDofId)
localDodId := (global-entityId, localIndexOnEntity)

where global-entityId and localIndexOnEntity are extracted from the
localKey of the DOF and the grid GlobalIdSet. (This works at least for
low-order Lagrange finite elements)

Thanks Christian for the discussion and clarification,

Best,
Simon

On 11.06.19 17:17, Christian Engwer wrote:
> Hi Simon,
> the implementation would be simpler than you think...
>
>> 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.
> No, the DOFs are associated with a particular (sub)entity and have a local per-entity index, trusted to the tree. You can use this for DG as well as for conforming spaces.
>
>> 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)
> This is basically what I suggested and it works in any case... As the is is unique over all geometry types, this is the same id as your suggestion below.
>
>> 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.
> Up to now this is _not_ the case. Also the mapping described below can be defined just by global information, but I agree, that we possibly want some right interface.
>
> Christian
>
>> 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