Geometry Functions#
Functions to access geometric properties of the current cell and block
from pystencils kernels are available in the sweepgen.symbolic module.
Blockforest, Block, and Cell Geometry#
WaLBerla’s blockforest comprises a hierarchy of geometry-defining objects: The global simulation domain, which has one or more refinement levels, each home to a set of blocks, which in turn define a grid of cells. Many of these geometric properties are modelled as symbolic functions and therefore accessible to kernels. As Sweep kernels are always defined with respect to a single archetypical cell, these symbolic functions always relate to that cell and its parent block.
The following tables lists the available symbolic functions,
the geometric concept they represent,
as well as equivalent methods of the waLBerla C++ API.
All Python APIs are listed relative to sweepgen.symbolic.
Example Apps
Domain Geometry#
Concept |
Symbolic Functions |
C++ API |
|---|---|---|
Domain Axis-Aligned Bounding Box |
|
|
Domain Cell Bounding Box (Current Refinement Level) |
|
|
Note
Similar to CellInterval::max() in the C++ API,
domain_cell_bb.[x|y|z]_max() refers to the largest valid cell index in the domain.
Therefore, a comparison with <= (instead of <) is necessary
in order to check if a cell is inside the domain.
Block Geometry#
Concept |
Symbolic Functions |
C++ API |
|---|---|---|
Block Axis-Aligned Bounding Box |
|
|
Block Cell Bounding Box |
|
|
Note
block_cell_bb.[x|y|z]_max() is inclusive to the block’s cell bounding box;
to check if a cell lies inside the block, use <= as a comparison operator.
Cell Geometry#
Concept |
Symbolic Functions |
C++ API |
|---|---|---|
Cell Center Coordinates in Global Coordinate System |
|
|
Cell Center Coordinates in Block-Local Coordinate System |
|
No Equivalent |
Cell Spacing |
|
|
Cell Index in the Global Cell Grid |
|
|
Cell Index in the Block-Local Cell Grid |
|
|