Skip to content

Commit 890bc9d

Browse files
committed
docs: replace volatile counts/formulas with pointers to source of truth
1 parent b3730a7 commit 890bc9d

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

.claude/rules/common-pitfalls.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
- Grid dimensions: `m`, `n`, `p` (cells in x, y, z). 1D: n=p=0. 2D: p=0.
55
- Interior domain: `0:m`, `0:n`, `0:p`
66
- Buffer/ghost region: `-buff_size:m+buff_size` (similar for n, p in multi-D)
7-
- `buff_size` is set per reconstruction scheme in `s_configure_coordinate_bounds` (`m_helper_basic.fpp`):
8-
WENO `weno_polyn + 2` (`2*weno_polyn + 2` if `viscous`), MUSCL `muscl_polyn + 2`, IGR `(igr_order-1)/2 + 2`;
9-
then floored to `max(.,6)` with Lagrange bubbles and `max(.,10)` with IB. Don't assume `2*weno_polyn + 2`.
7+
- `buff_size` is **not** a single formula: it's set per reconstruction scheme (WENO/MUSCL/IGR) in
8+
`s_configure_coordinate_bounds` (`m_helper_basic.fpp`) and floored higher for Lagrange bubbles and IB.
9+
Read that routine for the current value rather than assuming one.
1010
- Domain bounds: `idwint(1:3)` (interior `0:m`), `idwbuff(1:3)` (with ghost cells)
1111
- Cell-center coords: `x_cc(-buff_size:m+buff_size)`, `y_cc(...)`, `z_cc(...)`
1212
- Cell-boundary coords: `x_cb(-1-buff_size:m+buff_size)`

.claude/rules/gpu-and-mpi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Full set with signatures in `parallel_macros.fpp`. The ones you reach for most:
3333
Others in `parallel_macros.fpp`: `GPU_ENTER_DATA`/`GPU_EXIT_DATA`, `GPU_DECLARE`, `GPU_ROUTINE`,
3434
`GPU_ATOMIC`, `GPU_WAIT`, and the block macros `GPU_DATA`, `GPU_HOST_DATA`.
3535

36-
Typical GPU loop pattern (used 750+ times in the codebase):
36+
Typical GPU loop pattern (the dominant spatial-loop idiom):
3737
```
3838
$:GPU_PARALLEL_LOOP(private='[i,j,k,l]', collapse=3)
3939
do l = idwbuff(3)%beg, idwbuff(3)%end

.claude/rules/parameter-system.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Parameter System
22

33
## Overview
4-
MFC has ~3,400 simulation parameters defined in Python and read by Fortran via namelist files.
4+
MFC's simulation parameters are defined in Python and read by Fortran via namelist files.
55

66
## Parameter Flow: Python → Fortran
77

CLAUDE.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ Run `./mfc.sh <command> --help` for the full flag set; the most-used invocations
2929
./mfc.sh build -j 8 # all 3 targets; flags: -t <target>, --gpu acc|mp, --debug,
3030
# -i case.py --case-optimization (10x speedup)
3131
./mfc.sh run case.py -n 4 # run with 4 MPI ranks; --no-build; -e batch (toolchain/templates/)
32-
./mfc.sh test -j 8 # full suite (560+); --only <1D|Bubbles|UUID>, -l, -% N (sample),
32+
./mfc.sh test -j 8 # full suite; --only <1D|Bubbles|UUID>, -l, -% N (sample),
3333
# --generate (regenerate golden files after an intended output change)
3434

3535
# Verify before committing
36-
./mfc.sh precheck -j 8 # all 7 CI lint checks
36+
./mfc.sh precheck -j 8 # all CI lint checks
3737
./mfc.sh format -j 8 # auto-format Fortran (.fpp/.f90) + Python
3838
./mfc.sh lint # ruff lint + Python unit tests (spelling: ./mfc.sh spelling)
3939

4040
# Case files
4141
./mfc.sh validate case.py # validate without running
42-
./mfc.sh params <query> # search 3,400 case parameters
42+
./mfc.sh params <query> # search case parameters
4343
./mfc.sh new <name> # new case from template (clean: ./mfc.sh clean)
4444
```
4545

@@ -66,7 +66,7 @@ IMPORTANT: Follow this loop for ALL code changes. Do not skip steps.
6666
2. **Plan** — For multi-file changes, outline your approach before implementing.
6767
3. **Implement** — Make small, focused changes. One logical change per commit.
6868
4. **Format** — Run `./mfc.sh format -j 8` to auto-format.
69-
5. **Verify** — Run `./mfc.sh precheck -j 8` (same 7 checks as CI lint gate).
69+
5. **Verify** — Run `./mfc.sh precheck -j 8` (same checks as the CI lint gate).
7070
6. **Build** — Run `./mfc.sh build -j 8` to verify compilation.
7171
7. **Test** — Run relevant tests: `./mfc.sh test --only <feature> -j 8`.
7272
For changes to `src/common/`, test ALL three targets: `./mfc.sh test -j 8`.
@@ -86,11 +86,11 @@ src/
8686
simulation/ # CFD solver (GPU-accelerated via OpenACC / OpenMP target offload)
8787
post_process/ # Data output and visualization
8888
toolchain/ # Python CLI, build system, testing, parameter management
89-
mfc/params/definitions.py # ~3,400 parameter definitions (source of truth)
89+
mfc/params/definitions.py # parameter definitions (source of truth)
9090
mfc/case_validator.py # Physics constraint validation
9191
mfc/test/ # Test runner and case generation
9292
examples/ # Example simulation cases (case.py files)
93-
tests/ # 560+ regression test golden files
93+
tests/ # regression test golden files
9494
```
9595

9696
Source files are `.fpp` (Fortran + Fypp macros), preprocessed to `.f90` by CMake.

0 commit comments

Comments
 (0)