Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
5880a0c
src: use named constants for the remaining enumerated vocabularies
sbryngelson Jun 10, 2026
4799e79
codegen: emit derived-type namelist declarations in generated_decls
sbryngelson Jun 10, 2026
d7cd189
src: derived-type namelist declarations come from generated_decls
sbryngelson Jun 10, 2026
e587d74
docs: update parameter-pipeline documentation
sbryngelson Jun 10, 2026
7d38a8c
codegen: generate the case-optimization declaration block
sbryngelson Jun 10, 2026
31775d1
toolchain: accept registry value names and intrinsics in doc lint
sbryngelson Jun 10, 2026
fa9ada6
build: regenerate params includes at build time via custom command
sbryngelson Jun 10, 2026
12dfa2a
src: retire legacy WENO_TYPE and MUSCL_TYPE constants
sbryngelson Jun 10, 2026
723e92a
src: hoist shared equation-index core into m_global_parameters_common
sbryngelson Jun 10, 2026
0aef407
src: share parallel-io setup and finalize core across executables
sbryngelson Jun 10, 2026
1bd8d2b
src: fix Task-1 hoist review findings
sbryngelson Jun 10, 2026
e38302d
src: pass nb into s_initialize_eqn_idx
sbryngelson Jun 10, 2026
08e48bf
codegen: generate MPI broadcast lists from the parameter registry
sbryngelson Jun 10, 2026
42f052b
src: share common default-value assignments across executables
sbryngelson Jun 10, 2026
41d2b54
docs: document the shared global-parameters core and generated broadc…
sbryngelson Jun 10, 2026
c3e896b
src: keep boundary-condition defaults per-target
sbryngelson Jun 10, 2026
6bd6fa5
build: split CMakeLists into cmake/ modules
sbryngelson Jun 10, 2026
845f03d
build: make the ninja custom command the sole generator of params inc…
sbryngelson Jun 10, 2026
5d7a4aa
build: prefix config-hash directories with a readable slug
sbryngelson Jun 10, 2026
b9124ca
docs: document the build-system layer contract
sbryngelson Jun 10, 2026
525e0bd
docs: align generation-timing wording with the build-time mechanism
sbryngelson Jun 10, 2026
e4bb56a
codegen: broadcast the Herschel-Bulkley fluid_pp members
sbryngelson Jun 11, 2026
dac3d1f
src: restore the interface-compression section heading in m_constants
sbryngelson Jun 11, 2026
f42e532
toolchain: validate patch_ib against the namelist array bound; refres…
sbryngelson Jun 11, 2026
c3d16b6
style: format the broadcast generator
sbryngelson Jun 11, 2026
636ee91
Merge branch 'master' into executable-dedup
sbryngelson Jun 11, 2026
eaf67d2
src: move GPU_DECLAREs for hoisted state into m_global_parameters_common
sbryngelson Jun 11, 2026
16c08fb
toolchain: deregister parameters removed from the derived types
sbryngelson Jun 10, 2026
8bc1f83
src: broadcast wall-velocity BC members in pre and post
sbryngelson Jun 10, 2026
e436031
codegen: broadcast muscl_eps and walk the registry for struct broadcasts
sbryngelson Jun 10, 2026
1d2f9ba
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
39 changes: 31 additions & 8 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,17 +42,40 @@ 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.
- Still manual: array variables and derived-type members (declare in
`src/*/m_global_parameters.fpp` / the relevant type), and case-optimization parameters
(`CASE_OPT_PARAMS` + the `#:else` block in `src/simulation/m_global_parameters.fpp`).
Gotcha: under `--case-optimization` those are baked into the binary and dropped from
the namelist, so changing one needs a *rebuild*, not a case edit.
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 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
currently empty — that IS the right place, not m_checker_common).
- Analytic ICs are compiled into the binary (syntax error = build failure, not runtime).
- Analytic ICs are compiled into the binary. Expressions are AST-validated at case load
(syntax errors and unknown variables are immediate, named errors; bare `e` is not a
variable — write `exp(1.0)`).
Each IC variable maps to an `eqn_idx%…` expression in `QPVF_IDX_VARS`
(`toolchain/mfc/case.py`); a new patch-settable conserved variable means updating that
map AND the Fortran `eqn_idx` builder to agree — a mismatch is a silent wrong index.
Expand Down
Loading
Loading