From 81110372451ea4717c30812e15ad4e3b469a4c1b Mon Sep 17 00:00:00 2001 From: bennibolm Date: Sat, 11 May 2024 12:27:36 +0200 Subject: [PATCH] Add test for saving deviations for positivity limiter (non-linear) --- ...ixir_euler_kelvin_helmholtz_instability_sc_subcell.jl | 3 ++- test/test_tree_2d_euler.jl | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/tree_2d_dgsem/elixir_euler_kelvin_helmholtz_instability_sc_subcell.jl b/examples/tree_2d_dgsem/elixir_euler_kelvin_helmholtz_instability_sc_subcell.jl index 1817672778a..c9024d7f734 100644 --- a/examples/tree_2d_dgsem/elixir_euler_kelvin_helmholtz_instability_sc_subcell.jl +++ b/examples/tree_2d_dgsem/elixir_euler_kelvin_helmholtz_instability_sc_subcell.jl @@ -83,7 +83,8 @@ callbacks = CallbackSet(summary_callback, ############################################################################### # run the simulation -stage_callbacks = (SubcellLimiterIDPCorrection(), BoundsCheckCallback(save_errors = false)) +stage_callbacks = (SubcellLimiterIDPCorrection(), + BoundsCheckCallback(save_errors = false, interval = 100)) sol = Trixi.solve(ode, Trixi.SimpleSSPRK33(stage_callbacks = stage_callbacks); dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback diff --git a/test/test_tree_2d_euler.jl b/test/test_tree_2d_euler.jl index 9a40b1a4d7d..a004d1452b7 100644 --- a/test/test_tree_2d_euler.jl +++ b/test/test_tree_2d_euler.jl @@ -628,6 +628,7 @@ end end @trixi_testset "elixir_euler_kelvin_helmholtz_instability_sc_subcell.jl" begin + rm(joinpath("out", "deviations.txt"), force = true) @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_kelvin_helmholtz_instability_sc_subcell.jl"), l2=[ @@ -642,7 +643,13 @@ end 0.5822547982757897, 0.7300051017382696, ], - tspan=(0.0, 2.0)) + tspan=(0.0, 2.0), + coverage_override=(maxiters = 7,), + save_errors=true) + lines = readlines(joinpath("out", "deviations.txt")) + @test lines[1] == "# iter, simu_time, rho_min, pressure_min" + # Run without (with) coverage takes 745 (7) time steps + @test startswith(lines[end], "7") # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let