From bf75bac7eed1d76fbf4bcae307987e9d25c66df7 Mon Sep 17 00:00:00 2001 From: Daniel_Doehring Date: Thu, 18 Jul 2024 16:42:26 +0200 Subject: [PATCH] calc_volume_integral! for all meshes supported by fv_kernel! --- src/solvers/dgsem_tree/dg_1d.jl | 2 +- src/solvers/dgsem_tree/dg_2d.jl | 4 +++- src/solvers/dgsem_tree/dg_3d.jl | 3 ++- test/test_structured_1d.jl | 24 ++++++++++++++++++++++++ 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/solvers/dgsem_tree/dg_1d.jl b/src/solvers/dgsem_tree/dg_1d.jl index 4a0747d1c09..225b85a0598 100644 --- a/src/solvers/dgsem_tree/dg_1d.jl +++ b/src/solvers/dgsem_tree/dg_1d.jl @@ -294,7 +294,7 @@ end # TODO: Taal dimension agnostic function calc_volume_integral!(du, u, - mesh::TreeMesh{1}, + mesh::Union{TreeMesh{1}, StructuredMesh{1}}, nonconservative_terms, equations, volume_integral::VolumeIntegralPureLGLFiniteVolume, dg::DGSEM, cache) diff --git a/src/solvers/dgsem_tree/dg_2d.jl b/src/solvers/dgsem_tree/dg_2d.jl index 6a26b5e95be..4f2c72cd677 100644 --- a/src/solvers/dgsem_tree/dg_2d.jl +++ b/src/solvers/dgsem_tree/dg_2d.jl @@ -376,7 +376,9 @@ end # TODO: Taal dimension agnostic function calc_volume_integral!(du, u, - mesh::TreeMesh{2}, + mesh::Union{TreeMesh{2}, StructuredMesh{2}, + UnstructuredMesh2D, P4estMesh{2}, + T8codeMesh{2}}, nonconservative_terms, equations, volume_integral::VolumeIntegralPureLGLFiniteVolume, dg::DGSEM, cache) diff --git a/src/solvers/dgsem_tree/dg_3d.jl b/src/solvers/dgsem_tree/dg_3d.jl index 02ff338e912..2e7e882f5ef 100644 --- a/src/solvers/dgsem_tree/dg_3d.jl +++ b/src/solvers/dgsem_tree/dg_3d.jl @@ -424,7 +424,8 @@ end # TODO: Taal dimension agnostic function calc_volume_integral!(du, u, - mesh::TreeMesh{3}, + mesh::Union{TreeMesh{3}, StructuredMesh{3}, P4estMesh{3}, + T8codeMesh{3}}, nonconservative_terms, equations, volume_integral::VolumeIntegralPureLGLFiniteVolume, dg::DGSEM, cache) diff --git a/test/test_structured_1d.jl b/test/test_structured_1d.jl index f97696d089a..78230e5cf0d 100644 --- a/test/test_structured_1d.jl +++ b/test/test_structured_1d.jl @@ -168,6 +168,30 @@ end @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000 end end + +@trixi_testset "elixir_euler_convergence_pure_fv.jl" begin + @test_trixi_include(joinpath(pkgdir(Trixi, "examples", "tree_1d_dgsem"), + "elixir_euler_convergence_pure_fv.jl"), + mesh=StructuredMesh(16, (0.0,), (2.0,)), + l2=[ + 0.019355699748523896, + 0.022326984561234497, + 0.02523665947241734, + ], + linf=[ + 0.02895961127645519, + 0.03293442484199227, + 0.04246098278632804, + ]) + # 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 # Clean up afterwards: delete Trixi.jl output directory