Skip to content

Commit 4093d68

Browse files
Consolidate wave tests: fold correctness tests into convergence binaries (#1978)
### Description This PR implements the proposal in #1916: each of the five wave convergence binaries now supports a dual-mode `problem_main()`, controlled by two TOML flags, `setup.run_convergence` (default `true`) and `setup.run_sim` (default `false`). The four standalone correctness binaries (FastWave, SlowWave, AlfvenWaveLinear, HydroWave) are deleted; their CTets are re-registered against the corresponding convergence binary with identical test names and labels, so CI coverage is unchanged. **Dual-mode design.** The two flags are independent: both can be `true` simultaneously, in which case the exit status is OR'd. The default (`run_convergence=true, run_sim=false`) means that bare invocations (including the existing convergence CTets, which pass no `run_sim` flag) are entirely backward compatible. The correctness TOMLs (FastWave.toml, SlowWave.toml, AlfvenWaveLinear.toml, HydroWave.toml, HydroWaveFc.toml) each get `setup.run_convergence=false` and `setup.run_sim=true`, turning the correctness path on and the convergence path off. **Correctness path.** The `run_sim` block reads wave geometry from the TOML (`setup.num_modes_*`, `setup.angle_between_k_b0`), sets the GPU-managed globals used by the IC kernel, constructs periodic BCs explicitly, creates and evolves the simulation, then checks the error. For the four MHD tests this is `sim.computeErrorNorm() < setup.error_tol`; for HydroWave it is the fextract-based L1 norm that the old standalone binary used. FastWave.toml gains the wave geometry params that the old binary hardcoded (theta=90 deg, one x-mode); HydroWave.toml gains `stop_time=1.0` and `max_timesteps=20000` that the old binary hardcoded; HydroWaveFc.toml gains `cfl=0.1` because the old binary hardcoded `sim.cflNumber_=0.1` and without it the one-step error at the default CFL=0.3 marginally exceeds the 1e-8 tolerance. **Convergence path.** The Richardson block is the old `problem_main()` content, with one addition: `pp.query("nx_start", params.nx_initial)` exposes the initial resolution as a TOML-overridable parameter alongside the existing `setup.nx_max`. I ran all binaries locally in both modes before opening this PR: all ten test invocations (five binaries x two modes) pass. ### Related issues - #1916: this PR implements the proposal described there. - #1959: this PR was enabled by it; the N-dim Richardson extension was a prerequisite for the dual-mode design to work correctly across 1D/2D/3D setups. ### Checklist - [x] I have added a description (see above). - [x] I have added a link to any related issues (if applicable; see above). - [x] I have read the [Contributing Guide](https://github.com/quokka-astro/quokka/blob/development/CONTRIBUTING.md). - [ ] I have added tests for any new physics that this PR adds to the code. - [x] *(For quokka-astro org members)* I have manually triggered the GPU tests with the magic comment `/azp run`. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 5655af2 commit 4093d68

28 files changed

Lines changed: 602 additions & 1560 deletions

.github/workflows/mhd.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,12 @@ jobs:
9999
working-directory: ${{github.workspace}}/tests
100100
shell: bash
101101
run: |
102-
${{runner.workspace}}/build/src/problems/FastWave/FastWave \
102+
${{runner.workspace}}/build/src/problems/FastWaveConvergence/FastWaveConvergence \
103103
../inputs/FastWave.toml \
104104
amr.max_grid_size_x=32 \
105105
amr.blocking_factor_x=16 \
106106
mhd.emf_compute_scheme=FelkerStone2017 \
107+
mhd.emf_averaging_scheme=LondrilloDelZanna2004 \
107108
amrex.init_snan=1 \
108109
amrex.fpe_trap_invalid=1 \
109110
amrex.fpe_trap_overflow=1 \
@@ -113,7 +114,7 @@ jobs:
113114
- name: Test
114115
working-directory: ${{runner.workspace}}/build
115116
shell: bash
116-
# Execute the MHD tests while skipping the slow HydroWave case
117+
# Execute the MHD tests while skipping the slow HydroWaveConvergence case
117118
run: canary run --output-on-failure --workers=2 -k 'MHD and not HydroWaveConvergence' .
118119

119120
- name: ccache stats

inputs/AlfvenWaveLinear.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ hydro.rk_integrator_order = 2
3434
hydro.reconstruction_order = 5
3535
hydro.use_dual_energy = 0
3636

37+
setup.run_convergence = false
38+
setup.run_sim = true
39+
setup.error_tol = 0.005
3740
setup.num_modes_x = 1
3841
setup.num_modes_y = 0
3942
setup.num_modes_z = 0

inputs/EntropyWave.toml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# *****************************************************************
2+
# Problem size and geometry
3+
# *****************************************************************
4+
geometry.prob_lo = [0.0, 0.0, 0.0]
5+
geometry.prob_hi = [1.0, 1.0, 1.0]
6+
geometry.is_periodic = [1, 1, 1]
7+
8+
# *****************************************************************
9+
# VERBOSITY
10+
# *****************************************************************
11+
amr.v = 0 # verbosity in Amr
12+
13+
# *****************************************************************
14+
# Resolution and refinement
15+
# *****************************************************************
16+
amr.n_cell = [128, 8, 8]
17+
amr.max_level = 0 # number of levels = max_level + 1
18+
amr.blocking_factor = 8 # grid size must be divisible by this
19+
amr.max_grid_size = 128 # maximum grid size to create 4 FABs of 25 cells each
20+
21+
do_reflux = 0
22+
do_subcycle = 0
23+
do_tracers = 1
24+
plotfile_interval = -1
25+
26+
cfl = 0.3
27+
stop_time = 1.0
28+
max_timesteps = 10000
29+
30+
hydro.rk_integrator_order = 2
31+
hydro.reconstruction_order = 3
32+
hydro.use_dual_energy = 0
33+
34+
mhd.reconstruction_order = 3
35+
36+
setup.run_convergence = false
37+
setup.run_sim = true
38+
setup.error_tol = 0.002
39+
setup.num_modes_x = 1
40+
setup.num_modes_y = 0
41+
setup.num_modes_z = 0
42+
setup.angle_between_k_b0 = 0.0

inputs/EntropyWaveConvergence.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ plotfile_interval = -1
2525

2626
cfl = 0.3
2727

28-
2928
hydro.rk_integrator_order = 2
3029
hydro.reconstruction_order = 3
3130
hydro.use_dual_energy = 0

inputs/FastWave.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,10 @@ hydro.rk_integrator_order = 2
3636
hydro.reconstruction_order = 5
3737
hydro.use_dual_energy = 0
3838

39-
mhd.emf_compute_scheme = "Balsara2025"
40-
mhd.emf_averaging_scheme = "LondrilloDelZanna2004"
39+
setup.run_convergence = false
40+
setup.run_sim = true
41+
setup.error_tol = 0.002
42+
setup.num_modes_x = 1
43+
setup.num_modes_y = 0
44+
setup.num_modes_z = 0
45+
setup.angle_between_k_b0 = 90.0

inputs/HydroWave.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,8 @@ do_reflux = 0
2222
do_subcycle = 0
2323
do_tracers = 1
2424
plotfile_interval = -1
25+
stop_time = 1.0
26+
max_timesteps = 20000
27+
28+
setup.run_convergence = false
29+
setup.run_sim = true

inputs/HydroWaveFc.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,14 @@ amr.blocking_factor_z = 8
2323

2424
do_reflux = 0
2525
do_subcycle = 0
26+
cfl = 0.1
2627

2728
plotfile_interval = 1
2829
checkpoint_interval = -1
2930
stop_time = 1.0
3031
max_timesteps = 1
3132
do_tracers = 1
33+
34+
setup.run_convergence = false
35+
setup.run_sim = true
36+
setup.error_tol = 1.0e-8

inputs/SlowWave.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ mhd.reconstruction_order = 5
4141
mhd.emf_compute_scheme = "Balsara2025"
4242
mhd.emf_averaging_scheme = "LondrilloDelZanna2004"
4343

44+
setup.run_convergence = false
45+
setup.run_sim = true
46+
setup.error_tol = 0.002
4447
setup.num_modes_x = 1
4548
setup.num_modes_y = 0
4649
setup.num_modes_z = 0

regression/quokka-tests.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ ignore_return_code = 0
191191

192192
[LinearAlfvenWave-GPU]
193193
buildDir = .
194-
target = AlfvenWaveLinear
194+
target = AlfvenWaveLinearConvergence
195195
inputFile = inputs/alfven_wave_linear_regression.toml
196196
dim = 3
197197
cmakeSetupOpts = -DAMReX_GPU_BACKEND=CUDA -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache

src/problems/AlfvenWaveLinear/CMakeLists.txt

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)