Skip to content

Static AMR and the FV reflux register ​

CasesIssuesTypeBackendsFigureRegression
rmf-amr#13 (M1–M3), #23, #24, #28CCPU, FNLnormf-amr (digest + residuals, CPU and FNL)

Case and scope ​

The first PRISM case with a 2:1 coarse–fine face. A geometric box marker refines the x<0 half of the domain once at initialization; the run then advances on the finite-volume path, where the Berger–Colella reflux replaces the coarse flux on each 2:1 face by the sum of the fine fluxes.

The oracle is structural: it asserts that each stage of the machinery exists and is wired to the real tree, against a control run in which the marker is off.

What the case catches:

  • a refine path that does nothing: no 2:1 jump forms, or the uniform refinement alone forms one;
  • a registration pass that ignores the tree: seam faces registered without a coarse–fine adjacency, or none with one;
  • a silent reflux: no non-zero coarse/fine flux mismatch across the 2:1 face;
  • a decomposition-dependent register (#28): a face printed twice at 2 ranks, a stuck zero entry, a shifted value.

The digest golden of the case was refreshed twice, each time adjudicated, not rubber-stamped: for the reflux fixes (the face-side code of intra-realm seams, e883ff93, and the stage-weighted flux accumulation) and for the scheme-aware coil stamping (bad09954).

Models and numerics ​

ItemChoiceCode
EquationsMaxwell, SI, 4 AC rectangular coilsmodels; coils
Spacecentred finite volumes of order 6 (fv_centered)numerics
TimeSSP Runge–Kutta (5,4), CFL 0.5adam_rk_object.F90
RefinementAMR_GEO primitive-box marker, fired once at initialization (amr_iterations = 1)numerics
Seam registrationintra-realm 2:1 faces registered from the tree adjacencyregister_intra_realm_amr_seams, adam_forest_object.F90
Refluxfine fluxes accumulated per RK stage with the stage weight, applied to the coarse cellsapply_reflux_corrections, adam_forest_object.F90; apply_reflux_to_stage_forest, adam_prism_cpu_object.F90; adam_flux_register_object.F90
FNL backendthe same reflux on the deviceapply_reflux_to_stage_forest, adam_prism_fnl_object.F90

Initial and boundary conditions ​

ItemValue
Domain[−0.06,0.06]3 m
Gridoctree, 8 blocks of 163 at level 1 (323 cells, Δx=3.75⋅10−3); the blocks of x<0 refined to level 2 (Δx=1.875⋅10−3); ngc = 3
Initial conditionvacuum; the four coils carry an AC current
BoundariesNeumann on all six faces
Steps5
Controlthe same input with markers_number = 0
Ranks1 (main, control); 1 and 2 (register parity)

Input files ​

FileRole
src/tests/prism/regression/rmf-amr/input.inithe case
src/tests/prism/regression/rmf-amr/check.shruns the main, control and parity runs (--build; PRISM_EXE selects the backend)
src/tests/prism/regression/rmf-amr/golden/{cpu,fnl}/the digest run.sh compares
bash
cd src/tests/prism/regression/rmf-amr && ./check.sh                # CPU
PRISM_EXE=$PWD/../../../../../exe/adam_prism_fnl ./check.sh        # FNL

Results ​

Each leg of check.sh, as coded:

LegAssertsCPUFNL
main, healthno error/abort/NaN; the time loop reaches 100 %passpass
main, blocksnodes number > 13636
main, levelsboth level 1 and level 2 present (a 2:1 jump)1, 21, 2
main, registrationregistered intra-realm AMR seam faces > 044
main, refluxlast reflux max|F_coarse-F_fine_sum| > 01.5101.510
control, levelsno level 2passpass
control, registrationexactly 0 faces00
control, refluxno reflux line printedpasspass
parity, face countnp 1 = np 2, > 04 = 44 = 4
parity, per faceevery face printed once per step at np 2, the values string-equal to np 1pass, 4 faces × 5 stepspass, 4 faces × 5 steps

Related pages: seam div(B) runs the same grid on the FD path; FV reflux on a capped last step measures the conservation the register buys.

Findings ​

  • The box marker, not the uniform refinement, creates the 2:1 face: the control run has one level and registers no face.
  • Field digests cannot see the reflux correction at this scale, so the parity leg asserts the register content directly, face by face and step by step.
  • At 2 ranks each face is printed once per step, by its coarse-owner rank, with the values of the 1-rank run. The block groups are rank-complete at this decomposition, so the cross-rank reduction adds exact zeros and string equality is the intended strength.