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

Functions

bool is_comment_line (str line)
 
int main ()
 

Variables

str SRC = pathlib.Path(__file__).resolve().parents[2] / "src"
 
 CAST = re.compile(r"\(\s*float\s*\‍)|static_cast\s*<\s*float\s*>|View<\s*float\s*\*")
 
dict FILE_EXEMPT
 

Detailed Description

QUALITY_PLAN G.6 guard: no operator-storage view narrows to `float` outside the allow-list.

`MReal` (`mac_cutcell_mg.hpp`) is the operator storage type -- float unless the build defines
`-DPECLET_FLOW_OPERATOR_DOUBLE` (an `option()` since G.6, was a raw, untested `-DCMAKE_CXX_FLAGS`).
G.6 templated `IbmOverlayT`/`ibmFillEntry`/`ibmModifyStencil` (cut_cell_ibm.hpp) and the geometry
build that feeds them (mac_ibm.hpp, flow_ibm.hpp) on `Real`/`mreal` so a double build carries the
cut-cell overlay in double end to end; this test fails if a NEW hard `(float)` cast or `float`-typed
operator view creeps back in outside the allow-list below, so the next one has to be typed on
`mreal`/`MReal` (or exempted with a stated reason) instead.

A hit is IGNORED when: the line is a pure comment (only prose, no code -- these mention "(float)" in
plain English and are not casts); the whole FILE is allow-listed (an opt-in debug/forensics file
whose float precision is unrelated to operator correctness, or a file whose ghost-projection overlay
is a stated, deferred gap -- see the reasons below); or the line carries a `PRECISION-EXEMPT:`
marker (a deliberate, reasoned exception -- `git grep PRECISION-EXEMPT src/` to read them).

Function Documentation

◆ is_comment_line()

bool test_no_float_operator_casts.is_comment_line ( str  line)

Definition at line 36 of file test_no_float_operator_casts.py.

Referenced by main().

◆ main()

int test_no_float_operator_casts.main ( )

Definition at line 41 of file test_no_float_operator_casts.py.

References is_comment_line(), and main().

Referenced by main().

Variable Documentation

◆ SRC

str test_no_float_operator_casts.SRC = pathlib.Path(__file__).resolve().parents[2] / "src"

Definition at line 22 of file test_no_float_operator_casts.py.

◆ CAST

test_no_float_operator_casts.CAST = re.compile(r"\(\s*float\s*\‍)|static_cast\s*<\s*float\s*>|View<\s*float\s*\*")

Definition at line 24 of file test_no_float_operator_casts.py.

◆ FILE_EXEMPT

dict test_no_float_operator_casts.FILE_EXEMPT
Initial value:
1= {
2 "ghost_projection_debug.hpp": (
3 "opt-in forensics (PECLET_FLOW_GP_DEBUG); never feeds a solve, precision is unrelated to "
4 "correctness"
5 ),
6}

Definition at line 28 of file test_no_float_operator_casts.py.