Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b638175
src: hoist shared equation-index core into m_global_parameters_common
sbryngelson Jun 10, 2026
1400c2b
src: share parallel-io setup and finalize core across executables
sbryngelson Jun 10, 2026
ec39da8
src: fix Task-1 hoist review findings
sbryngelson Jun 10, 2026
d50e68d
src: pass nb into s_initialize_eqn_idx
sbryngelson Jun 10, 2026
33e1d9c
codegen: generate MPI broadcast lists from the parameter registry
sbryngelson Jun 10, 2026
dd2025e
src: share common default-value assignments across executables
sbryngelson Jun 10, 2026
dd61fbe
docs: document the shared global-parameters core and generated broadc…
sbryngelson Jun 10, 2026
68d8a07
src: keep boundary-condition defaults per-target
sbryngelson Jun 10, 2026
5821cee
build: split CMakeLists into cmake/ modules
sbryngelson Jun 10, 2026
b6a0672
build: make the ninja custom command the sole generator of params inc…
sbryngelson Jun 10, 2026
50b24e6
build: prefix config-hash directories with a readable slug
sbryngelson Jun 10, 2026
5e25232
docs: document the build-system layer contract
sbryngelson Jun 10, 2026
4b4ea36
docs: align generation-timing wording with the build-time mechanism
sbryngelson Jun 10, 2026
6ce3ea5
codegen: broadcast the Herschel-Bulkley fluid_pp members
sbryngelson Jun 11, 2026
3b6f432
src: restore the interface-compression section heading in m_constants
sbryngelson Jun 11, 2026
2843964
toolchain: validate patch_ib against the namelist array bound; refres…
sbryngelson Jun 11, 2026
debf14b
style: format the broadcast generator
sbryngelson Jun 11, 2026
eafc652
src: move GPU_DECLAREs for hoisted state into m_global_parameters_common
sbryngelson Jun 11, 2026
786dd1e
toolchain: deregister parameters removed from the derived types
sbryngelson Jun 10, 2026
322d7d2
src: broadcast wall-velocity BC members in pre and post
sbryngelson Jun 10, 2026
782cfb6
codegen: broadcast muscl_eps and walk the registry for struct broadcasts
sbryngelson Jun 10, 2026
8eb6e18
src: broadcast BC type codes with MPI_INTEGER in pre_process; pin res…
sbryngelson Jun 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 22 additions & 10 deletions .claude/rules/common-pitfalls.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ covered in `docs/documentation/contributing.md`.
bubbles and IB. Read that routine for the current value rather than assuming one.
- Riemann solvers: left state at `j`, right state at `j+1`.
- All equation indices live in the `eqn_idx` struct (`eqn_idx_info` in
`m_derived_types.fpp`, populated in `m_global_parameters.fpp`): `%cont`, `%mom`, `%E`,
`m_derived_types.fpp`, populated by `s_initialize_eqn_idx` in `m_global_parameters_common.fpp`): `%cont`, `%mom`, `%E`,
`%adv`, plus optional ranges (`%bub`, `%stress`, `%species`, `%B`, ...). The old
`contxb`/`momxb` shorthands are gone. Index positions depend on `model_eqns` and
enabled features — changing either moves ALL indices; never hard-code one.
Expand Down Expand Up @@ -42,21 +42,33 @@ covered in `docs/documentation/contributing.md`.
- Adding one: `_r()` definition + `_nv()` `NAMELIST_VARS` registration in
`toolchain/mfc/params/definitions.py`; `case_validator.py` only if physics-constrained
(with a `PHYSICS_DOCS` entry). Fortran declarations and namelist bindings are
auto-generated at CMake configure time — re-run cmake (or `./mfc.sh build`) after editing.
auto-generated at build time (ninja-tracked custom command) — re-run cmake (or `./mfc.sh build`) after editing.
- Still manual: derived-type `TYPE` member definitions in `src/common/m_derived_types.fpp`;
default-value assignments in `s_assign_default_values_to_user_inputs`; the
`CASE_OPT_EXTRA_LINES` literal in `toolchain/mfc/params/generators/fortran_gen.py` (covers `num_dims`,
`num_vels`, `weno_polyn`, `muscl_polyn`, `weno_num_stencils`, `wenojs`);
multi-variable declaration lines (`bc_x/y/z`, `x/y/z_domain`, `x/y/z_output`, post's
`G`); and MPI broadcast lists in `m_mpi_proxy`. Everything else — scalar declarations,
plain arrays (`FORTRAN_ARRAY_DIMS` table in `definitions.py`), derived-type namelist
declarations including `GPU_DECLARE` lines and Doxygen descs (`TYPED_DECLS` table in
`definitions.py`), and the simulation case-optimization declaration block — is
auto-generated at CMake configure time.
Gotcha: after editing a generator or table, force regen via `cmake_gen.py` into
`build/staging/*/` or simply reconfigure (`./mfc.sh build`) — cached builds compile
stale includes. Under `--case-optimization` the baked-in constants are dropped from the
`G`); and the MPI broadcast residue in `m_mpi_proxy` (computed variables that are not
namelist-bound: `m_glb`/`n_glb`/`p_glb`, `cfl_dt`, `bc_io`, and complex struct-member
array loops — these cannot be auto-generated and stay hand-listed). Everything else — scalar declarations, plain arrays (`FORTRAN_ARRAY_DIMS`
table in `definitions.py`), derived-type namelist declarations including `GPU_DECLARE`
lines and Doxygen descs (`TYPED_DECLS` table in `definitions.py`), the simulation
case-optimization declaration block, and the per-target MPI broadcast lists for all
namelist-registry scalars (`generated_bcast.fpp`) — is regenerated at build time by a
ninja-tracked custom command (editing `params/*.py` triggers regeneration automatically).
Gotcha: ADDING a new file under `toolchain/mfc/params/` needs one reconfigure
(the custom command's DEPENDS list is globbed at configure time). Under `--case-optimization` the baked-in constants are dropped from the
namelist, so changing one needs a *rebuild*, not a case edit.
- Shared-state pattern: namelist declarations (`#:include 'generated_decls.fpp'`), the
`eqn_idx`/`sys_size`/`b_size`/`tensor_size` state variables, and the common defaults
core all live in `src/common/m_global_parameters_common.fpp`. Each per-target
`m_global_parameters.fpp` does `use m_global_parameters_common` (default-public), so
`use m_global_parameters` continues to work for all downstream modules without change.
Sim-only declarations (GPU_DECLARE, Re_idx allocation) stay in
`m_global_parameters_common` behind `#ifdef MFC_SIMULATION`. Generated includes
(`generated_decls.fpp`, `generated_bcast.fpp`, `generated_case_opt_decls.fpp`) must exist for every target — the build
emits stubs where the content is sim-only, so a common file that includes one will
compile for pre/post too.
- Runtime checks (`@:PROHIBIT`) go where they run: shared →
`src/common/m_checker_common.fpp`; simulation-only → `src/simulation/m_checker.fpp`;
pre/post-only → `src/{pre,post}_process/m_checker.fpp` (their `s_check_inputs` are
Expand Down
Loading
Loading