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

Functions

 sha (a)
 
 packing_sdf (N, rfrac=0.18)
 
 sphere_fractions (shape, R, c, sub=4)
 
 stokes_bed (cls, N=16, steps=5, scheme=None)
 
 case_staggered_bed ()
 
 case_colocated_ghost ()
 
 case_colocated_gauge_exact ()
 
 case_colocated_plain ()
 
 case_colocated_embed ()
 
 _tg_state (N, nz, U0=1.0)
 
 case_colocated_advect ()
 
 case_colocated_advect_bc ()
 
 case_channel ()
 
 case_vof_droplet ()
 
 case_scalar ()
 
 case_porous ()
 
 case_scene_moving ()
 
 fields (s)
 
 report (name, d)
 
 case_mpi ()
 

Variables

tuple CASES
 
list want = [a for a in sys.argv[1:] if not a.startswith("-")] or list(CASES)
 

Detailed Description

Byte gate for the peclet.flow public surface: SHA-256 of the final state of one fixed-seed run
per public entry path, at one thread.

Run:  OMP_NUM_THREADS=1 OMP_PROC_BIND=false PYTHONPATH=<build> python tests/regression/state_hash.py
      OMP_NUM_THREADS=1 PYTHONPATH=<build> mpirun -np 2 python tests/regression/state_hash.py mpi

Entry paths: the staggered periodic sphere bed (set_solid, cut-cell pressure), the collocated
solver under each of its four schemes ('ghost', 'gauge-exact', 'plain', 'embed'), the collocated
ADVECTING paths -- periodic (explicit SOU/Koren) and inflow/outflow (implicit FOU + deferred
correction), the two branches that read the projected face field as the advecting velocity and the
only ones the four scheme cases above miss (they are Stokes: set_advection(False)) -- an
inflow/wall/outflow channel with advection, a VoF droplet under surface tension, Boussinesq
scalar transport, the porous (volume-averaged) continuity with implicit drag, an analytic scene
with a moving instance (set_instance_motion + set_instance_transform + rebuild_geometry), and the
distributed step at np = 2 (flow.mpi_block + init_mpi). Each prints one line: the case, the
SHA-256 over the per-field hashes, and the first 12 hex digits of each field's hash (get_u/v/w/p,
plus get_vof and the scalar where present), taken over the contiguous float64 bytes.

Every run here is reproducible run-to-run at one thread (verified 2026-09-10 on host-openmp); a
refactor of the bindings or the solver that is not meant to change numerics must reproduce every
line bitwise (QUALITY_PLAN F gate). The hashes recorded at each package-F milestone are in the
commit messages.

Function Documentation

◆ sha()

state_hash.sha (   a)

Definition at line 37 of file state_hash.py.

Referenced by report().

◆ packing_sdf()

state_hash.packing_sdf (   N,
  rfrac = 0.18 
)

Definition at line 41 of file state_hash.py.

Referenced by case_mpi(), and stokes_bed().

◆ sphere_fractions()

state_hash.sphere_fractions (   shape,
  R,
  c,
  sub = 4 
)

Definition at line 57 of file state_hash.py.

◆ stokes_bed()

state_hash.stokes_bed (   cls,
  N = 16,
  steps = 5,
  scheme = None 
)

◆ case_staggered_bed()

state_hash.case_staggered_bed ( )

Definition at line 85 of file state_hash.py.

References stokes_bed().

◆ case_colocated_ghost()

state_hash.case_colocated_ghost ( )

Definition at line 89 of file state_hash.py.

References stokes_bed().

◆ case_colocated_gauge_exact()

state_hash.case_colocated_gauge_exact ( )

Definition at line 93 of file state_hash.py.

References stokes_bed().

◆ case_colocated_plain()

state_hash.case_colocated_plain ( )

Definition at line 97 of file state_hash.py.

References stokes_bed().

◆ case_colocated_embed()

state_hash.case_colocated_embed ( )

Definition at line 101 of file state_hash.py.

References stokes_bed().

◆ _tg_state()

state_hash._tg_state (   N,
  nz,
  U0 = 1.0 
)
protected
A divergence-free (to O(h^2)) cell-centred Taylor-Green pair: a non-trivial advecting
field with no body force, so the hash reflects the advection + projection only.

Definition at line 105 of file state_hash.py.

Referenced by case_colocated_advect().

◆ case_colocated_advect()

state_hash.case_colocated_advect ( )
Collocated + advection, triply periodic: hasBc_ false, so advection is EXPLICIT (Koren in
the RHS) and the advecting velocity is the projected face field of the previous step.

Definition at line 117 of file state_hash.py.

References _tg_state().

◆ case_colocated_advect_bc()

state_hash.case_colocated_advect_bc ( )
Collocated + advection + domain BCs: hasBc_ true, so implicitAdv() holds and the IMPLICIT
FOU operator (buildAdvStencil) plus the explicit (SOU - FOU) deferred correction both read
the advecting velocity -- they must read the SAME one.

Definition at line 133 of file state_hash.py.

◆ case_channel()

state_hash.case_channel ( )

Definition at line 151 of file state_hash.py.

◆ case_vof_droplet()

state_hash.case_vof_droplet ( )

Definition at line 166 of file state_hash.py.

◆ case_scalar()

state_hash.case_scalar ( )

Definition at line 182 of file state_hash.py.

◆ case_porous()

state_hash.case_porous ( )

Definition at line 204 of file state_hash.py.

◆ case_scene_moving()

state_hash.case_scene_moving ( )

Definition at line 222 of file state_hash.py.

◆ fields()

state_hash.fields (   s)

Definition at line 244 of file state_hash.py.

Referenced by case_mpi().

◆ report()

state_hash.report (   name,
  d 
)

Definition at line 253 of file state_hash.py.

References sha().

Referenced by case_mpi().

◆ case_mpi()

state_hash.case_mpi ( )

Definition at line 261 of file state_hash.py.

References fields(), packing_sdf(), and report().

Variable Documentation

◆ CASES

tuple state_hash.CASES
Initial value:
1= ("staggered_bed", "colocated_ghost", "colocated_gauge_exact", "colocated_plain",
2 "colocated_embed", "colocated_advect", "colocated_advect_bc", "channel", "vof_droplet",
3 "scalar", "porous", "scene_moving")

Definition at line 32 of file state_hash.py.

◆ want

list state_hash.want = [a for a in sys.argv[1:] if not a.startswith("-")] or list(CASES)

Definition at line 287 of file state_hash.py.