|
Peano
|
Functions | |
| RegularGridGenerator (name=None, max_level=None, dimensions=None) | |
| Generate an artificial regular grid with uniform refinement for testing purposes. | |
| RegularGridGenerator.RegularGridGenerator | ( | name = None, |
|
max_level = None, |
|||
dimensions = None |
|||
| ) |
Generate an artificial regular grid with uniform refinement for testing purposes.
This function creates a complete regular grid structure where all regions are refined uniformly to the specified maximum level. All cells are initially assigned to subtree 0, providing a clean starting point for load balancing experiments and algorithm testing.
The generated grid follows Peano's hierarchical structure:
Args: name (str, optional): Descriptive name for the generated tree (e.g., "TestGrid_L4"). If not provided, a deterministic default name is generated from dimensions and level. max_level (int): Maximum refinement level (must be > 0) dimensions (int): Spatial dimensions (2 for 2D, 3 for 3D)
Returns: Tree: Tree object with complete regular grid structure
Example: ```python
test_tree = RegularGridGenerator( name="Uniform_Test_2D", max_level=4, dimensions=2 )
print(f"Generated tree: {test_tree._name}") print(f"Total cells: {test_tree._leaf_count}") print(f"Levels: {test_tree._max_level}")
from strategies.SplitTrees import split_tree split_tree(test_tree, number_of_subtrees=3) ```
Note:
Definition at line 98 of file RegularGridGenerator.py.
Referenced by 35_offline-load-balancing.offline_decomposition(), 35_offline-load-balancing-split-modes.offline_decomposition(), 35_offline-load-balancing-plan-vs-run.offline_plan(), and 35_offline-load-balancing-quantised.owner_of_cells().
