zoomy_foam._constants

zoomy_foam._constants#

Emit zoomy_core’s march constants into a C++ header (mandate 6a).

The user law: no numerical constant is hard-coded in a backend. Foam had inherited a MOOD dead band h < -1.0e-10 verbatim from the dmplex port, while core (solver_numpy.py) and amrex (ZoomyAmr.cpp, !(h >= 0.0)) detect on strict zero. Core now RESOLVES that bound as an emitted constant (zoomy_core.solver.constants.march_constants), so foam reads it from there instead of restating a number.

SCOPE, stated plainly: only the MOOD pair is emitted today. march_constants also resolves c_cfl / c_kp_eps / c_eps_h / c_dt_max, and those sites in numerics.H are still literal — that is a REPORTED remainder of mandate 6a on this backend, not a claim that it is finished here.

The generated header is the ONE place a float literal is allowed to appear: it is the constexpr that DEFINES the named value, which is exactly what “the constants are emitted” means. Every comparison site uses the name.

Module Contents#

Functions#

march_constants_for

Resolve core’s march constants for nsm. Thin, deliberate wrapper: the resolution logic lives in core and is never re-implemented here.

render

Render the consumed constants as a namespace Model header.

write_march_constants

Emit MarchConstants.H next to the other generated headers.

Data#

API#

zoomy_foam._constants.CONSUMED#

(‘c_mood_h_bound’, ‘c_mood_require_finite’)

zoomy_foam._constants.march_constants_for(nsm, *, cfl: float = 0.9, dimension: int = 1, degree: int = 1)#

Resolve core’s march constants for nsm. Thin, deliberate wrapper: the resolution logic lives in core and is never re-implemented here.

zoomy_foam._constants.render(consts) → str#

Render the consumed constants as a namespace Model header.

zoomy_foam._constants.write_march_constants(nsm, out: pathlib.Path, **kw) → pathlib.Path#

Emit MarchConstants.H next to the other generated headers.