There are four different ways to number entities:
Levelwise index: Consecutive, zero-starting, non-persistent numbering of entities of one codimension, geometry type and level in one process. I.e. entities of different levels, codimension, geometry type and processes can have the same number. Non-persistent means that the number can change during grid refinement and load balancing.
Leafwise index: Consecutive, zero-starting, non-persistent numbering of entities of leaf entities of one codimension and geometry type. All children which are copies of an entity have the same number.
Globally unique id: Every entity has a globally unique identification, i.e. across all levels, codimensions and processes. The type used for this id is user-defined. But: The copies in the refinement tree are identified which means e.g. an entity in the coarse grid that is copied to the fine grid has the *same* id.
Locally unique id: Same as 3) but only *within* processes.
Note 1: In principle all information could be created externally from the globally unique index defined in 3. But as usual we will provide default implementations that can be overloaded.
Note 2: The indices and id are accessible via extra objects that are returned by the grid. This offers the possibility that indices or ids are only computed on demand. These classes are:
Note 3: The classes LevelIndexSet and LeafIndexSet implement the same interface. This enables us to write other classes independent of whether they used with a level or leaf index. This also requires the size methods to be in these classes.
Note 4: GlobalIdSet and LocalIdSet implement the same interface.
There are the following four methods on the grid that deliver the index/id objects: