Expand description
Flat SoA (Structure of Arrays) mesh representation for GPU finite-volume solvers.
Multi-block structured grids store data in per-block (i,j,k) arrays with pointer-based block lookups. This is efficient for CPU codes but hostile to GPU architectures that need coalesced memory access across thousands of threads.
This module converts a multi-block Plot3D grid into a flat, unstructured-like representation where:
- Every cell has a single global integer ID (no block/i/j/k tuple).
- Every face has an owner cell and a neighbor cell (or -1 for boundaries).
- All geometric data (volumes, area vectors, centers) are contiguous arrays.
- No pointer dereferences are needed – every access is
array[id].
§Face Convention
Faces are categorized into three types:
-
Interior faces (within a block): between adjacent cells along the i, j, or k axis. These have both
ownerandneighboras valid cell IDs. -
Cross-block faces: between cells in different blocks that share an interface (from
FaceMatchdata). Bothownerandneighborare valid. -
Boundary (outer) faces: block boundary faces that are NOT matched to another block. These have
neighbor = -1and carry asurface_idfor boundary condition assignment.
The face area vector points from the owner cell toward the neighbor cell (or outward for boundary faces), consistent with finite-volume flux conventions.
Structs§
- Flat
Mesh - Flat mesh representation for finite-volume GPU solvers.
Functions§
- build_
flat_ mesh - Build a flat mesh from multi-block Plot3D data.