Peano
Loading...
Searching...
No Matches
Lexicographic Namespace Reference

Legacy lexicographic Cartesian ordering helpers. More...

Functions

 Cartesian_to_lexicographic_2d (tuple[int, int] coordinates, int size)
 Map a 2-D Cartesian index to standard lexicographic order.
 
 Cartesian_to_lexicographic_3d (tuple[int, int, int] coordinates, int size)
 Map a 3-D Cartesian index to standard lexicographic order.
 

Detailed Description

Legacy lexicographic Cartesian ordering helpers.

This module provides the standard row-major lexicographic mapping that was used by an earlier version of the leaf distribution before the traversal was switched to Peano SFC order in SplitTrees.py.

This strategy runs through the mesh bottom up. It first assigns all leaves on the finest level to partitions, then the leaves on the next coarser level, and so forth. This strategy is biased towards the finest mesh and particularly valuable for strategies which do more work on the finest level than on other cells. This holds for example for some p-multigrid solvers or ExaHyPE with limiter where the limiter typically kicks in on the finest mesh resolution only.

We do assign indices per level along the Peano space filling curve. However, whenever we encounter an AMR transition, we stop assigning cells to a rank. That is, if there are 27 connected fine grid cells and each subtree should have 15 cells, then we assign the first 15 cells to tree 0. Tree 1 then get the remaining 27-15 cells. After that, we continue with tree 2. Through this, we avoid that AMR partitions become disconnected:

The ordering itself is straightforward:

  • 2-D: (x, y) -> x + y * size
  • 3-D: (x, y, z) -> x + y * size + z * size^2

This module keeps the legacy helpers isolated from the SFC utilities so the Peano-specific code can stay focused on SFC order.

Function Documentation

◆ Cartesian_to_lexicographic_2d()

Lexicographic.Cartesian_to_lexicographic_2d ( tuple[int, int]  coordinates,
int  size 
)

Map a 2-D Cartesian index to standard lexicographic order.

Definition at line 37 of file Lexicographic.py.

◆ Cartesian_to_lexicographic_3d()

Lexicographic.Cartesian_to_lexicographic_3d ( tuple[int, int, int]  coordinates,
int  size 
)

Map a 3-D Cartesian index to standard lexicographic order.

Definition at line 50 of file Lexicographic.py.