flow 0.4.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
Loading...
Searching...
No Matches
ghost_projection_debug.hpp File Reference

flow — OPT-IN forensics for the ghost-projection overlay (PECLET_FLOW_GP_DEBUG). More...

#include <Kokkos_Core.hpp>
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <vector>
#include "ghost_projection.hpp"

Go to the source code of this file.

Namespaces

namespace  peclet
 
namespace  peclet::flow
 

Functions

int peclet::flow::gpDebugLevel ()
 0 = off (default). Read once per call; cheap enough, and keeps the flag hot-swappable in tests.
 
void peclet::flow::gpDebugReport (const GpOverlay &ov, int nRows, C3 nn, Kokkos::View< int *, CCMem > idMap, int rank=0)
 Census + optional per-row dump of the built overlay.
 

Detailed Description

flow — OPT-IN forensics for the ghost-projection overlay (PECLET_FLOW_GP_DEBUG).

Analysis-only instrumentation, in the style of PECLET_FLOW_AGMG_DEBUG: nothing here runs unless the environment variable is set, and nothing here feeds the solve. It answers phase-A2 of doc/ghost_hardening_plan.md — "is the divergence seeded by a handful of identifiable pathological rows, and which branch of the face cascade produces them?".

PECLET_FLOW_GP_DEBUG=1 print the row/face census: per-state face counts, theta histogram (incl. the EXTENDED sliver band theta in (1,2)), the row rescale rho histogram, max |closure weight| per row, and the neighbour rho-MISMATCH histogram (max_nb |log10(rho_r / rho_nb)|, the row scaling's contribution to operator asymmetry), plus the 20 worst rows by rho with their full face anatomy. PECLET_FLOW_GP_DEBUG=2 additionally dump every overlay row to PECLET_FLOW_GP_DEBUG_FILE (default gp_rows_rank<r>.bin) as fixed-width records, for offline correlation against the packing (see tests/study/ghost_projection_apriori.py –forensics).

Record layout (little-endian, one per overlay row), matching the numpy dtype in the reader: int32 x, y, z inner-grid coordinates of the row's cell float32 rho row rescale = min(1, min_f D_f) over the MATRIX weights int8 coupled 1 if the row has any phi coupling int8 state[6] face cascade state, slot k = 2*axis + (0 = plus, 1 = minus) float32 th[6] theta per face float32 wm1[6], wm2[6] matrix (implicit phi) closure weights float32 w1[6], w2[6] rhs/diagnostic closure weights

Definition in file ghost_projection_debug.hpp.