The following function provides the spatial index triple for a given ID in the complete mesh, on its refinement level. The returned coordinates start at 0. The fourth entry is the level on which the coordinates are located in the tree. The steps are following: 1. calculate the refinement level, store to coord(4). 2. Calcualte the level offset. 3. the Morton index is obtained by subtracting the offset from treeID. 4. Apply bit interleaving rule to generate coordinates.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=long_k), | intent(in) | :: | TreeID | input element ID |
||
integer(kind=long_k), | intent(in), | optional | :: | offset | First Elem of current level, if known, to avoid recomputations |
coordinate of element return value
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=long_k), | private | :: | tElem | ||||
integer(kind=long_k), | private | :: | fak(3) | ||||
integer, | private | :: | bitlevel | ||||
integer, | private | :: | i |