From 5bb0ab2d915627af9bbaec361a685d2e6f8d37f0 Mon Sep 17 00:00:00 2001 From: Daniel_Doehring Date: Wed, 24 Jul 2024 23:04:23 +0200 Subject: [PATCH] test --- test/test_tree_1d_euler.jl | 22 ++++++++++++++++++++++ test/test_unit.jl | 7 +++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/test/test_tree_1d_euler.jl b/test/test_tree_1d_euler.jl index dc523586f89..31f285fa3a0 100644 --- a/test/test_tree_1d_euler.jl +++ b/test/test_tree_1d_euler.jl @@ -490,6 +490,28 @@ end @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000 end end + +@trixi_testset "elixir_euler_convergence_pure_fvO2.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_convergence_pure_fvO2.jl"), + l2=[ + 0.00048190103584221393, + 0.0005306536705484938, + 0.0007902755183354382, + ], + linf=[ + 0.0014512544822959939, + 0.0014178023249342697, + 0.002568866462516972, + ]) + # 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 end end # module diff --git a/test/test_unit.jl b/test/test_unit.jl index b82eb07772a..76a9acf89e3 100644 --- a/test/test_unit.jl +++ b/test/test_unit.jl @@ -1745,7 +1745,7 @@ end @test minmod(sl, sr) == 0.5 @test monotonized_central(sl, sr) == 0.75 @test superbee(sl, sr) == 1.0 - @test isapprox(vanLeer_limiter(sl, sr), 2/3) + @test isapprox(vanLeer_limiter(sl, sr), 2 / 3) sl = -1.0 sr = 0.0 @@ -1758,13 +1758,13 @@ end @test minmod(sl, sr) == -0.8 @test monotonized_central(sl, sr) == -0.9 @test superbee(sl, sr) == -1.0 - @test isapprox(vanLeer_limiter(sl, sr), -8/9) + @test isapprox(vanLeer_limiter(sl, sr), -8 / 9) # Test symmetry @test minmod(sr, sl) == -0.8 @test monotonized_central(sr, sl) == -0.9 @test superbee(sr, sl) == -1.0 - @test isapprox(vanLeer_limiter(sr, sl), -8/9) + @test isapprox(vanLeer_limiter(sr, sl), -8 / 9) sl = 1.0 sr = 0.0 @@ -1773,7 +1773,6 @@ end @test superbee(sl, sr) == 0.0 @test vanLeer_limiter(sl, sr) == 0.0 end - end end #module