From bf75bac7eed1d76fbf4bcae307987e9d25c66df7 Mon Sep 17 00:00:00 2001 From: Daniel_Doehring Date: Thu, 18 Jul 2024 16:42:26 +0200 Subject: [PATCH 1/5] 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 4a0747d1c0..225b85a059 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 6a26b5e95b..4f2c72cd67 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 02ff338e91..2e7e882f5e 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 f97696d089..78230e5cf0 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 From 4b980d603e712622a450e8cdb5cb08f35c34ae0f Mon Sep 17 00:00:00 2001 From: Daniel_Doehring Date: Thu, 18 Jul 2024 18:58:29 +0200 Subject: [PATCH 2/5] test p4est and t8code --- test/test_p4est_2d.jl | 31 +++++++++++++++++++++++++++++++ test/test_t8code_3d.jl | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/test/test_p4est_2d.jl b/test/test_p4est_2d.jl index f4924bdcf7..119a7c9a45 100644 --- a/test/test_p4est_2d.jl +++ b/test/test_p4est_2d.jl @@ -655,6 +655,37 @@ end @test isapprox(lift, 0.029076443678087403, atol = 1e-13) @test isapprox(drag, 0.13564720009197903, atol = 1e-13) end + +@trixi_testset "elixir_euler_blast_wave_pure_fv.jl" begin + @test_trixi_include(joinpath(pkgdir(Trixi, "examples", "tree_2d_dgsem"), + "elixir_euler_blast_wave_pure_fv.jl"), + l2=[ + 0.39957047631960346, + 0.21006912294983154, + 0.21006903549932, + 0.6280328163981136, + ], + linf=[ + 2.20417889887697, + 1.5487238480003327, + 1.5486788679247812, + 2.4656795949035857, + ], + tspan=(0.0, 0.5), + # Let this test run longer to cover some lines in flux_hllc + coverage_override=(maxiters = 10^5, tspan = (0.0, 0.1)), + mesh=mesh = P4estMesh((64, 64), polydeg = 3, + coordinates_min = (-2.0, -2.0), + coordinates_max = (2.0, 2.0))) + # 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 diff --git a/test/test_t8code_3d.jl b/test/test_t8code_3d.jl index 81d2a7cdd8..5c452444be 100644 --- a/test/test_t8code_3d.jl +++ b/test/test_t8code_3d.jl @@ -282,6 +282,40 @@ mkdir(outdir) @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_3d_dgsem"), + "elixir_euler_convergence_pure_fv.jl"), + l2=[ + 0.037182410351406, + 0.032062252638283974, + 0.032062252638283974, + 0.03206225263828395, + 0.12228177813586687, + ], + linf=[ + 0.0693648413632646, + 0.0622101894740843, + 0.06221018947408474, + 0.062210189474084965, + 0.24196451799555962, + ], + mesh=T8codeMesh((4, 4, 4), polydeg = 3, + coordinates_min = (0.0, 0.0, 0.0), + coordinates_max = (2.0, 2.0, 2.0)), + # Remove SaveSolution callback + callbacks=CallbackSet(summary_callback, + analysis_callback, alive_callback, + stepsize_callback)) + # 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 From 8de70d05e44b85597932aae686e997a677b24bc8 Mon Sep 17 00:00:00 2001 From: Daniel Doehring Date: Fri, 19 Jul 2024 08:23:35 +0200 Subject: [PATCH 3/5] Update test/test_p4est_2d.jl --- test/test_p4est_2d.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_p4est_2d.jl b/test/test_p4est_2d.jl index 119a7c9a45..97853ae145 100644 --- a/test/test_p4est_2d.jl +++ b/test/test_p4est_2d.jl @@ -674,7 +674,7 @@ end tspan=(0.0, 0.5), # Let this test run longer to cover some lines in flux_hllc coverage_override=(maxiters = 10^5, tspan = (0.0, 0.1)), - mesh=mesh = P4estMesh((64, 64), polydeg = 3, + mesh=P4estMesh((64, 64), polydeg = 3, coordinates_min = (-2.0, -2.0), coordinates_max = (2.0, 2.0))) # Ensure that we do not have excessive memory allocations From b60df3c6923692778b17a5de58fdd24626e8d293 Mon Sep 17 00:00:00 2001 From: Daniel_Doehring Date: Fri, 19 Jul 2024 11:06:28 +0200 Subject: [PATCH 4/5] fmt --- test/test_p4est_2d.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_p4est_2d.jl b/test/test_p4est_2d.jl index 97853ae145..ea628eb32a 100644 --- a/test/test_p4est_2d.jl +++ b/test/test_p4est_2d.jl @@ -675,8 +675,8 @@ end # Let this test run longer to cover some lines in flux_hllc coverage_override=(maxiters = 10^5, tspan = (0.0, 0.1)), mesh=P4estMesh((64, 64), polydeg = 3, - coordinates_min = (-2.0, -2.0), - coordinates_max = (2.0, 2.0))) + coordinates_min = (-2.0, -2.0), + coordinates_max = (2.0, 2.0))) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let From 0613f66b57ce6a31e5a91e4d8582f8c78a0f7d10 Mon Sep 17 00:00:00 2001 From: Daniel_Doehring Date: Tue, 23 Jul 2024 19:31:06 +0200 Subject: [PATCH 5/5] remove coverage line --- test/test_p4est_2d.jl | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/test_p4est_2d.jl b/test/test_p4est_2d.jl index ea628eb32a..ef5ac2c9de 100644 --- a/test/test_p4est_2d.jl +++ b/test/test_p4est_2d.jl @@ -672,8 +672,6 @@ end 2.4656795949035857, ], tspan=(0.0, 0.5), - # Let this test run longer to cover some lines in flux_hllc - coverage_override=(maxiters = 10^5, tspan = (0.0, 0.1)), mesh=P4estMesh((64, 64), polydeg = 3, coordinates_min = (-2.0, -2.0), coordinates_max = (2.0, 2.0)))