Compute the child index for a box with spatial index ix. With child index we mean the index in the children(:) array of its parent.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | ix(3) |
Spatial index of the box |
integer function mg_ix_to_ichild(ix) integer, intent(in) :: ix(3) !< Spatial index of the box ! The index can range from 1 (all ix odd) and 2**$D (all ix even) mg_ix_to_ichild = 8 - 4 * iand(ix(3), 1) - 2 * iand(ix(2), 1) - iand(ix(1),& 1) end function mg_ix_to_ichild