Skip to main content

Module flat_data

Module flat_data 

Source
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:

  1. Interior faces (within a block): between adjacent cells along the i, j, or k axis. These have both owner and neighbor as valid cell IDs.

  2. Cross-block faces: between cells in different blocks that share an interface (from FaceMatch data). Both owner and neighbor are valid.

  3. Boundary (outer) faces: block boundary faces that are NOT matched to another block. These have neighbor = -1 and carry a surface_id for 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§

FlatMesh
Flat mesh representation for finite-volume GPU solvers.

Functions§

build_flat_mesh
Build a flat mesh from multi-block Plot3D data.