GlobalIndex of ParallelIndexSet used out of specification.
The GlobalIndex
in ParallelIndexSet
is by documentation a type that "[...] has to provide at least a operator< for sorting". In the documentation of the class it is named a global id and it is stated:
[...] the global id might not be consecutive but definitely is persistent.
So, it is a persistent (over grid changes) partially ordered id type. (Similar to the global entity id type of the grid)
While this is already not enough for the ParallelIndexSet
and GlobalLookupIndexSet
implementation (I think, all comparison operators are used somewhere in the code), it gets worse in dune-istl code that uses the ParallelIndexSet
.
Example: fillIndexSetHoles()
from repartition.hh
:
- a maximal GlobalIndex is determined by first initializing a global index with 0 (not possible in general) and then pairwise
std::max
. Why not using the already ordered listParallelIndexSet::localIndices_
? - to determine the next free global index, the maximum is then incremented (using
operator++
) and shifted (usingoperator+
).
Both points are not guaranteed to work by the ParallelIndexSet
.
So, here some cleanup or at least better specification of the requirements is necessary!
Edited by Simon Praetorius