Appearance
Self-gravity under runtime AMR
| ID | Group | Milestone | Backends | Figure | Regression |
|---|---|---|---|---|---|
| SV-11 | Self-gravity | M8 (#81), P5c | CPU, FNL | yes | — |
Case and scope
Under runtime AMR the grid, and with it the solver, change during the run. Every regrid must:
- set up the right solver: the FFT on a uniform grid, the multigrid on an AMR one;
- solve
from the regridded state; - rebuild the flux register the seam gravity work rides on.
What changes and what does not. The regrid itself conserves
What the case catches:
- a regrid that keeps the old solver or the old potential: the step changes of
between regrids leave the time-integration level; - a jump of
off a regrid step (a leak that is not the change of the discrete ); - a momentum or mass leak through the regrid.
Isolated boundaries under runtime AMR, refused here until #87, are verified with the polytrope (SV-14), with the refusal of a regrid that refines a boundary block.
Models and numerics
| Item | Choice | Code |
|---|---|---|
| Equations | compressible Euler, | models |
| Regrid | every 5 steps ([amr] frequency = 5), one level above the base, a Löhner estimator on the density (mode 4): refine above 0.3, derefine below 0.1 | regrid_forest, adam_flume_cpu_object.F90, adam_flume_fnl_object.F90; numerics |
| Solver after a regrid | set_potential sets the solver up on the new grid (FFT if the leaves are at one level, multigrid otherwise) and solves | set_potential, adam_flume_common_object.F90; refresh_potential, adam_flume_fnl_object.F90 |
| Seam gravity work | in the per-stage reflux | add_seam_gravity_work, adam_flume_common_object.F90; reflux_stage, adam_flume_cpu_object.F90 |
| Space, time | WENO5 flux splitting (weno), SSP-RK3, CFL 0.4 | numerics |
Initial and boundary conditions
| Item | Value |
|---|---|
| Case | jeansc2d: the collapse of SV-4, sine-wave, wave_mode = jeans) |
| Grid | base |
| Boundaries | every active face periodic |
| Reflux | per stage (reflux_cadence = stage) |
| Ranks | 2 |
| End |
Input files
| File | Role |
|---|---|
src/tests/flume/verification/selfgravity/make_jeans.py | --regrid N writes the Löhner marker and [amr] frequency |
src/tests/flume/verification/selfgravity/jeans.sh | leg sv11 (FLUME_EXE selects the backend) |
src/tests/flume/verification/selfgravity/jeans_oracle.py | regrid: the grid must change; every jump of |
src/tests/flume/verification/make_doc_runs.sh, group amr | sv11-regrid, a checkpoint every 10 steps |
src/tests/flume/verification/make_doc_figures.py, fig_selfgravity_amr_regrid | draws the figure (--only selfgravity-amr-regrid) |
bash
cd src/tests/flume/verification/selfgravity && ./jeans.sh --legs sv11 # CPU
FLUME_EXE=$PWD/../../../../../exe/adam_flume_fnl_fft ./jeans.sh --legs sv11 # FNLResults

Left:
| Asserted | Bound | CPU | FNL (WSL GPU) |
|---|---|---|---|
| the grid changes (blocks of the first and the last checkpoint) | must differ | 16 → 52 | 16 → 52 |
| every jump of | yes | one jump, at step 60: | the same, |
| the largest other step change of | |||
| max |
Related cases: the same collapse on a static AMR grid is SV-10, on a uniform grid SV-4; runtime regridding without gravity is runtime regrids.
Findings
- The regrid jump is the change of the discrete
. At the regrid is unchanged and moves by of itself, the size of the truncation at . It does not converge in a resolution ladder, because the refinement happens at different stages of the collapse (at base the ridge crosses the threshold later, when it is sharper). The jumps are reported, not bounded. - Correcting
at each regrid would make the regrid conserve ; it is not done. - The solver follows the grid. With refine and derefine thresholds of 0.1 and 0.03 the same collapse refines everywhere by
, so the grid becomes uniform again and the FFT solver takes over. That run passes the same oracle, with jumps at steps 40 and 50. - No regression case freezes self-gravity under runtime AMR;
selfgravity-amr-stagecovers the per-stage reflux on a static grid.