• Keine Ergebnisse gefunden

Nodal Operations for DOF Numbering Generation

6.4 Nodal Operations for DOF Numbering Gen-eration

As we have seen previously, the (multi) index for a basis function ϕgenerated by an ordering M is constructed in an iterative fashion by starting at the leaf space associated with ϕ and then walking up the function space tree, performing the necessary merging (and, if requested, blocking) operations at each node.

It is thus possible to break the overall ordering map Mdown into a series of nodal operations Mi associated with individual entries of the DOFIndex. In the following, we assume that such an operation may only depend on the current tail entry of the output tuple (i.e. the container index) and the child index of the current node in the DOFIndex tree. For example, if the incoming container index is (i1, i2), i.e.

a tuple of length 2, and the DOFIndex entry at the current position is j, a nodal operation M can take on one of two forms:

Mf(i1, i2), j=i1, mf(i2, j) (flat transformation) Mb(i1, i2), j=i1, i2, mb(i2, j) (block transformation)

As we are only interested in the last entry of the container index, we will omit the preceding entries and just write (. . . , i) in the future.

At the leaf nodes of the DOFIndex tree, we only consider the following trivial transformation: Given an initial, empty container index tuple () and a DOFIndex (k,G(τl(c)), jn, . . . , j1), the transformation M0 is given by M0((), k) = (k). The remaining node types are more complicated; the corresponding transformations are introduced in the following sections.

6.4.1 Grid Entity Nodes

The merge operation at a grid entity node can be understood as a special case of the interleaving approach. In general, we always want all basis functions associated with a single grid entity to be grouped together, as those basis functions will usually couple with each other. Thus we define the grid entity transformation by

MTf(. . . , i), τl

= . . . , i+Xl−1

j=0

sj

!

, (6.3)

where sj denotes the number of basis functions associated with the mesh entity τj. Equivalently, the blocked version M0b creates a multi index of length 2 and is given by

MTb(. . . , i), τl

=. . . , i, l. (6.4)

6.4.2 Lexicographic Merging

Lexicographic merging groups the basis functions by their associated child space and then sorts these blocks according to the order of the subspaces in the current tree node. Given a composite space V with direct children (Vj)j=0,N1, the trans-formation MLf that maps the index (. . . , i) from child space Vj into the index range of V is given by

MLf(. . . , i), j= . . . ,

i+j−1X

k=0|Vk|

!

, (6.5)

where|V|denotes the dimension (and thus the size of the basis) ofV. This strategy does not make any assumptions about the internal structure of or the relationships between subspaces and can thus be applied to any type of multi-component space.

This combination of generality and ease of implementation makes lexicographic merging the standard algorithm implemented by almost all modernFEMframeworks [32, 15, 81].

The blocked versionMLb of this transformation is again very simple: It just appends the child index j to the existing multi index, which yields

MLb(. . . , i), j= (. . . , i, j). (6.6)

6.4.3 Proportional Interleaving

Problems like the multi-component transport example from Section4.2.3can greatly benefit from grouping the values of the component concentrations in small per-entity vectors, which we can then directly invert using a block-aware preconditioner.

Figure6.2(b)shows an example of a matrix created by the proportional interleaving of two spaces of identical size.

In order to create this mapping for a composite space V with direct children (Vj)j=0,N−1, each child space Vj has to be associated with an integer multiplicity fj ∈N such that |Vj|/|Vk|=fj/fk, j, k = 0, . . . , N −1. For example, consider a space V1 that attaches 2 functions to each vertex and 4 functions to each edge. At the same time V2 attaches 1 function to each vertex and 2 to each edge, yielding a fixed ratio of 2 : 1. Assuming fixed multiplicities fj, the proportional merging map MP is given by

MPf(. . . , i), j= . . . ,

imodfj +jX1

k=0

fk+

$i

fj

%N1 X

k=0

fk

!

, (6.7)

while the blocked version is defined by MPb(. . . , i), j)= . . . ,

imodfj +jX1

k=0

fk

,

$ i

fj

%!

. (6.8)

Note that unlike the earlier transformations, the blocked version MPb in this case not only appends a new entry to the output index, but also modifies the last entry of the existing index.

6.4 • Nodal Operations for DOF Numbering Generation 105

V1 V2

Lexicographic Sorted by grid entity

Figure 6.6 — Lexicographic merging and entity-based sorting for two structurally different function spaces. Note that the compatible parts of the spaces (associated with the grid vertices) have been merged, while the edge-related entries of the second space are simply appended in lexicographic fashion.

6.4.4 Grouping Composite Spaces by Grid Entity

Without a fixed integer ratio for the child space sizes, the static merging procedure described in the previous section will not work any more. The main reason for interleaving the values from the child spaces in this manner is to cluster the basis functions by grid entity in order to e.g. create a common diagonal matrix block that can then be used in a preconditioner like block Jacobi. In certain settings, this entity-wise clustering can be beneficial even without the fixed size ratio, e.g.

for p-adaptive DG product spaces, where all degrees of freedom are associated with the cells; the p-adaptivity simply causes a different number of basis functions to be associtated with each cell. With the help of entity-wise clustering in the product space, we can retain the typical block structure of those spaces, albeit with blocks of varying size. Figure 6.6 illustrates this principle by means of a less useful example, an incompatible combination of a Q1 and a Q2 space, but demonstrates the general applicability of the principle

Looking back at the basis function tree in Figure 6.4, we can see that in it, all basis functions in a leaf space are grouped by their grid entities. If we want to perform this grouping at a higher level in the tree, we cannot do it by introducing a new type of nodal operation; instead, we have to reorganize the tree and move the grid entity node further up towards the root of the tree. The result of such a tree modification is shown in Figure 6.7, which depicts a tree that was derived from the one in Figure 6.4 by moving the entity nodes up to the third tree layer.

In our implementation, this complex modification of the input tree is handled by a special TypeTree transformation.

V

V0 · · · Vj0

τ0(c) · · · τi(c)

V0 · · · Vj1

· · · · V0 · · · VjN

ϕ0 · · · ϕk · · · ϕn

· · · VN

· · ·

· · · VN

· · · τN(c)

· · · VN

Figure 6.7 — Modified DOFIndex tree with grid entity information moved to the second index entry