From 995107b2db330522da75a0af516244665de45f2a Mon Sep 17 00:00:00 2001 From: Warisa Date: Tue, 9 Jul 2024 19:56:58 +0200 Subject: [PATCH] update test to be compatible with save_solution --- test/test_structured_1d.jl | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/test/test_structured_1d.jl b/test/test_structured_1d.jl index 883f1b12fad..034604f7788 100644 --- a/test/test_structured_1d.jl +++ b/test/test_structured_1d.jl @@ -60,8 +60,8 @@ end @trixi_testset "elixir_burgers_perk3.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_burgers_perk3.jl"), - l2=[6.4744366559817754e-6], - linf=[4.357450084224723e-5], + l2=[4.12066275835687e-6], + linf=[2.538190787615413e-5], atol=1.0e-6) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) @@ -73,6 +73,25 @@ end end end +# Testing the third-order paired explicit Runge-Kutta (PERK) method without stepsize callback +@trixi_testset "elixir_burgers_perk3.jl(fixed time step)" begin + @test_trixi_include( dt=2.0e-3, + tspan=(0.0, 2.0), + save_solution=SaveSolutionCallback(dt = 0.1 + 1.0e-8), + callbacks=CallbackSet(summary_callback, save_solution, + analysis_callback, alive_callback), + l2=[5.725141913990915e-7], + linf=[3.4298598041715422e-6]) + # Ensure that we do not have excessive memory allocations + # (e.g., from type instabilities) + let + t = sol.t[end] + u_ode = sol.u[end] + du_ode = similar(u_ode) + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000 + end +end + @trixi_testset "elixir_euler_sedov.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_sedov.jl"), l2=[3.67478226e-01, 3.49491179e-01, 8.08910759e-01],