From 3b02770de22712492921d90702fbbd5b45ff8637 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Thu, 7 Nov 2024 09:28:27 -0600 Subject: [PATCH 01/32] update bound on RecursiveArrayTools to have access to 3.27.3 d --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 87be80456c3..c4bef3d2d8d 100644 --- a/Project.toml +++ b/Project.toml @@ -94,7 +94,7 @@ PrecompileTools = "1.1" Preferences = "1.3" Printf = "1" RecipesBase = "1.1" -RecursiveArrayTools = "2.38.10" +RecursiveArrayTools = "2.38.10, 3" Reexport = "1.0" Requires = "1.1" SciMLBase = "1.90, 2" From 9b21e12da1695b1811104e381e9912456a3cf12c Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Thu, 7 Nov 2024 09:28:42 -0600 Subject: [PATCH 02/32] comment out broken precompile statements --- src/auxiliary/precompile.jl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/auxiliary/precompile.jl b/src/auxiliary/precompile.jl index 4d5399b5ba3..04b23f5639a 100644 --- a/src/auxiliary/precompile.jl +++ b/src/auxiliary/precompile.jl @@ -380,10 +380,10 @@ function _precompile_manual_() # end # end @assert Base.precompile(Tuple{typeof(SummaryCallback)}) - @assert Base.precompile(Tuple{DiscreteCallback{typeof(Trixi.summary_callback), - typeof(Trixi.summary_callback), - typeof(Trixi.initialize_summary_callback), - typeof(SciMLBase.FINALIZE_DEFAULT)}}) + # @assert Base.precompile(Tuple{DiscreteCallback{typeof(Trixi.summary_callback), + # typeof(Trixi.summary_callback), + # typeof(Trixi.initialize_summary_callback), + # typeof(SciMLBase.FINALIZE_DEFAULT)}}) @assert Base.precompile(Tuple{typeof(summary_box), Base.TTY, String, Vector{Pair{String, Any}}}) # TODO: AMRCallback, ControllerThreeLevel, indicators @@ -521,9 +521,9 @@ function _precompile_manual_() typeof(Trixi.initialize_summary_callback), typeof(SciMLBase.FINALIZE_DEFAULT)} @assert Base.precompile(Tuple{typeof(show), Base.TTY, summary_callback_type}) - @assert Base.precompile(Tuple{typeof(show), IOContext{Base.TTY}, MIME"text/plain", - summary_callback_type}) - @assert Base.precompile(Tuple{summary_callback_type, Base.TTY}) + # @assert Base.precompile(Tuple{typeof(show), IOContext{Base.TTY}, MIME"text/plain", + # summary_callback_type}) + # @assert Base.precompile(Tuple{summary_callback_type, Base.TTY}) # TODO: SteadyStateCallback, AnalysisCallback From e66bcd9a3d9299feefc082fb1aab87c6ec2f495b Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Thu, 7 Nov 2024 16:31:03 -0600 Subject: [PATCH 03/32] adding VoA for DGMulti --- src/Trixi.jl | 1 + src/solvers/dgmulti/dg.jl | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Trixi.jl b/src/Trixi.jl index 7d557ddde38..1dcf4f7d11e 100644 --- a/src/Trixi.jl +++ b/src/Trixi.jl @@ -61,6 +61,7 @@ using OffsetArrays: OffsetArray, OffsetVector using P4est using T8code using RecipesBase: RecipesBase +using RecursiveArrayTools: VectorOfArray using Requires: @require using Static: Static, One, True, False @reexport using StaticArrays: SVector diff --git a/src/solvers/dgmulti/dg.jl b/src/solvers/dgmulti/dg.jl index 2d588c5c79d..a4b9c9b09ab 100644 --- a/src/solvers/dgmulti/dg.jl +++ b/src/solvers/dgmulti/dg.jl @@ -128,6 +128,14 @@ end # interface with semidiscretization_hyperbolic wrap_array(u_ode, mesh::DGMultiMesh, equations, dg::DGMulti, cache) = u_ode wrap_array_native(u_ode, mesh::DGMultiMesh, equations, dg::DGMulti, cache) = u_ode + +# used to initialize `u_ode` in `semidiscretize` +function allocate_coefficients(mesh::DGMultiMesh, equations, dg::DGMulti, cache) + return VectorOfArray(allocate_nested_array(real(dg), nvariables(equations), size(mesh.md.x), dg)) +end +wrap_array(u_ode::VectorOfArray, mesh::DGMultiMesh, equations, dg::DGMulti, cache) = parent(u_ode) + + function digest_boundary_conditions(boundary_conditions::NamedTuple{Keys, ValueTypes}, mesh::DGMultiMesh, dg::DGMulti, @@ -199,10 +207,6 @@ function create_cache(mesh::DGMultiMesh{NDIMS}, equations, dg::DGMultiWeakForm, local_values_threaded, flux_threaded, rotated_flux_threaded) end -function allocate_coefficients(mesh::DGMultiMesh, equations, dg::DGMulti, cache) - return allocate_nested_array(real(dg), nvariables(equations), size(mesh.md.x), dg) -end - function compute_coefficients!(u, initial_condition, t, mesh::DGMultiMesh, equations, dg::DGMulti, cache) md = mesh.md From 8da6bfa7ff26ee954f77b53ae3020bbf74cb7dec Mon Sep 17 00:00:00 2001 From: Jesse Chan <1156048+jlchan@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:33:58 -0600 Subject: [PATCH 04/32] Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/solvers/dgmulti/dg.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/solvers/dgmulti/dg.jl b/src/solvers/dgmulti/dg.jl index a4b9c9b09ab..a48a6288eba 100644 --- a/src/solvers/dgmulti/dg.jl +++ b/src/solvers/dgmulti/dg.jl @@ -131,11 +131,11 @@ wrap_array_native(u_ode, mesh::DGMultiMesh, equations, dg::DGMulti, cache) = u_o # used to initialize `u_ode` in `semidiscretize` function allocate_coefficients(mesh::DGMultiMesh, equations, dg::DGMulti, cache) - return VectorOfArray(allocate_nested_array(real(dg), nvariables(equations), size(mesh.md.x), dg)) + return VectorOfArray(allocate_nested_array(real(dg), nvariables(equations), + size(mesh.md.x), dg)) end wrap_array(u_ode::VectorOfArray, mesh::DGMultiMesh, equations, dg::DGMulti, cache) = parent(u_ode) - function digest_boundary_conditions(boundary_conditions::NamedTuple{Keys, ValueTypes}, mesh::DGMultiMesh, dg::DGMulti, From a20dc52a217b4d4f6ccea77cfece2b0512e18271 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Thu, 7 Nov 2024 17:07:47 -0600 Subject: [PATCH 05/32] run `Trixi.rhs!` twice to try to avoid excessive allocations --- test/test_threaded.jl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/test_threaded.jl b/test/test_threaded.jl index a3d52c1923f..c5ec85e3bb4 100644 --- a/test/test_threaded.jl +++ b/test/test_threaded.jl @@ -39,6 +39,7 @@ Trixi.MPI.Barrier(Trixi.mpi_comm()) t = sol.t[end] u_ode = sol.u[end] du_ode = similar(u_ode) + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -65,6 +66,7 @@ Trixi.MPI.Barrier(Trixi.mpi_comm()) t = sol.t[end] u_ode = sol.u[end] du_ode = similar(u_ode) + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -81,6 +83,7 @@ Trixi.MPI.Barrier(Trixi.mpi_comm()) t = sol.t[end] u_ode = sol.u[end] du_ode = similar(u_ode) + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -108,6 +111,7 @@ Trixi.MPI.Barrier(Trixi.mpi_comm()) t = sol.t[end] u_ode = sol.u[end] du_ode = similar(u_ode) + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -134,6 +138,7 @@ Trixi.MPI.Barrier(Trixi.mpi_comm()) t = sol.t[end] u_ode = sol.u[end] du_ode = similar(u_ode) + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -152,6 +157,7 @@ Trixi.MPI.Barrier(Trixi.mpi_comm()) t = sol.t[end] u_ode = sol.u[end] du_ode = similar(u_ode) + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -169,6 +175,7 @@ Trixi.MPI.Barrier(Trixi.mpi_comm()) t = sol.t[end] u_ode = sol.u[end] du_ode = similar(u_ode) + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -196,6 +203,7 @@ Trixi.MPI.Barrier(Trixi.mpi_comm()) t = sol.t[end] u_ode = sol.u[end] du_ode = similar(u_ode) + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -220,6 +228,7 @@ end t = sol.t[end] u_ode = sol.u[end] du_ode = similar(u_ode) + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -245,6 +254,7 @@ end t = sol.t[end] u_ode = sol.u[end] du_ode = similar(u_ode) + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -270,6 +280,7 @@ end t = sol.t[end] u_ode = sol.u[end] du_ode = similar(u_ode) + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -298,6 +309,7 @@ end t = sol.t[end] u_ode = sol.u[end] du_ode = similar(u_ode) + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -385,6 +397,7 @@ end t = sol.t[end] u_ode = sol.u[end] du_ode = similar(u_ode) + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -412,6 +425,7 @@ end t = sol.t[end] u_ode = sol.u[end] du_ode = similar(u_ode) + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -438,6 +452,7 @@ end t = sol.t[end] u_ode = sol.u[end] du_ode = similar(u_ode) + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -464,6 +479,7 @@ end t = sol.t[end] u_ode = sol.u[end] du_ode = similar(u_ode) + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end From 781a7d8416fba2e0d0f295145c5409926afc9c23 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Thu, 7 Nov 2024 17:17:05 -0600 Subject: [PATCH 06/32] bump lower compat of RecursiveArrayTools --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index b4e25cdd0c1..7e09b2162e2 100644 --- a/Project.toml +++ b/Project.toml @@ -94,7 +94,7 @@ PrecompileTools = "1.1" Preferences = "1.3" Printf = "1" RecipesBase = "1.1" -RecursiveArrayTools = "2.38.10, 3" +RecursiveArrayTools = "3.27.1" Reexport = "1.0" Requires = "1.1" SciMLBase = "1.90, 2" From 1d044717eb6aefea3f70db17e0697180260a2b55 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Thu, 7 Nov 2024 20:52:24 -0600 Subject: [PATCH 07/32] run Trixi.rhs! twice to reduce allocation count --- test/test_dgmulti_1d.jl | 30 ++++++---- test/test_dgmulti_2d.jl | 119 +++++++++++++++++++++++----------------- test/test_dgmulti_3d.jl | 58 ++++++++++---------- 3 files changed, 120 insertions(+), 87 deletions(-) diff --git a/test/test_dgmulti_1d.jl b/test/test_dgmulti_1d.jl index 1c3cd604df1..5381973f495 100644 --- a/test/test_dgmulti_1d.jl +++ b/test/test_dgmulti_1d.jl @@ -25,7 +25,8 @@ isdir(outdir) && rm(outdir, recursive = true) 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -41,7 +42,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -65,7 +67,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -89,7 +92,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -106,7 +110,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -130,7 +135,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -161,7 +167,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -183,7 +190,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -224,7 +232,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -250,7 +259,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end end diff --git a/test/test_dgmulti_2d.jl b/test/test_dgmulti_2d.jl index 2e41591d52c..3ee0cc080c3 100644 --- a/test/test_dgmulti_2d.jl +++ b/test/test_dgmulti_2d.jl @@ -37,7 +37,8 @@ isdir(outdir) && rm(outdir, recursive = true) 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -65,7 +66,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -93,7 +95,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -121,7 +124,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -150,7 +154,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -180,47 +185,38 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @trixi_testset "elixir_euler_bilinear.jl (Bilinear quadrilateral elements, SBP, flux differencing)" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_bilinear.jl"), - l2=[ - 1.0259432774540821e-5, 9.014087689495575e-6, - 9.01408768888544e-6, 2.738953324859446e-5 - ], - linf=[ - 7.362605996297233e-5, 6.874189724781488e-5, - 6.874189703509614e-5, 0.00019124355334110277 - ]) + l2 = [1.0267413589968656e-5, 9.03069720963081e-6, 9.030697209721065e-6, 2.7436672091049314e-5], + linf = [7.36251369879426e-5, 6.874041557969335e-5, 6.874041552329402e-5, 0.00019123932693609902]) # 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @trixi_testset "elixir_euler_curved.jl (Quadrilateral elements, SBP, flux differencing)" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_curved.jl"), - l2=[ - 1.7204593127904542e-5, 1.5921547179522804e-5, - 1.5921547180107928e-5, 4.894071422525737e-5 - ], - linf=[ - 0.00010525416937667842, 0.00010003778102718464, - 0.00010003778071832059, 0.0003642628211952825 - ]) + l2 = [1.7209164346836478e-5, 1.5928649356474767e-5, 1.5928649356802847e-5, 4.8963394546089164e-5], + linf = [0.00010525404319428056, 0.00010003768703326088, 0.00010003768694910598, 0.0003642622844113319]) # 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -247,7 +243,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -274,7 +271,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -298,7 +296,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -319,7 +318,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -340,7 +340,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -360,7 +361,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -387,7 +389,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -415,7 +418,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -437,7 +441,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -462,7 +467,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -487,7 +493,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -512,7 +519,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -546,7 +554,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -582,7 +591,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -602,7 +612,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -628,7 +639,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -660,7 +672,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -693,7 +706,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -716,7 +730,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -739,7 +754,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -815,7 +831,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -841,7 +858,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -867,7 +885,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -895,7 +914,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -925,7 +945,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end end diff --git a/test/test_dgmulti_3d.jl b/test/test_dgmulti_3d.jl index 5af8c9ee911..b695331fa80 100644 --- a/test/test_dgmulti_3d.jl +++ b/test/test_dgmulti_3d.jl @@ -33,7 +33,8 @@ isdir(outdir) && rm(outdir, recursive = true) 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -62,7 +63,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -91,7 +93,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -117,7 +120,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -140,7 +144,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -162,7 +167,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -191,7 +197,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -222,34 +229,24 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @trixi_testset "elixir_euler_taylor_green_vortex.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_taylor_green_vortex.jl"), polydeg=3, tspan=(0.0, 1.0), cells_per_dimension=(2, 2, 2), - l2=[ - 0.0003612827827560599, - 0.06219350883951729, - 0.062193508839503864, - 0.08121963221634831, - 0.07082703570808184 - ], - linf=[ - 0.0007893509649821162, - 0.1481953939988877, - 0.14819539399791176, - 0.14847291108358926, - 0.21313533492212855 - ]) + l2 = [0.00036128264902931644, 0.06219350570157671, 0.062193505701565316, 0.08121963725209637, 0.0708269605813566], + linf = [0.0007893500666786846, 0.14819541663164099, 0.14819541663231595, 0.148472950090691, 0.2131352319423172]) # 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -277,7 +274,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -311,7 +309,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -347,7 +346,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -373,7 +373,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end @@ -387,7 +388,8 @@ end 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 + Trixi.rhs!(du_ode, u_ode, semi, t) # run once first to deal with spurious allocations + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 5000 end end end From c10b4210a01114c8f992b960d7d61007b71b09a7 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Thu, 7 Nov 2024 20:52:33 -0600 Subject: [PATCH 08/32] update l2, linf errors --- test/test_dgmulti_1d.jl | 14 +----- test/test_dgmulti_2d.jl | 108 ++++++---------------------------------- test/test_dgmulti_3d.jl | 32 ++---------- 3 files changed, 22 insertions(+), 132 deletions(-) diff --git a/test/test_dgmulti_1d.jl b/test/test_dgmulti_1d.jl index 5381973f495..f87a82f12e3 100644 --- a/test/test_dgmulti_1d.jl +++ b/test/test_dgmulti_1d.jl @@ -214,18 +214,8 @@ end @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_shallow_water_quasi_1d.jl"), cells_per_dimension=(8,), approximation_type=SBP(), - l2=[ - 3.03001101100507e-6, - 1.692177335948727e-5, - 3.002634351734614e-16, - 1.1636653574178203e-15 - ], - linf=[ - 1.2043401988570679e-5, - 5.346847010329059e-5, - 9.43689570931383e-16, - 2.220446049250313e-15 - ]) + l2 = [3.0300196635805022e-6, 1.6921833812545857e-5, 2.9844594164368975e-16, 1.1012004949980629e-15], + linf = [1.2043309307818717e-5, 5.346754311919e-5, 9.43689570931383e-16, 2.220446049250313e-15]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let diff --git a/test/test_dgmulti_2d.jl b/test/test_dgmulti_2d.jl index 3ee0cc080c3..d1a7b6c6eeb 100644 --- a/test/test_dgmulti_2d.jl +++ b/test/test_dgmulti_2d.jl @@ -224,18 +224,8 @@ end @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_curved.jl"), approximation_type=GaussSBP(), surface_integral=SurfaceIntegralWeakForm(FluxHLL(min_max_speed_naive)), - l2=[ - 3.4666312079259457e-6, - 3.4392774480368986e-6, - 3.439277447953705e-6, - 1.0965598424665836e-5 - ], - linf=[ - 1.1327280377004811e-5, - 1.1343911926253725e-5, - 1.1343911906935844e-5, - 3.679582619220412e-5 - ], + l2 = [3.4664508443541302e-6, 3.4389354928807557e-6, 3.438935492692069e-6, 1.0965259031107001e-5], + linf = [1.1326776948594741e-5, 1.1343379410666543e-5, 1.1343379308081936e-5, 3.679395547040443e-5], rtol=2 * sqrt(eps())) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) @@ -253,18 +243,8 @@ end element_type=Tri(), approximation_type=Polynomial(), volume_integral=VolumeIntegralWeakForm(), surface_integral=SurfaceIntegralWeakForm(FluxHLL(min_max_speed_naive)), - l2=[ - 7.905498158659466e-6, - 8.731690809663625e-6, - 8.731690811576996e-6, - 2.9113296018693953e-5 - ], - linf=[ - 3.298811230090237e-5, - 4.032272476939269e-5, - 4.032272526011127e-5, - 0.00012013725458537294 - ]) + l2 = [7.906577233455084e-6, 8.733496764560955e-6, 8.733496764569368e-6, 2.9118523221923932e-5], + linf = [3.29875525286738e-5, 4.032296588629691e-5, 4.032296651601541e-5, 0.00012013778890995752]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -278,18 +258,8 @@ end @trixi_testset "elixir_euler_hohqmesh.jl (Quadrilateral elements, SBP, flux differencing)" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_hohqmesh.jl"), - l2=[ - 0.0008153911341517156, - 0.0007768159701964676, - 0.00047902606811690694, - 0.0015551846076348535 - ], - linf=[ - 0.0029301131365355726, - 0.0034427051471457304, - 0.0028721569841545502, - 0.011125365074589944 - ]) + l2 = [0.0008153911341539523, 0.0007768159702011952, 0.0004790260681142826, 0.0015551846076274918], + linf = [0.002930113136531798, 0.003442705146861069, 0.002872156984277563, 0.011125365075300486]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -427,14 +397,8 @@ end @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_rayleigh_taylor_instability.jl"), cells_per_dimension=(8, 8), tspan=(0.0, 0.2), - l2=[ - 0.07097806723891838, 0.005168550941966817, - 0.013820912272220933, 0.03243357220022434 - ], - linf=[ - 0.4783395896753895, 0.02244629340135818, - 0.04023357731088538, 0.08515807256615027 - ]) + l2 = [0.07097806924106471, 0.005168545523460976, 0.013820905434253445, 0.03243358478653133], + linf = [0.4783395366569936, 0.022446258588973853, 0.04023354591166624, 0.08515791118082117]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -840,18 +804,8 @@ end @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_shallowwater_source_terms.jl"), cells_per_dimension=8, element_type=Quad(), approximation_type=SBP(), - l2=[ - 0.0020316462913319046, - 0.023669019044882247, - 0.03446194752754684, - 1.9333465252381796e-15 - ], - linf=[ - 0.010385010095182778, - 0.08750628939565086, - 0.12088392994348407, - 9.325873406851315e-15 - ]) + l2 = [0.0020316463892983217, 0.02366902012965938, 0.03446194535725363, 1.921676942941478e-15], + linf = [0.010384996665098178, 0.08750632767286826, 0.12088391569555768, 9.325873406851315e-15]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -867,18 +821,8 @@ end @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_shallowwater_source_terms.jl"), cells_per_dimension=8, element_type=Tri(), approximation_type=SBP(), - l2=[ - 0.004180680322490383, - 0.07026192411558974, - 0.11815151697006446, - 2.329788936151192e-15 - ], - linf=[ - 0.02076003852980346, - 0.29169601664914424, - 0.5674183379872275, - 1.1546319456101628e-14 - ]) + l2 = [0.004180679992535108, 0.07026193567927695, 0.11815151184746633, 2.3786840926019625e-15], + linf = [0.020760033097378283, 0.29169608872805686, 0.567418412384793, 1.1102230246251565e-14]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -896,18 +840,8 @@ end approximation_type=Polynomial(), # The last l2, linf error are the L2 projection error in approximating `b`, so they are not # zero for general non-collocated quadrature rules (e.g., for `element_type=Tri()`, `polydeg > 2`). - l2=[ - 0.0008309356912456799, - 0.01522451288799231, - 0.016033969387208476, - 1.2820247308150876e-5 - ], - linf=[ - 0.001888045014140971, - 0.05466838692127718, - 0.06345885709961152, - 3.3989933098554914e-5 - ]) + l2 = [0.0008309358577296097, 0.015224511207450263, 0.016033971785878454, 1.282024730815488e-5], + linf = [0.0018880416154898327, 0.05466845626696504, 0.06345896594568323, 3.398993309877696e-5]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -927,18 +861,8 @@ end # for `Quad()` elements with `Polynomial()` approximations because the quadrature rule defaults to # a `(polydeg + 1)`-point Gauss quadrature rule in each coordinate (in general, StartUpDG.jl defaults # to the quadrature rule with the fewest number of points which exactly integrates the mass matrix). - l2=[ - 7.460461950323111e-5, - 0.003685589808444905, - 0.0039101604749887785, - 2.0636891126652983e-15 - ], - linf=[ - 0.000259995400729629, - 0.0072236204211630906, - 0.010364675200833062, - 1.021405182655144e-14 - ]) + l2 = [7.460473151203597e-5, 0.0036855901000765463, 0.003910160802530521, 6.743418333559633e-15], + linf = [0.0002599957400737374, 0.007223608258381642, 0.010364657535841815, 2.042810365310288e-14]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let diff --git a/test/test_dgmulti_3d.jl b/test/test_dgmulti_3d.jl index b695331fa80..a3567a29127 100644 --- a/test/test_dgmulti_3d.jl +++ b/test/test_dgmulti_3d.jl @@ -254,20 +254,8 @@ end @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_taylor_green_vortex.jl"), polydeg=3, approximation_type=GaussSBP(), tspan=(0.0, 1.0), cells_per_dimension=(2, 2, 2), - l2=[ - 0.00036128278275524326, - 0.062193508839511434, - 0.06219350883949677, - 0.08121963221635205, - 0.07082703570765223 - ], - linf=[ - 0.000789350964946367, - 0.14819539399525805, - 0.14819539399590542, - 0.14847291107658706, - 0.21313533492059378 - ]) + l2 = [0.0003612826490291416, 0.06219350570157282, 0.06219350570156088, 0.08121963725209767, 0.07082696058040763], + linf = [0.0007893500666356079, 0.14819541663140268, 0.14819541663222624, 0.14847295009030398, 0.21313523192395678]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -353,20 +341,8 @@ end @trixi_testset "elixir_euler_fdsbp_periodic.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_fdsbp_periodic.jl"), - l2=[ - 7.561896970325353e-5, - 6.884047859361093e-5, - 6.884047859363204e-5, - 6.884047859361148e-5, - 0.000201107274617457 - ], - linf=[ - 0.0001337520020225913, - 0.00011571467799287305, - 0.0001157146779990903, - 0.00011571467799376123, - 0.0003446082308800058 - ]) + l2 = [0.16917000223831077, 0.1584186395735661, 0.15841863957356606, 0.15841863957356622, 0.21512078067145463], + linf = [0.28301503739228906, 0.2938823666715491, 0.2938823666715442, 0.29388236667154466, 0.3670612316913644]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let From 88d08a10f95327bc8d4bd375c1142055adc62c6b Mon Sep 17 00:00:00 2001 From: Jesse Chan <1156048+jlchan@users.noreply.github.com> Date: Thu, 7 Nov 2024 20:58:20 -0600 Subject: [PATCH 09/32] Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- test/test_dgmulti_1d.jl | 14 ++++++++++-- test/test_dgmulti_3d.jl | 48 +++++++++++++++++++++++++++++++++++------ 2 files changed, 54 insertions(+), 8 deletions(-) diff --git a/test/test_dgmulti_1d.jl b/test/test_dgmulti_1d.jl index f87a82f12e3..72d343d565b 100644 --- a/test/test_dgmulti_1d.jl +++ b/test/test_dgmulti_1d.jl @@ -214,8 +214,18 @@ end @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_shallow_water_quasi_1d.jl"), cells_per_dimension=(8,), approximation_type=SBP(), - l2 = [3.0300196635805022e-6, 1.6921833812545857e-5, 2.9844594164368975e-16, 1.1012004949980629e-15], - linf = [1.2043309307818717e-5, 5.346754311919e-5, 9.43689570931383e-16, 2.220446049250313e-15]) + l2=[ + 3.0300196635805022e-6, + 1.6921833812545857e-5, + 2.9844594164368975e-16, + 1.1012004949980629e-15 + ], + linf=[ + 1.2043309307818717e-5, + 5.346754311919e-5, + 9.43689570931383e-16, + 2.220446049250313e-15 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let diff --git a/test/test_dgmulti_3d.jl b/test/test_dgmulti_3d.jl index a3567a29127..74279dfffa0 100644 --- a/test/test_dgmulti_3d.jl +++ b/test/test_dgmulti_3d.jl @@ -237,8 +237,20 @@ end @trixi_testset "elixir_euler_taylor_green_vortex.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_taylor_green_vortex.jl"), polydeg=3, tspan=(0.0, 1.0), cells_per_dimension=(2, 2, 2), - l2 = [0.00036128264902931644, 0.06219350570157671, 0.062193505701565316, 0.08121963725209637, 0.0708269605813566], - linf = [0.0007893500666786846, 0.14819541663164099, 0.14819541663231595, 0.148472950090691, 0.2131352319423172]) + l2=[ + 0.00036128264902931644, + 0.06219350570157671, + 0.062193505701565316, + 0.08121963725209637, + 0.0708269605813566 + ], + linf=[ + 0.0007893500666786846, + 0.14819541663164099, + 0.14819541663231595, + 0.148472950090691, + 0.2131352319423172 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -254,8 +266,20 @@ end @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_taylor_green_vortex.jl"), polydeg=3, approximation_type=GaussSBP(), tspan=(0.0, 1.0), cells_per_dimension=(2, 2, 2), - l2 = [0.0003612826490291416, 0.06219350570157282, 0.06219350570156088, 0.08121963725209767, 0.07082696058040763], - linf = [0.0007893500666356079, 0.14819541663140268, 0.14819541663222624, 0.14847295009030398, 0.21313523192395678]) + l2=[ + 0.0003612826490291416, + 0.06219350570157282, + 0.06219350570156088, + 0.08121963725209767, + 0.07082696058040763 + ], + linf=[ + 0.0007893500666356079, + 0.14819541663140268, + 0.14819541663222624, + 0.14847295009030398, + 0.21313523192395678 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -341,8 +365,20 @@ end @trixi_testset "elixir_euler_fdsbp_periodic.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_fdsbp_periodic.jl"), - l2 = [0.16917000223831077, 0.1584186395735661, 0.15841863957356606, 0.15841863957356622, 0.21512078067145463], - linf = [0.28301503739228906, 0.2938823666715491, 0.2938823666715442, 0.29388236667154466, 0.3670612316913644]) + l2=[ + 0.16917000223831077, + 0.1584186395735661, + 0.15841863957356606, + 0.15841863957356622, + 0.21512078067145463 + ], + linf=[ + 0.28301503739228906, + 0.2938823666715491, + 0.2938823666715442, + 0.29388236667154466, + 0.3670612316913644 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let From 595a75e2ebfadb31abaa684947bbd4915066840f Mon Sep 17 00:00:00 2001 From: Jesse Chan <1156048+jlchan@users.noreply.github.com> Date: Thu, 7 Nov 2024 20:59:02 -0600 Subject: [PATCH 10/32] Update test/test_dgmulti_2d.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- test/test_dgmulti_2d.jl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/test_dgmulti_2d.jl b/test/test_dgmulti_2d.jl index d1a7b6c6eeb..706cfcd51ac 100644 --- a/test/test_dgmulti_2d.jl +++ b/test/test_dgmulti_2d.jl @@ -192,8 +192,18 @@ end @trixi_testset "elixir_euler_bilinear.jl (Bilinear quadrilateral elements, SBP, flux differencing)" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_bilinear.jl"), - l2 = [1.0267413589968656e-5, 9.03069720963081e-6, 9.030697209721065e-6, 2.7436672091049314e-5], - linf = [7.36251369879426e-5, 6.874041557969335e-5, 6.874041552329402e-5, 0.00019123932693609902]) + l2=[ + 1.0267413589968656e-5, + 9.03069720963081e-6, + 9.030697209721065e-6, + 2.7436672091049314e-5 + ], + linf=[ + 7.36251369879426e-5, + 6.874041557969335e-5, + 6.874041552329402e-5, + 0.00019123932693609902 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let From b5c218dbedb90041043485cec222e556bcd5b170 Mon Sep 17 00:00:00 2001 From: Jesse Chan <1156048+jlchan@users.noreply.github.com> Date: Thu, 7 Nov 2024 21:00:49 -0600 Subject: [PATCH 11/32] Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- test/test_dgmulti_2d.jl | 126 ++++++++++++++++++++++++++++++++++------ 1 file changed, 108 insertions(+), 18 deletions(-) diff --git a/test/test_dgmulti_2d.jl b/test/test_dgmulti_2d.jl index 706cfcd51ac..b1c14837fef 100644 --- a/test/test_dgmulti_2d.jl +++ b/test/test_dgmulti_2d.jl @@ -217,8 +217,18 @@ end @trixi_testset "elixir_euler_curved.jl (Quadrilateral elements, SBP, flux differencing)" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_curved.jl"), - l2 = [1.7209164346836478e-5, 1.5928649356474767e-5, 1.5928649356802847e-5, 4.8963394546089164e-5], - linf = [0.00010525404319428056, 0.00010003768703326088, 0.00010003768694910598, 0.0003642622844113319]) + l2=[ + 1.7209164346836478e-5, + 1.5928649356474767e-5, + 1.5928649356802847e-5, + 4.8963394546089164e-5 + ], + linf=[ + 0.00010525404319428056, + 0.00010003768703326088, + 0.00010003768694910598, + 0.0003642622844113319 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -234,8 +244,18 @@ end @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_curved.jl"), approximation_type=GaussSBP(), surface_integral=SurfaceIntegralWeakForm(FluxHLL(min_max_speed_naive)), - l2 = [3.4664508443541302e-6, 3.4389354928807557e-6, 3.438935492692069e-6, 1.0965259031107001e-5], - linf = [1.1326776948594741e-5, 1.1343379410666543e-5, 1.1343379308081936e-5, 3.679395547040443e-5], + l2=[ + 3.4664508443541302e-6, + 3.4389354928807557e-6, + 3.438935492692069e-6, + 1.0965259031107001e-5 + ], + linf=[ + 1.1326776948594741e-5, + 1.1343379410666543e-5, + 1.1343379308081936e-5, + 3.679395547040443e-5 + ], rtol=2 * sqrt(eps())) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) @@ -253,8 +273,18 @@ end element_type=Tri(), approximation_type=Polynomial(), volume_integral=VolumeIntegralWeakForm(), surface_integral=SurfaceIntegralWeakForm(FluxHLL(min_max_speed_naive)), - l2 = [7.906577233455084e-6, 8.733496764560955e-6, 8.733496764569368e-6, 2.9118523221923932e-5], - linf = [3.29875525286738e-5, 4.032296588629691e-5, 4.032296651601541e-5, 0.00012013778890995752]) + l2=[ + 7.906577233455084e-6, + 8.733496764560955e-6, + 8.733496764569368e-6, + 2.9118523221923932e-5 + ], + linf=[ + 3.29875525286738e-5, + 4.032296588629691e-5, + 4.032296651601541e-5, + 0.00012013778890995752 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -268,8 +298,18 @@ end @trixi_testset "elixir_euler_hohqmesh.jl (Quadrilateral elements, SBP, flux differencing)" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_hohqmesh.jl"), - l2 = [0.0008153911341539523, 0.0007768159702011952, 0.0004790260681142826, 0.0015551846076274918], - linf = [0.002930113136531798, 0.003442705146861069, 0.002872156984277563, 0.011125365075300486]) + l2=[ + 0.0008153911341539523, + 0.0007768159702011952, + 0.0004790260681142826, + 0.0015551846076274918 + ], + linf=[ + 0.002930113136531798, + 0.003442705146861069, + 0.002872156984277563, + 0.011125365075300486 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -407,8 +447,18 @@ end @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_rayleigh_taylor_instability.jl"), cells_per_dimension=(8, 8), tspan=(0.0, 0.2), - l2 = [0.07097806924106471, 0.005168545523460976, 0.013820905434253445, 0.03243358478653133], - linf = [0.4783395366569936, 0.022446258588973853, 0.04023354591166624, 0.08515791118082117]) + l2=[ + 0.07097806924106471, + 0.005168545523460976, + 0.013820905434253445, + 0.03243358478653133 + ], + linf=[ + 0.4783395366569936, + 0.022446258588973853, + 0.04023354591166624, + 0.08515791118082117 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -814,8 +864,18 @@ end @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_shallowwater_source_terms.jl"), cells_per_dimension=8, element_type=Quad(), approximation_type=SBP(), - l2 = [0.0020316463892983217, 0.02366902012965938, 0.03446194535725363, 1.921676942941478e-15], - linf = [0.010384996665098178, 0.08750632767286826, 0.12088391569555768, 9.325873406851315e-15]) + l2=[ + 0.0020316463892983217, + 0.02366902012965938, + 0.03446194535725363, + 1.921676942941478e-15 + ], + linf=[ + 0.010384996665098178, + 0.08750632767286826, + 0.12088391569555768, + 9.325873406851315e-15 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -831,8 +891,18 @@ end @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_shallowwater_source_terms.jl"), cells_per_dimension=8, element_type=Tri(), approximation_type=SBP(), - l2 = [0.004180679992535108, 0.07026193567927695, 0.11815151184746633, 2.3786840926019625e-15], - linf = [0.020760033097378283, 0.29169608872805686, 0.567418412384793, 1.1102230246251565e-14]) + l2=[ + 0.004180679992535108, + 0.07026193567927695, + 0.11815151184746633, + 2.3786840926019625e-15 + ], + linf=[ + 0.020760033097378283, + 0.29169608872805686, + 0.567418412384793, + 1.1102230246251565e-14 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -850,8 +920,18 @@ end approximation_type=Polynomial(), # The last l2, linf error are the L2 projection error in approximating `b`, so they are not # zero for general non-collocated quadrature rules (e.g., for `element_type=Tri()`, `polydeg > 2`). - l2 = [0.0008309358577296097, 0.015224511207450263, 0.016033971785878454, 1.282024730815488e-5], - linf = [0.0018880416154898327, 0.05466845626696504, 0.06345896594568323, 3.398993309877696e-5]) + l2=[ + 0.0008309358577296097, + 0.015224511207450263, + 0.016033971785878454, + 1.282024730815488e-5 + ], + linf=[ + 0.0018880416154898327, + 0.05466845626696504, + 0.06345896594568323, + 3.398993309877696e-5 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -871,8 +951,18 @@ end # for `Quad()` elements with `Polynomial()` approximations because the quadrature rule defaults to # a `(polydeg + 1)`-point Gauss quadrature rule in each coordinate (in general, StartUpDG.jl defaults # to the quadrature rule with the fewest number of points which exactly integrates the mass matrix). - l2 = [7.460473151203597e-5, 0.0036855901000765463, 0.003910160802530521, 6.743418333559633e-15], - linf = [0.0002599957400737374, 0.007223608258381642, 0.010364657535841815, 2.042810365310288e-14]) + l2=[ + 7.460473151203597e-5, + 0.0036855901000765463, + 0.003910160802530521, + 6.743418333559633e-15 + ], + linf=[ + 0.0002599957400737374, + 0.007223608258381642, + 0.010364657535841815, + 2.042810365310288e-14 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let From ddc13c36ddb498703c4ff55cbc82e7a129da31a7 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Thu, 7 Nov 2024 21:01:08 -0600 Subject: [PATCH 12/32] Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Update test/test_dgmulti_2d.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- test/test_dgmulti_1d.jl | 14 +++- test/test_dgmulti_2d.jl | 140 ++++++++++++++++++++++++++++++++++------ test/test_dgmulti_3d.jl | 48 ++++++++++++-- 3 files changed, 174 insertions(+), 28 deletions(-) diff --git a/test/test_dgmulti_1d.jl b/test/test_dgmulti_1d.jl index f87a82f12e3..72d343d565b 100644 --- a/test/test_dgmulti_1d.jl +++ b/test/test_dgmulti_1d.jl @@ -214,8 +214,18 @@ end @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_shallow_water_quasi_1d.jl"), cells_per_dimension=(8,), approximation_type=SBP(), - l2 = [3.0300196635805022e-6, 1.6921833812545857e-5, 2.9844594164368975e-16, 1.1012004949980629e-15], - linf = [1.2043309307818717e-5, 5.346754311919e-5, 9.43689570931383e-16, 2.220446049250313e-15]) + l2=[ + 3.0300196635805022e-6, + 1.6921833812545857e-5, + 2.9844594164368975e-16, + 1.1012004949980629e-15 + ], + linf=[ + 1.2043309307818717e-5, + 5.346754311919e-5, + 9.43689570931383e-16, + 2.220446049250313e-15 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let diff --git a/test/test_dgmulti_2d.jl b/test/test_dgmulti_2d.jl index d1a7b6c6eeb..b1c14837fef 100644 --- a/test/test_dgmulti_2d.jl +++ b/test/test_dgmulti_2d.jl @@ -192,8 +192,18 @@ end @trixi_testset "elixir_euler_bilinear.jl (Bilinear quadrilateral elements, SBP, flux differencing)" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_bilinear.jl"), - l2 = [1.0267413589968656e-5, 9.03069720963081e-6, 9.030697209721065e-6, 2.7436672091049314e-5], - linf = [7.36251369879426e-5, 6.874041557969335e-5, 6.874041552329402e-5, 0.00019123932693609902]) + l2=[ + 1.0267413589968656e-5, + 9.03069720963081e-6, + 9.030697209721065e-6, + 2.7436672091049314e-5 + ], + linf=[ + 7.36251369879426e-5, + 6.874041557969335e-5, + 6.874041552329402e-5, + 0.00019123932693609902 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -207,8 +217,18 @@ end @trixi_testset "elixir_euler_curved.jl (Quadrilateral elements, SBP, flux differencing)" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_curved.jl"), - l2 = [1.7209164346836478e-5, 1.5928649356474767e-5, 1.5928649356802847e-5, 4.8963394546089164e-5], - linf = [0.00010525404319428056, 0.00010003768703326088, 0.00010003768694910598, 0.0003642622844113319]) + l2=[ + 1.7209164346836478e-5, + 1.5928649356474767e-5, + 1.5928649356802847e-5, + 4.8963394546089164e-5 + ], + linf=[ + 0.00010525404319428056, + 0.00010003768703326088, + 0.00010003768694910598, + 0.0003642622844113319 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -224,8 +244,18 @@ end @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_curved.jl"), approximation_type=GaussSBP(), surface_integral=SurfaceIntegralWeakForm(FluxHLL(min_max_speed_naive)), - l2 = [3.4664508443541302e-6, 3.4389354928807557e-6, 3.438935492692069e-6, 1.0965259031107001e-5], - linf = [1.1326776948594741e-5, 1.1343379410666543e-5, 1.1343379308081936e-5, 3.679395547040443e-5], + l2=[ + 3.4664508443541302e-6, + 3.4389354928807557e-6, + 3.438935492692069e-6, + 1.0965259031107001e-5 + ], + linf=[ + 1.1326776948594741e-5, + 1.1343379410666543e-5, + 1.1343379308081936e-5, + 3.679395547040443e-5 + ], rtol=2 * sqrt(eps())) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) @@ -243,8 +273,18 @@ end element_type=Tri(), approximation_type=Polynomial(), volume_integral=VolumeIntegralWeakForm(), surface_integral=SurfaceIntegralWeakForm(FluxHLL(min_max_speed_naive)), - l2 = [7.906577233455084e-6, 8.733496764560955e-6, 8.733496764569368e-6, 2.9118523221923932e-5], - linf = [3.29875525286738e-5, 4.032296588629691e-5, 4.032296651601541e-5, 0.00012013778890995752]) + l2=[ + 7.906577233455084e-6, + 8.733496764560955e-6, + 8.733496764569368e-6, + 2.9118523221923932e-5 + ], + linf=[ + 3.29875525286738e-5, + 4.032296588629691e-5, + 4.032296651601541e-5, + 0.00012013778890995752 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -258,8 +298,18 @@ end @trixi_testset "elixir_euler_hohqmesh.jl (Quadrilateral elements, SBP, flux differencing)" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_hohqmesh.jl"), - l2 = [0.0008153911341539523, 0.0007768159702011952, 0.0004790260681142826, 0.0015551846076274918], - linf = [0.002930113136531798, 0.003442705146861069, 0.002872156984277563, 0.011125365075300486]) + l2=[ + 0.0008153911341539523, + 0.0007768159702011952, + 0.0004790260681142826, + 0.0015551846076274918 + ], + linf=[ + 0.002930113136531798, + 0.003442705146861069, + 0.002872156984277563, + 0.011125365075300486 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -397,8 +447,18 @@ end @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_rayleigh_taylor_instability.jl"), cells_per_dimension=(8, 8), tspan=(0.0, 0.2), - l2 = [0.07097806924106471, 0.005168545523460976, 0.013820905434253445, 0.03243358478653133], - linf = [0.4783395366569936, 0.022446258588973853, 0.04023354591166624, 0.08515791118082117]) + l2=[ + 0.07097806924106471, + 0.005168545523460976, + 0.013820905434253445, + 0.03243358478653133 + ], + linf=[ + 0.4783395366569936, + 0.022446258588973853, + 0.04023354591166624, + 0.08515791118082117 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -804,8 +864,18 @@ end @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_shallowwater_source_terms.jl"), cells_per_dimension=8, element_type=Quad(), approximation_type=SBP(), - l2 = [0.0020316463892983217, 0.02366902012965938, 0.03446194535725363, 1.921676942941478e-15], - linf = [0.010384996665098178, 0.08750632767286826, 0.12088391569555768, 9.325873406851315e-15]) + l2=[ + 0.0020316463892983217, + 0.02366902012965938, + 0.03446194535725363, + 1.921676942941478e-15 + ], + linf=[ + 0.010384996665098178, + 0.08750632767286826, + 0.12088391569555768, + 9.325873406851315e-15 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -821,8 +891,18 @@ end @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_shallowwater_source_terms.jl"), cells_per_dimension=8, element_type=Tri(), approximation_type=SBP(), - l2 = [0.004180679992535108, 0.07026193567927695, 0.11815151184746633, 2.3786840926019625e-15], - linf = [0.020760033097378283, 0.29169608872805686, 0.567418412384793, 1.1102230246251565e-14]) + l2=[ + 0.004180679992535108, + 0.07026193567927695, + 0.11815151184746633, + 2.3786840926019625e-15 + ], + linf=[ + 0.020760033097378283, + 0.29169608872805686, + 0.567418412384793, + 1.1102230246251565e-14 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -840,8 +920,18 @@ end approximation_type=Polynomial(), # The last l2, linf error are the L2 projection error in approximating `b`, so they are not # zero for general non-collocated quadrature rules (e.g., for `element_type=Tri()`, `polydeg > 2`). - l2 = [0.0008309358577296097, 0.015224511207450263, 0.016033971785878454, 1.282024730815488e-5], - linf = [0.0018880416154898327, 0.05466845626696504, 0.06345896594568323, 3.398993309877696e-5]) + l2=[ + 0.0008309358577296097, + 0.015224511207450263, + 0.016033971785878454, + 1.282024730815488e-5 + ], + linf=[ + 0.0018880416154898327, + 0.05466845626696504, + 0.06345896594568323, + 3.398993309877696e-5 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -861,8 +951,18 @@ end # for `Quad()` elements with `Polynomial()` approximations because the quadrature rule defaults to # a `(polydeg + 1)`-point Gauss quadrature rule in each coordinate (in general, StartUpDG.jl defaults # to the quadrature rule with the fewest number of points which exactly integrates the mass matrix). - l2 = [7.460473151203597e-5, 0.0036855901000765463, 0.003910160802530521, 6.743418333559633e-15], - linf = [0.0002599957400737374, 0.007223608258381642, 0.010364657535841815, 2.042810365310288e-14]) + l2=[ + 7.460473151203597e-5, + 0.0036855901000765463, + 0.003910160802530521, + 6.743418333559633e-15 + ], + linf=[ + 0.0002599957400737374, + 0.007223608258381642, + 0.010364657535841815, + 2.042810365310288e-14 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let diff --git a/test/test_dgmulti_3d.jl b/test/test_dgmulti_3d.jl index a3567a29127..74279dfffa0 100644 --- a/test/test_dgmulti_3d.jl +++ b/test/test_dgmulti_3d.jl @@ -237,8 +237,20 @@ end @trixi_testset "elixir_euler_taylor_green_vortex.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_taylor_green_vortex.jl"), polydeg=3, tspan=(0.0, 1.0), cells_per_dimension=(2, 2, 2), - l2 = [0.00036128264902931644, 0.06219350570157671, 0.062193505701565316, 0.08121963725209637, 0.0708269605813566], - linf = [0.0007893500666786846, 0.14819541663164099, 0.14819541663231595, 0.148472950090691, 0.2131352319423172]) + l2=[ + 0.00036128264902931644, + 0.06219350570157671, + 0.062193505701565316, + 0.08121963725209637, + 0.0708269605813566 + ], + linf=[ + 0.0007893500666786846, + 0.14819541663164099, + 0.14819541663231595, + 0.148472950090691, + 0.2131352319423172 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -254,8 +266,20 @@ end @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_taylor_green_vortex.jl"), polydeg=3, approximation_type=GaussSBP(), tspan=(0.0, 1.0), cells_per_dimension=(2, 2, 2), - l2 = [0.0003612826490291416, 0.06219350570157282, 0.06219350570156088, 0.08121963725209767, 0.07082696058040763], - linf = [0.0007893500666356079, 0.14819541663140268, 0.14819541663222624, 0.14847295009030398, 0.21313523192395678]) + l2=[ + 0.0003612826490291416, + 0.06219350570157282, + 0.06219350570156088, + 0.08121963725209767, + 0.07082696058040763 + ], + linf=[ + 0.0007893500666356079, + 0.14819541663140268, + 0.14819541663222624, + 0.14847295009030398, + 0.21313523192395678 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -341,8 +365,20 @@ end @trixi_testset "elixir_euler_fdsbp_periodic.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_fdsbp_periodic.jl"), - l2 = [0.16917000223831077, 0.1584186395735661, 0.15841863957356606, 0.15841863957356622, 0.21512078067145463], - linf = [0.28301503739228906, 0.2938823666715491, 0.2938823666715442, 0.29388236667154466, 0.3670612316913644]) + l2=[ + 0.16917000223831077, + 0.1584186395735661, + 0.15841863957356606, + 0.15841863957356622, + 0.21512078067145463 + ], + linf=[ + 0.28301503739228906, + 0.2938823666715491, + 0.2938823666715442, + 0.29388236667154466, + 0.3670612316913644 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let From d69dbc7c9a1282c9e28bba56434df5960771fcbb Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Thu, 7 Nov 2024 21:05:15 -0600 Subject: [PATCH 13/32] bump LinearAlgebra lower compat for Downgrade CI --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 7e09b2162e2..2ba9b707c81 100644 --- a/Project.toml +++ b/Project.toml @@ -79,7 +79,7 @@ FillArrays = "0.13.2, 1" ForwardDiff = "0.10.24" HDF5 = "0.16.10, 0.17" IfElse = "0.1" -LinearAlgebra = "1" +LinearAlgebra = "1.10" LinearMaps = "2.7, 3.0" LoopVectorization = "0.12.151" MPI = "0.20.6" From 1b700bcd794b78fc8bf5ebf1b85d710668b14c95 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Tue, 12 Nov 2024 20:54:53 -0600 Subject: [PATCH 14/32] fixing one precompile statement --- src/auxiliary/precompile.jl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/auxiliary/precompile.jl b/src/auxiliary/precompile.jl index f282caf99cc..b384b9f39ae 100644 --- a/src/auxiliary/precompile.jl +++ b/src/auxiliary/precompile.jl @@ -382,10 +382,11 @@ function _precompile_manual_() # end # end @assert Base.precompile(Tuple{typeof(SummaryCallback)}) - # @assert Base.precompile(Tuple{DiscreteCallback{typeof(Trixi.summary_callback), - # typeof(Trixi.summary_callback), - # typeof(Trixi.initialize_summary_callback), - # typeof(SciMLBase.FINALIZE_DEFAULT)}}) + @assert Base.precompile(Tuple{DiscreteCallback{typeof(Trixi.summary_callback), + typeof(Trixi.summary_callback), + typeof(Trixi.initialize_summary_callback), + typeof(SciMLBase.FINALIZE_DEFAULT), + typeof(nothing)}}) @assert Base.precompile(Tuple{typeof(summary_box), Base.TTY, String, Vector{Pair{String, Any}}}) # TODO: AMRCallback, ControllerThreeLevel, indicators From 0a62556d3f33eb11f954bcb8b423f02b9b536f30 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Wed, 13 Nov 2024 16:43:33 -0600 Subject: [PATCH 15/32] Revert "fixing one precompile statement" This reverts commit 1b700bcd794b78fc8bf5ebf1b85d710668b14c95. --- src/auxiliary/precompile.jl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/auxiliary/precompile.jl b/src/auxiliary/precompile.jl index b384b9f39ae..f282caf99cc 100644 --- a/src/auxiliary/precompile.jl +++ b/src/auxiliary/precompile.jl @@ -382,11 +382,10 @@ function _precompile_manual_() # end # end @assert Base.precompile(Tuple{typeof(SummaryCallback)}) - @assert Base.precompile(Tuple{DiscreteCallback{typeof(Trixi.summary_callback), - typeof(Trixi.summary_callback), - typeof(Trixi.initialize_summary_callback), - typeof(SciMLBase.FINALIZE_DEFAULT), - typeof(nothing)}}) + # @assert Base.precompile(Tuple{DiscreteCallback{typeof(Trixi.summary_callback), + # typeof(Trixi.summary_callback), + # typeof(Trixi.initialize_summary_callback), + # typeof(SciMLBase.FINALIZE_DEFAULT)}}) @assert Base.precompile(Tuple{typeof(summary_box), Base.TTY, String, Vector{Pair{String, Any}}}) # TODO: AMRCallback, ControllerThreeLevel, indicators From 8e80b5d17622db1a8cbc154c437b47c18de11542 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Thu, 14 Nov 2024 10:44:31 -0600 Subject: [PATCH 16/32] change mu::Float64 to mu::Function in elixir --- examples/dgmulti_2d/elixir_navierstokes_lid_driven_cavity.jl | 4 ++-- .../dgmulti_3d/elixir_navierstokes_taylor_green_vortex.jl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/dgmulti_2d/elixir_navierstokes_lid_driven_cavity.jl b/examples/dgmulti_2d/elixir_navierstokes_lid_driven_cavity.jl index 4c7d96d9305..2a114bcec05 100644 --- a/examples/dgmulti_2d/elixir_navierstokes_lid_driven_cavity.jl +++ b/examples/dgmulti_2d/elixir_navierstokes_lid_driven_cavity.jl @@ -5,10 +5,10 @@ using Trixi # semidiscretization of the ideal compressible Navier-Stokes equations prandtl_number() = 0.72 -mu = 0.001 +mu() = 0.001 equations = CompressibleEulerEquations2D(1.4) -equations_parabolic = CompressibleNavierStokesDiffusion2D(equations, mu = mu, +equations_parabolic = CompressibleNavierStokesDiffusion2D(equations, mu = mu(), Prandtl = prandtl_number()) # Create DG solver with polynomial degree = 3 and (local) Lax-Friedrichs/Rusanov flux as surface flux diff --git a/examples/dgmulti_3d/elixir_navierstokes_taylor_green_vortex.jl b/examples/dgmulti_3d/elixir_navierstokes_taylor_green_vortex.jl index 5b844fbe3d2..7b568a84a96 100644 --- a/examples/dgmulti_3d/elixir_navierstokes_taylor_green_vortex.jl +++ b/examples/dgmulti_3d/elixir_navierstokes_taylor_green_vortex.jl @@ -6,10 +6,10 @@ using Trixi # semidiscretization of the compressible Navier-Stokes equations prandtl_number() = 0.72 -mu = 6.25e-4 # equivalent to Re = 1600 +mu() = 6.25e-4 # equivalent to Re = 1600 equations = CompressibleEulerEquations3D(1.4) -equations_parabolic = CompressibleNavierStokesDiffusion3D(equations, mu = mu, +equations_parabolic = CompressibleNavierStokesDiffusion3D(equations, mu = mu(), Prandtl = prandtl_number()) """ From 771d95eef6e0465cb9f0627de0ee29c720b4375b Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Thu, 14 Nov 2024 10:44:36 -0600 Subject: [PATCH 17/32] update CI --- test/test_parabolic_2d.jl | 42 +++++----------------------------- test/test_parabolic_3d.jl | 48 +++++---------------------------------- 2 files changed, 12 insertions(+), 78 deletions(-) diff --git a/test/test_parabolic_2d.jl b/test/test_parabolic_2d.jl index ceefb65e99b..09a4925e18f 100644 --- a/test/test_parabolic_2d.jl +++ b/test/test_parabolic_2d.jl @@ -123,18 +123,8 @@ end @test_trixi_include(joinpath(examples_dir(), "dgmulti_2d", "elixir_navierstokes_convergence.jl"), cells_per_dimension=(4, 4), tspan=(0.0, 0.1), - l2=[ - 0.0015355076812510957, - 0.0033843168272696756, - 0.0036531858107443434, - 0.009948436427519214 - ], - linf=[ - 0.005522560467190019, - 0.013425258500730508, - 0.013962115643482154, - 0.027483102120502423 - ]) + l2 = [0.0015355076237431118, 0.003384316785885901, 0.0036531858026850757, 0.009948436101649498], + linf = [0.005522560543588462, 0.013425258431728926, 0.013962115936715924, 0.027483099961148838]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -149,18 +139,8 @@ end @test_trixi_include(joinpath(examples_dir(), "dgmulti_2d", "elixir_navierstokes_convergence_curved.jl"), cells_per_dimension=(4, 4), tspan=(0.0, 0.1), - l2=[ - 0.004255101916146187, - 0.011118488923215765, - 0.011281831283462686, - 0.03573656447388509 - ], - linf=[ - 0.015071710669706473, - 0.04103132025858458, - 0.03990424085750277, - 0.1309401718598764 - ],) + l2 = [0.0042551020940351444, 0.011118489080358264, 0.011281831362358863, 0.035736565778376306], + linf = [0.015071709836357083, 0.04103131887989486, 0.03990424032494211, 0.13094018584692968],) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -175,18 +155,8 @@ end @test_trixi_include(joinpath(examples_dir(), "dgmulti_2d", "elixir_navierstokes_lid_driven_cavity.jl"), cells_per_dimension=(4, 4), tspan=(0.0, 0.5), - l2=[ - 0.00022156125227115747, - 0.028318325921401, - 0.009509168701070296, - 0.028267900513550506 - ], - linf=[ - 0.001562278941298234, - 0.14886653390744856, - 0.0716323565533752, - 0.19472785105241996 - ]) + l2 = [0.0002215612357465129, 0.028318325887331217, 0.009509168805093485, 0.028267893004691534], + linf = [0.0015622793960574644, 0.1488665309341318, 0.07163235778907852, 0.19472797949052278]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let diff --git a/test/test_parabolic_3d.jl b/test/test_parabolic_3d.jl index 2690a08cbb9..24ec06b96a2 100644 --- a/test/test_parabolic_3d.jl +++ b/test/test_parabolic_3d.jl @@ -16,20 +16,8 @@ isdir(outdir) && rm(outdir, recursive = true) @test_trixi_include(joinpath(examples_dir(), "dgmulti_3d", "elixir_navierstokes_convergence.jl"), cells_per_dimension=(4, 4, 4), tspan=(0.0, 0.1), - l2=[ - 0.0005532847115849239, - 0.000659263490965341, - 0.0007776436127362806, - 0.0006592634909662951, - 0.0038073628897809185 - ], - linf=[ - 0.0017039861523615585, - 0.002628561703560073, - 0.003531057425112172, - 0.0026285617036090336, - 0.015587829540351095 - ]) + l2 = [0.0005532846479614563, 0.000659263463988067, 0.0007776436003494915, 0.000659263463988129, 0.0038073624941206956], + linf = [0.001703986341275776, 0.0026285618026252733, 0.00353105737957371, 0.002628561802588858, 0.015587831432887]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -44,20 +32,8 @@ end @test_trixi_include(joinpath(examples_dir(), "dgmulti_3d", "elixir_navierstokes_convergence_curved.jl"), cells_per_dimension=(4, 4, 4), tspan=(0.0, 0.1), - l2=[ - 0.0014027227251207474, - 0.0021322235533273513, - 0.0027873741447455194, - 0.0024587473070627423, - 0.00997836818019202 - ], - linf=[ - 0.006341750402837576, - 0.010306014252246865, - 0.01520740250924979, - 0.010968264045485565, - 0.047454389831591115 - ]) + l2 = [0.0014027227340680359, 0.0021322235583299425, 0.002787374145873934, 0.002458747307842109, 0.009978368214450204], + linf = [0.006341750448945582, 0.010306014425485621, 0.015207402553448324, 0.010968264060799426, 0.04745438898236998]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -72,20 +48,8 @@ end @test_trixi_include(joinpath(examples_dir(), "dgmulti_3d", "elixir_navierstokes_taylor_green_vortex.jl"), cells_per_dimension=(4, 4, 4), tspan=(0.0, 0.25), - l2=[ - 0.0001825713444029892, - 0.015589736382772248, - 0.015589736382771884, - 0.021943924667273653, - 0.01927370280244222 - ], - linf=[ - 0.0006268463584697681, - 0.03218881662749007, - 0.03218881662697948, - 0.053872495395614256, - 0.05183822000984151 - ]) + l2 = [0.00018257125088549987, 0.015589736346235174, 0.015589736346235415, 0.021943924698669025, 0.019273688367502154], + linf = [0.0006268461326666142, 0.03218881686243058, 0.03218881686357877, 0.053872494644958, 0.05183811394229565]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let From ed4246f02de4db39fb40006a1986790583b8eb5d Mon Sep 17 00:00:00 2001 From: Jesse Chan <1156048+jlchan@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:46:27 -0600 Subject: [PATCH 18/32] Formatting suggestions Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- test/test_parabolic_2d.jl | 42 +++++++++++++++++++++++++++++----- test/test_parabolic_3d.jl | 48 ++++++++++++++++++++++++++++++++++----- 2 files changed, 78 insertions(+), 12 deletions(-) diff --git a/test/test_parabolic_2d.jl b/test/test_parabolic_2d.jl index 09a4925e18f..6271534a5ac 100644 --- a/test/test_parabolic_2d.jl +++ b/test/test_parabolic_2d.jl @@ -123,8 +123,18 @@ end @test_trixi_include(joinpath(examples_dir(), "dgmulti_2d", "elixir_navierstokes_convergence.jl"), cells_per_dimension=(4, 4), tspan=(0.0, 0.1), - l2 = [0.0015355076237431118, 0.003384316785885901, 0.0036531858026850757, 0.009948436101649498], - linf = [0.005522560543588462, 0.013425258431728926, 0.013962115936715924, 0.027483099961148838]) + l2=[ + 0.0015355076237431118, + 0.003384316785885901, + 0.0036531858026850757, + 0.009948436101649498 + ], + linf=[ + 0.005522560543588462, + 0.013425258431728926, + 0.013962115936715924, + 0.027483099961148838 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -139,8 +149,18 @@ end @test_trixi_include(joinpath(examples_dir(), "dgmulti_2d", "elixir_navierstokes_convergence_curved.jl"), cells_per_dimension=(4, 4), tspan=(0.0, 0.1), - l2 = [0.0042551020940351444, 0.011118489080358264, 0.011281831362358863, 0.035736565778376306], - linf = [0.015071709836357083, 0.04103131887989486, 0.03990424032494211, 0.13094018584692968],) + l2=[ + 0.0042551020940351444, + 0.011118489080358264, + 0.011281831362358863, + 0.035736565778376306 + ], + linf=[ + 0.015071709836357083, + 0.04103131887989486, + 0.03990424032494211, + 0.13094018584692968 + ],) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -155,8 +175,18 @@ end @test_trixi_include(joinpath(examples_dir(), "dgmulti_2d", "elixir_navierstokes_lid_driven_cavity.jl"), cells_per_dimension=(4, 4), tspan=(0.0, 0.5), - l2 = [0.0002215612357465129, 0.028318325887331217, 0.009509168805093485, 0.028267893004691534], - linf = [0.0015622793960574644, 0.1488665309341318, 0.07163235778907852, 0.19472797949052278]) + l2=[ + 0.0002215612357465129, + 0.028318325887331217, + 0.009509168805093485, + 0.028267893004691534 + ], + linf=[ + 0.0015622793960574644, + 0.1488665309341318, + 0.07163235778907852, + 0.19472797949052278 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let diff --git a/test/test_parabolic_3d.jl b/test/test_parabolic_3d.jl index 24ec06b96a2..f8f3e9bbc15 100644 --- a/test/test_parabolic_3d.jl +++ b/test/test_parabolic_3d.jl @@ -16,8 +16,20 @@ isdir(outdir) && rm(outdir, recursive = true) @test_trixi_include(joinpath(examples_dir(), "dgmulti_3d", "elixir_navierstokes_convergence.jl"), cells_per_dimension=(4, 4, 4), tspan=(0.0, 0.1), - l2 = [0.0005532846479614563, 0.000659263463988067, 0.0007776436003494915, 0.000659263463988129, 0.0038073624941206956], - linf = [0.001703986341275776, 0.0026285618026252733, 0.00353105737957371, 0.002628561802588858, 0.015587831432887]) + l2=[ + 0.0005532846479614563, + 0.000659263463988067, + 0.0007776436003494915, + 0.000659263463988129, + 0.0038073624941206956 + ], + linf=[ + 0.001703986341275776, + 0.0026285618026252733, + 0.00353105737957371, + 0.002628561802588858, + 0.015587831432887 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -32,8 +44,20 @@ end @test_trixi_include(joinpath(examples_dir(), "dgmulti_3d", "elixir_navierstokes_convergence_curved.jl"), cells_per_dimension=(4, 4, 4), tspan=(0.0, 0.1), - l2 = [0.0014027227340680359, 0.0021322235583299425, 0.002787374145873934, 0.002458747307842109, 0.009978368214450204], - linf = [0.006341750448945582, 0.010306014425485621, 0.015207402553448324, 0.010968264060799426, 0.04745438898236998]) + l2=[ + 0.0014027227340680359, + 0.0021322235583299425, + 0.002787374145873934, + 0.002458747307842109, + 0.009978368214450204 + ], + linf=[ + 0.006341750448945582, + 0.010306014425485621, + 0.015207402553448324, + 0.010968264060799426, + 0.04745438898236998 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let @@ -48,8 +72,20 @@ end @test_trixi_include(joinpath(examples_dir(), "dgmulti_3d", "elixir_navierstokes_taylor_green_vortex.jl"), cells_per_dimension=(4, 4, 4), tspan=(0.0, 0.25), - l2 = [0.00018257125088549987, 0.015589736346235174, 0.015589736346235415, 0.021943924698669025, 0.019273688367502154], - linf = [0.0006268461326666142, 0.03218881686243058, 0.03218881686357877, 0.053872494644958, 0.05183811394229565]) + l2=[ + 0.00018257125088549987, + 0.015589736346235174, + 0.015589736346235415, + 0.021943924698669025, + 0.019273688367502154 + ], + linf=[ + 0.0006268461326666142, + 0.03218881686243058, + 0.03218881686357877, + 0.053872494644958, + 0.05183811394229565 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let From 37404641fec4ed0ee83aae9c70a95c708dc01438 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Thu, 14 Nov 2024 10:59:45 -0600 Subject: [PATCH 19/32] fix threaded CI test values --- test/test_threaded.jl | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/test/test_threaded.jl b/test/test_threaded.jl index c5ec85e3bb4..2e03662ada3 100644 --- a/test/test_threaded.jl +++ b/test/test_threaded.jl @@ -406,18 +406,9 @@ end @test_trixi_include(joinpath(examples_dir(), "dgmulti_2d", "elixir_euler_curved.jl"), alg=RDPK3SpFSAL49(thread = OrdinaryDiffEq.True()), - l2=[ - 1.7204593127904542e-5, - 1.5921547179522804e-5, - 1.5921547180107928e-5, - 4.894071422525737e-5 - ], - linf=[ - 0.00010525416930584619, - 0.00010003778091061122, - 0.00010003778085621029, - 0.00036426282101720275 - ]) + l2 = [1.720916434676505e-5, 1.5928649356300228e-5, 1.5928649356913923e-5, 4.896339454587786e-5], + linf = [0.00010525404319960963, 0.00010003768703459315, 0.00010003768696797977, 0.0003642622844073351] + ) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) From e3a7cd8cfc7f00b78cbca48f42d01959734c9390 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Thu, 14 Nov 2024 11:00:11 -0600 Subject: [PATCH 20/32] bump LinearAlgebra compat to fix threaded_legacy tests --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 4b90109eea4..4d8b6c59b70 100644 --- a/Project.toml +++ b/Project.toml @@ -79,7 +79,7 @@ FillArrays = "0.13.2, 1" ForwardDiff = "0.10.24" HDF5 = "0.16.10, 0.17" IfElse = "0.1" -LinearAlgebra = "1.10" +LinearAlgebra = "1.8.5, 1.10" LinearMaps = "2.7, 3.0" LoopVectorization = "0.12.151" MPI = "0.20.6" From 9e4701a07bdd4ed463978ec3a68ce70f1cf29501 Mon Sep 17 00:00:00 2001 From: Jesse Chan <1156048+jlchan@users.noreply.github.com> Date: Thu, 14 Nov 2024 11:02:35 -0600 Subject: [PATCH 21/32] Update test/test_threaded.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- test/test_threaded.jl | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/test_threaded.jl b/test/test_threaded.jl index 2e03662ada3..af312fb9b8b 100644 --- a/test/test_threaded.jl +++ b/test/test_threaded.jl @@ -406,9 +406,18 @@ end @test_trixi_include(joinpath(examples_dir(), "dgmulti_2d", "elixir_euler_curved.jl"), alg=RDPK3SpFSAL49(thread = OrdinaryDiffEq.True()), - l2 = [1.720916434676505e-5, 1.5928649356300228e-5, 1.5928649356913923e-5, 4.896339454587786e-5], - linf = [0.00010525404319960963, 0.00010003768703459315, 0.00010003768696797977, 0.0003642622844073351] - ) + l2=[ + 1.720916434676505e-5, + 1.5928649356300228e-5, + 1.5928649356913923e-5, + 4.896339454587786e-5 + ], + linf=[ + 0.00010525404319960963, + 0.00010003768703459315, + 0.00010003768696797977, + 0.0003642622844073351 + ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) From aeab87d5fe2b4b78f25d292206aeafc4812e1ba1 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Thu, 14 Nov 2024 12:21:16 -0600 Subject: [PATCH 22/32] unwrap VoA for jacobian computations --- src/semidiscretization/semidiscretization.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/semidiscretization/semidiscretization.jl b/src/semidiscretization/semidiscretization.jl index dd5c3c4791d..6a5efdcf7fe 100644 --- a/src/semidiscretization/semidiscretization.jl +++ b/src/semidiscretization/semidiscretization.jl @@ -277,6 +277,10 @@ function _jacobian_ad_forward(semi, t0, u0_ode, du_ode, config) return J end +# unpack u if it is wrapped in VectorOfArray (mainly for DGMulti solvers) +jacobian_ad_forward(semi::AbstractSemidiscretization, t0, u0_ode::VectorOfArray) = + jacobian_ad_forward(semi, t0, parent(u0_ode)) + # This version is specialized to `StructArray`s used by some `DGMulti` solvers. # We need to convert the numerical solution vectors since ForwardDiff cannot # handle arrays of `SVector`s. From 60e6ecf75d3f6d7f622b7163328ab9dccae6b513 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Thu, 14 Nov 2024 12:21:29 -0600 Subject: [PATCH 23/32] unwrap VoA for PlotData1D/PlotData2D --- src/visualization/types.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/visualization/types.jl b/src/visualization/types.jl index b294ce25607..b84e6e5fcd5 100644 --- a/src/visualization/types.jl +++ b/src/visualization/types.jl @@ -614,6 +614,12 @@ function PlotData1D(u, mesh::TreeMesh, equations, solver, cache; orientation_x) end +# unwrap u if it is VectorOfArray +PlotData1D(u::VectorOfArray, mesh, equations, dg::DGMulti{1}, cache; kwargs...) = + PlotData1D(parent(u), mesh, equations, dg, cache; kwargs...) +PlotData2D(u::VectorOfArray, mesh, equations, dg::DGMulti{2}, cache; kwargs...) = + PlotData2D(parent(u), mesh, equations, dg, cache; kwargs...) + function PlotData1D(u, mesh, equations, solver, cache; solution_variables = nothing, nvisnodes = nothing, slice = :x, point = (0.0, 0.0, 0.0), curve = nothing) From f5c96da89349bb98c83c8e5de22d50f909d39dde Mon Sep 17 00:00:00 2001 From: Jesse Chan <1156048+jlchan@users.noreply.github.com> Date: Thu, 14 Nov 2024 12:22:49 -0600 Subject: [PATCH 24/32] Update src/semidiscretization/semidiscretization.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/semidiscretization/semidiscretization.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/semidiscretization/semidiscretization.jl b/src/semidiscretization/semidiscretization.jl index 6a5efdcf7fe..f41c7ea4a7f 100644 --- a/src/semidiscretization/semidiscretization.jl +++ b/src/semidiscretization/semidiscretization.jl @@ -278,8 +278,9 @@ function _jacobian_ad_forward(semi, t0, u0_ode, du_ode, config) end # unpack u if it is wrapped in VectorOfArray (mainly for DGMulti solvers) -jacobian_ad_forward(semi::AbstractSemidiscretization, t0, u0_ode::VectorOfArray) = - jacobian_ad_forward(semi, t0, parent(u0_ode)) +jacobian_ad_forward(semi::AbstractSemidiscretization, t0, u0_ode::VectorOfArray) = jacobian_ad_forward(semi, + t0, + parent(u0_ode)) # This version is specialized to `StructArray`s used by some `DGMulti` solvers. # We need to convert the numerical solution vectors since ForwardDiff cannot From de4d78e30b52b8e88d90eb3fc5f95b124eb61ec4 Mon Sep 17 00:00:00 2001 From: Jesse Chan <1156048+jlchan@users.noreply.github.com> Date: Thu, 14 Nov 2024 12:22:58 -0600 Subject: [PATCH 25/32] Update src/visualization/types.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/visualization/types.jl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/visualization/types.jl b/src/visualization/types.jl index b84e6e5fcd5..cf7c9857730 100644 --- a/src/visualization/types.jl +++ b/src/visualization/types.jl @@ -615,10 +615,18 @@ function PlotData1D(u, mesh::TreeMesh, equations, solver, cache; end # unwrap u if it is VectorOfArray -PlotData1D(u::VectorOfArray, mesh, equations, dg::DGMulti{1}, cache; kwargs...) = - PlotData1D(parent(u), mesh, equations, dg, cache; kwargs...) -PlotData2D(u::VectorOfArray, mesh, equations, dg::DGMulti{2}, cache; kwargs...) = - PlotData2D(parent(u), mesh, equations, dg, cache; kwargs...) +PlotData1D(u::VectorOfArray, mesh, equations, dg::DGMulti{1}, cache; kwargs...) = PlotData1D(parent(u), + mesh, + equations, + dg, + cache; + kwargs...) +PlotData2D(u::VectorOfArray, mesh, equations, dg::DGMulti{2}, cache; kwargs...) = PlotData2D(parent(u), + mesh, + equations, + dg, + cache; + kwargs...) function PlotData1D(u, mesh, equations, solver, cache; solution_variables = nothing, nvisnodes = nothing, From 9f494c91b3b52737d364f36e7f2e3fe3cd4df110 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Thu, 14 Nov 2024 13:29:50 -0600 Subject: [PATCH 26/32] Unpack VoA for visualization test --- test/test_visualization.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/test_visualization.jl b/test/test_visualization.jl index 5c7e5dbbd1f..6cb91e6ee23 100644 --- a/test/test_visualization.jl +++ b/test/test_visualization.jl @@ -98,7 +98,12 @@ test_examples_2d = Dict("TreeMesh" => ("tree_2d_dgsem", semi = sol.prob.p if mesh == "DGMulti" - scalar_data = StructArrays.component(sol.u[end], 1) + if sol.u[end] isa VectorOfArray + u = parent(sol.u[end]) + else + u = sol.u[end] + end + scalar_data = StructArrays.component(u, 1) @test_nowarn_mod Plots.plot(ScalarPlotData2D(scalar_data, semi)) else cache = semi.cache From 181ac569aa7bc208be0a1c048f0c6ef988155788 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Thu, 14 Nov 2024 14:06:30 -0600 Subject: [PATCH 27/32] bump Julia compat and ci.yml to v1.10 --- .github/workflows/ci.yml | 6 +----- Project.toml | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c636ee8b0b..725cd348de9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,11 +81,7 @@ jobs: - mpi - threaded include: - - version: '1.8' - os: ubuntu-latest - arch: x64 - trixi_test: threaded_legacy - - version: '1.9' + - version: '1.10' os: ubuntu-latest arch: x64 trixi_test: threaded_legacy diff --git a/Project.toml b/Project.toml index 5aa81817d93..28b4562391c 100644 --- a/Project.toml +++ b/Project.toml @@ -115,7 +115,7 @@ TriplotBase = "0.1" TriplotRecipes = "0.1" TrixiBase = "0.1.3" UUIDs = "1.6" -julia = "1.8" +julia = "1.10" [extras] Convex = "f65535da-76fb-5f13-bab9-19810c17039a" From 27729ccaced3e89d2350f89d5bf57f9e94fd4f9a Mon Sep 17 00:00:00 2001 From: Jesse Chan <1156048+jlchan@users.noreply.github.com> Date: Thu, 14 Nov 2024 14:09:42 -0600 Subject: [PATCH 28/32] Update test/test_visualization.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- test/test_visualization.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_visualization.jl b/test/test_visualization.jl index 6cb91e6ee23..84730acd7f8 100644 --- a/test/test_visualization.jl +++ b/test/test_visualization.jl @@ -99,7 +99,7 @@ test_examples_2d = Dict("TreeMesh" => ("tree_2d_dgsem", semi = sol.prob.p if mesh == "DGMulti" if sol.u[end] isa VectorOfArray - u = parent(sol.u[end]) + u = parent(sol.u[end]) else u = sol.u[end] end From 025d9680de11c2fcdc620d5b7d2978625a63b282 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Thu, 14 Nov 2024 14:55:30 -0600 Subject: [PATCH 29/32] fix VoA in test_visualization --- test/test_visualization.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_visualization.jl b/test/test_visualization.jl index 84730acd7f8..dd7021e24ed 100644 --- a/test/test_visualization.jl +++ b/test/test_visualization.jl @@ -98,7 +98,7 @@ test_examples_2d = Dict("TreeMesh" => ("tree_2d_dgsem", semi = sol.prob.p if mesh == "DGMulti" - if sol.u[end] isa VectorOfArray + if sol.u[end] isa Trixi.VectorOfArray u = parent(sol.u[end]) else u = sol.u[end] From d7b70a6dc359a485f5113a0150c77551fa1e9849 Mon Sep 17 00:00:00 2001 From: Jesse Chan <1156048+jlchan@users.noreply.github.com> Date: Thu, 14 Nov 2024 19:54:15 -0600 Subject: [PATCH 30/32] Update test/test_dgmulti_3d.jl --- test/test_dgmulti_3d.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/test_dgmulti_3d.jl b/test/test_dgmulti_3d.jl index 74279dfffa0..cc9b855638e 100644 --- a/test/test_dgmulti_3d.jl +++ b/test/test_dgmulti_3d.jl @@ -366,11 +366,11 @@ end @trixi_testset "elixir_euler_fdsbp_periodic.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_fdsbp_periodic.jl"), l2=[ - 0.16917000223831077, - 0.1584186395735661, - 0.15841863957356606, - 0.15841863957356622, - 0.21512078067145463 + 7.561896970325353e-5, + 6.884047859361093e-5, + 6.884047859363204e-5, + 6.884047859361148e-5, + 0.000201107274617457 ], linf=[ 0.28301503739228906, From 8481581902c2cf56293fa0ae2d4670a5e0e05088 Mon Sep 17 00:00:00 2001 From: Jesse Chan <1156048+jlchan@users.noreply.github.com> Date: Thu, 14 Nov 2024 19:54:25 -0600 Subject: [PATCH 31/32] Update test/test_dgmulti_3d.jl --- test/test_dgmulti_3d.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/test_dgmulti_3d.jl b/test/test_dgmulti_3d.jl index cc9b855638e..33df79a4b38 100644 --- a/test/test_dgmulti_3d.jl +++ b/test/test_dgmulti_3d.jl @@ -373,11 +373,11 @@ end 0.000201107274617457 ], linf=[ - 0.28301503739228906, - 0.2938823666715491, - 0.2938823666715442, - 0.29388236667154466, - 0.3670612316913644 + 0.0001337520020225913, + 0.00011571467799287305, + 0.0001157146779990903, + 0.00011571467799376123, + 0.0003446082308800058 ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) From fdf1ff566847d87751caf7920d850b9833db85d0 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Thu, 14 Nov 2024 21:22:26 -0600 Subject: [PATCH 32/32] uncommenting precompile statement --- src/auxiliary/precompile.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/auxiliary/precompile.jl b/src/auxiliary/precompile.jl index f282caf99cc..3fa5f9575e7 100644 --- a/src/auxiliary/precompile.jl +++ b/src/auxiliary/precompile.jl @@ -382,10 +382,10 @@ function _precompile_manual_() # end # end @assert Base.precompile(Tuple{typeof(SummaryCallback)}) - # @assert Base.precompile(Tuple{DiscreteCallback{typeof(Trixi.summary_callback), - # typeof(Trixi.summary_callback), - # typeof(Trixi.initialize_summary_callback), - # typeof(SciMLBase.FINALIZE_DEFAULT)}}) + @assert Base.precompile(Tuple{DiscreteCallback{typeof(Trixi.summary_callback), + typeof(Trixi.summary_callback), + typeof(Trixi.initialize_summary_callback), + typeof(SciMLBase.FINALIZE_DEFAULT)}}) @assert Base.precompile(Tuple{typeof(summary_box), Base.TTY, String, Vector{Pair{String, Any}}}) # TODO: AMRCallback, ControllerThreeLevel, indicators