flow 1.3.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
Loading...
Searching...
No Matches
scalar_cutcell_backends Namespace Reference

Functions

 g9_bounds (D, n)
 
 rows (g)
 
 dump (path, only=None)
 
 rel (a, b, mask=None)
 
 compare (pa, pb, pc=None)
 

Variables

 HERE = os.path.dirname(os.path.abspath(__file__))
 
tuple GEOM_CELL = ("kappa", "aperture_x", "aperture_y", "aperture_z", "kappa_solid")
 
tuple EXACT_CELL = ("unknown", "solid_unknown")
 
tuple GEOM_FACET = ("centroid", "normal", "area")
 
tuple EXACT_FACET = ("instance", "probe_rung")
 
tuple SOL_FACET = ("flux", "wall_value")
 
tuple G9_STATS = ("ident", "cons", "min", "max", "cmax0", "finite")
 

Detailed Description

§11 G11 (WO-9): the cut-cell scalar on two Kokkos backends, CUDA against OpenMP.

Not a ctest: it needs two build trees. Run the same rows on each tree, then compare:

  OMP_NUM_THREADS=4 PYTHONPATH=build_dev  python tests/python/scalar_cutcell_backends.py dump omp.npz
                    PYTHONPATH=build_cuda python tests/python/scalar_cutcell_backends.py dump gpu.npz
  python tests/python/scalar_cutcell_backends.py compare omp.npz gpu.npz [omp_1thread.npz]

The optional third dump (the reference build at another OMP_NUM_THREADS) prints the reference
backend's own reproducibility floor beside the cross-backend difference (column 'floor').

The rows are the gate cases of tests/python/test_scalar_cutcell_gates.py, called unchanged (their
solver is captured by a recording subclass that logs every solve's BiCGStab count):

  g1_<Rh>          G1 Dirichlet sphere, steady (single phase), R/h 8 / 16 / 32
  g6c1_<Rh>        G6 case 1 (conjugate composite sphere, 30 BE steps), R/h 8 / 16
  g9_<scheme>_<Rh>[_c09] G9 annulus advection (transient, explicit/implicit faces, small cells),
                   one revolution at bulk Courant 0.5 (0.9), fou / koren, R_o/h 16 / 32
  gadva_<pe>       G-adv(a) (steady advective, A2 surrogate), R/h 16, Pe_h 1 / 10
  gadvb_<wall>_<pe> G-adv(b) closure (Neumann: mean-gradient mode, singular) and (b') Dirichlet,
                   32^3, Pe_h 1 / 10

G11 (doc/scalar_ibm_design.md §11): geometry fields <= 1e-12 relative; probe rungs identical;
solutions <= 1e-9 relative; iterations within +-1 per solve. "Relative" = the max-norm difference
over the max-norm of the reference array (solutions: over the unknowns of the reference).
The koren rows of G9 (ruling D-WO9-1, §11 G11 as restated): solution <= 1e-7 relative, and G9's
own integral bounds (budget identity, conservation, positivity, finite) met on BOTH dumps. Their
pointwise difference is reduction-order noise inside the Krylov tolerance that the koren update
does not damp (doc/scalar_ibm_log.md, WO-9b Q-N); no backend tolerance holds it at 1e-9.
Exit 0 pass, 1 fail, 77 skipped (no module).

Function Documentation

◆ g9_bounds()

scalar_cutcell_backends.g9_bounds (   D,
  n 
)
G9 (i)-(iv) on one dump's row n, as test_scalar_cutcell_gates.gate_g9 gates them (koren's
(iii) only at bulk Courant 1/2, ruling D-WO5-1; the rtol-1e-13 drift clause is not a G11 row).

Definition at line 49 of file scalar_cutcell_backends.py.

Referenced by compare().

◆ rows()

scalar_cutcell_backends.rows (   g)
name -> thunk; each thunk runs one gate case of the gates module `g`.

Definition at line 62 of file scalar_cutcell_backends.py.

Referenced by dump().

◆ dump()

scalar_cutcell_backends.dump (   path,
  only = None 
)

Definition at line 81 of file scalar_cutcell_backends.py.

References rows(), and run().

Referenced by compare().

◆ rel()

scalar_cutcell_backends.rel (   a,
  b,
  mask = None 
)

Definition at line 147 of file scalar_cutcell_backends.py.

Referenced by compare().

◆ compare()

scalar_cutcell_backends.compare (   pa,
  pb,
  pc = None 
)

Definition at line 162 of file scalar_cutcell_backends.py.

References compare(), dump(), g9_bounds(), and rel().

Referenced by compare().

Variable Documentation

◆ HERE

scalar_cutcell_backends.HERE = os.path.dirname(os.path.abspath(__file__))

Definition at line 39 of file scalar_cutcell_backends.py.

◆ GEOM_CELL

tuple scalar_cutcell_backends.GEOM_CELL = ("kappa", "aperture_x", "aperture_y", "aperture_z", "kappa_solid")

Definition at line 41 of file scalar_cutcell_backends.py.

◆ EXACT_CELL

tuple scalar_cutcell_backends.EXACT_CELL = ("unknown", "solid_unknown")

Definition at line 42 of file scalar_cutcell_backends.py.

◆ GEOM_FACET

tuple scalar_cutcell_backends.GEOM_FACET = ("centroid", "normal", "area")

Definition at line 43 of file scalar_cutcell_backends.py.

◆ EXACT_FACET

tuple scalar_cutcell_backends.EXACT_FACET = ("instance", "probe_rung")

Definition at line 44 of file scalar_cutcell_backends.py.

◆ SOL_FACET

tuple scalar_cutcell_backends.SOL_FACET = ("flux", "wall_value")

Definition at line 45 of file scalar_cutcell_backends.py.

◆ G9_STATS

tuple scalar_cutcell_backends.G9_STATS = ("ident", "cons", "min", "max", "cmax0", "finite")

Definition at line 46 of file scalar_cutcell_backends.py.