From 93c1f33314941b758d0c8bf94c857584e3eac5d1 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Mon, 23 Oct 2023 07:48:15 +0200 Subject: [PATCH 1/5] set version to v0.5.46 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 4efbc40b098..4053a54e206 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Trixi" uuid = "a7f1ee26-1774-49b1-8366-f1abc58fbfcb" authors = ["Michael Schlottke-Lakemper ", "Gregor Gassner ", "Hendrik Ranocha ", "Andrew R. Winters ", "Jesse Chan "] -version = "0.5.46-pre" +version = "0.5.46" [deps] CodeTracking = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2" From c2f0095a3c65fb075177721f3005a678a8b72826 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Mon, 23 Oct 2023 07:48:29 +0200 Subject: [PATCH 2/5] set development version to v0.5.47-pre --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 4053a54e206..48bb6b30182 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Trixi" uuid = "a7f1ee26-1774-49b1-8366-f1abc58fbfcb" authors = ["Michael Schlottke-Lakemper ", "Gregor Gassner ", "Hendrik Ranocha ", "Andrew R. Winters ", "Jesse Chan "] -version = "0.5.46" +version = "0.5.47-pre" [deps] CodeTracking = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2" From 6daf446fec1b3835fb1f1c6e32d89b955bfe0f82 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Mon, 23 Oct 2023 14:34:07 +0200 Subject: [PATCH 3/5] fix allocations in boundary condition of Euler double Mach elixir (#1685) --- examples/p4est_2d_dgsem/elixir_euler_double_mach_amr.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/p4est_2d_dgsem/elixir_euler_double_mach_amr.jl b/examples/p4est_2d_dgsem/elixir_euler_double_mach_amr.jl index 6d00aa91ba3..70a0e10c296 100644 --- a/examples/p4est_2d_dgsem/elixir_euler_double_mach_amr.jl +++ b/examples/p4est_2d_dgsem/elixir_euler_double_mach_amr.jl @@ -27,15 +27,15 @@ See Section IV c on the paper below for details. phi = pi / 6 sin_phi, cos_phi = sincos(phi) - rho = 8 + rho = 8.0 v1 = 8.25 * cos_phi v2 = -8.25 * sin_phi p = 116.5 else rho = 1.4 - v1 = 0 - v2 = 0 - p = 1 + v1 = 0.0 + v2 = 0.0 + p = 1.0 end prim = SVector(rho, v1, v2, p) From a0cf926a19e42f61938daf7feaf82154a6a86671 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Mon, 23 Oct 2023 16:59:37 +0200 Subject: [PATCH 4/5] fix type instability when iterating over callbacks in simple integrators (#1684) * fix type instability when iterating over callbacks in simple integrators * adapt remaining iterations over callbacks * Apply suggestions from code review Co-authored-by: Daniel Doehring --------- Co-authored-by: Daniel Doehring --- src/callbacks_step/save_solution.jl | 4 ++-- src/callbacks_step/summary.jl | 7 ++++--- src/time_integration/methods_2N.jl | 7 ++++--- src/time_integration/methods_3Sstar.jl | 7 ++++--- src/time_integration/methods_SSP.jl | 6 +++--- 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/callbacks_step/save_solution.jl b/src/callbacks_step/save_solution.jl index 31fe0e87c77..0092360cb20 100644 --- a/src/callbacks_step/save_solution.jl +++ b/src/callbacks_step/save_solution.jl @@ -211,11 +211,11 @@ end get_element_variables!(element_variables, u_ode, semi) callbacks = integrator.opts.callback if callbacks isa CallbackSet - for cb in callbacks.continuous_callbacks + foreach(callbacks.continuous_callbacks) do cb get_element_variables!(element_variables, u_ode, semi, cb; t = integrator.t, iter = iter) end - for cb in callbacks.discrete_callbacks + foreach(callbacks.discrete_callbacks) do cb get_element_variables!(element_variables, u_ode, semi, cb; t = integrator.t, iter = iter) end diff --git a/src/callbacks_step/summary.jl b/src/callbacks_step/summary.jl index 26981a58b73..566f2c03418 100644 --- a/src/callbacks_step/summary.jl +++ b/src/callbacks_step/summary.jl @@ -168,16 +168,17 @@ function initialize_summary_callback(cb::DiscreteCallback, u, t, integrator; callbacks = integrator.opts.callback if callbacks isa CallbackSet - for cb in callbacks.continuous_callbacks + foreach(callbacks.continuous_callbacks) do cb show(io_context, MIME"text/plain"(), cb) println(io, "\n") end - for cb in callbacks.discrete_callbacks + foreach(callbacks.discrete_callbacks) do cb # Do not show ourselves - cb.affect! === summary_callback && continue + cb.affect! === summary_callback && return nothing show(io_context, MIME"text/plain"(), cb) println(io, "\n") + return nothing end else show(io_context, MIME"text/plain"(), callbacks) diff --git a/src/time_integration/methods_2N.jl b/src/time_integration/methods_2N.jl index 557e8272128..d2f22679c4f 100644 --- a/src/time_integration/methods_2N.jl +++ b/src/time_integration/methods_2N.jl @@ -119,10 +119,10 @@ function solve(ode::ODEProblem, alg::T; # initialize callbacks if callback isa CallbackSet - for cb in callback.continuous_callbacks + foreach(callback.continuous_callbacks) do cb error("unsupported") end - for cb in callback.discrete_callbacks + foreach(callback.discrete_callbacks) do cb cb.initialize(cb, integrator.u, integrator.t, integrator) end elseif !isnothing(callback) @@ -172,10 +172,11 @@ function solve!(integrator::SimpleIntegrator2N) # handle callbacks if callbacks isa CallbackSet - for cb in callbacks.discrete_callbacks + foreach(callbacks.discrete_callbacks) do cb if cb.condition(integrator.u, integrator.t, integrator) cb.affect!(integrator) end + return nothing end end diff --git a/src/time_integration/methods_3Sstar.jl b/src/time_integration/methods_3Sstar.jl index 03232c04122..b0ce5930514 100644 --- a/src/time_integration/methods_3Sstar.jl +++ b/src/time_integration/methods_3Sstar.jl @@ -189,10 +189,10 @@ function solve(ode::ODEProblem, alg::T; # initialize callbacks if callback isa CallbackSet - for cb in callback.continuous_callbacks + foreach(callback.continuous_callbacks) do cb error("unsupported") end - for cb in callback.discrete_callbacks + foreach(callback.discrete_callbacks) do cb cb.initialize(cb, integrator.u, integrator.t, integrator) end elseif !isnothing(callback) @@ -248,10 +248,11 @@ function solve!(integrator::SimpleIntegrator3Sstar) # handle callbacks if callbacks isa CallbackSet - for cb in callbacks.discrete_callbacks + foreach(callbacks.discrete_callbacks) do cb if cb.condition(integrator.u, integrator.t, integrator) cb.affect!(integrator) end + return nothing end end diff --git a/src/time_integration/methods_SSP.jl b/src/time_integration/methods_SSP.jl index 5b72682d48e..6424dde7d31 100644 --- a/src/time_integration/methods_SSP.jl +++ b/src/time_integration/methods_SSP.jl @@ -124,10 +124,10 @@ function solve(ode::ODEProblem, alg = SimpleSSPRK33()::SimpleAlgorithmSSP; # initialize callbacks if callback isa CallbackSet - for cb in callback.continuous_callbacks + foreach(callback.continuous_callbacks) do cb error("unsupported") end - for cb in callback.discrete_callbacks + foreach(callback.discrete_callbacks) do cb cb.initialize(cb, integrator.u, integrator.t, integrator) end elseif !isnothing(callback) @@ -184,7 +184,7 @@ function solve!(integrator::SimpleIntegratorSSP) # handle callbacks if callbacks isa CallbackSet - for cb in callbacks.discrete_callbacks + foreach(callbacks.discrete_callbacks) do cb if cb.condition(integrator.u, integrator.t, integrator) cb.affect!(integrator) end From e90026244079270008594450ebfea2ed8d33c333 Mon Sep 17 00:00:00 2001 From: Daniel Doehring Date: Tue, 24 Oct 2023 07:23:13 +0200 Subject: [PATCH 5/5] Add timer for outer RK loop for SSPRK33 (#1686) * Add timer for outer RK loop * Increase alloc check --------- Co-authored-by: Hendrik Ranocha --- src/time_integration/methods_SSP.jl | 2 +- test/test_tree_2d_euler.jl | 2 +- test/test_tree_2d_eulermulti.jl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/time_integration/methods_SSP.jl b/src/time_integration/methods_SSP.jl index 6424dde7d31..733f89c2158 100644 --- a/src/time_integration/methods_SSP.jl +++ b/src/time_integration/methods_SSP.jl @@ -148,7 +148,7 @@ function solve!(integrator::SimpleIntegratorSSP) callbacks = integrator.opts.callback integrator.finalstep = false - while !integrator.finalstep + @trixi_timeit timer() "main loop" while !integrator.finalstep if isnan(integrator.dt) error("time step size `dt` is NaN") end diff --git a/test/test_tree_2d_euler.jl b/test/test_tree_2d_euler.jl index 660e4dcf1be..79a650ded8a 100644 --- a/test/test_tree_2d_euler.jl +++ b/test/test_tree_2d_euler.jl @@ -137,7 +137,7 @@ EXAMPLES_DIR = pkgdir(Trixi, "examples", "tree_2d_dgsem") 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 + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 15000 end end diff --git a/test/test_tree_2d_eulermulti.jl b/test/test_tree_2d_eulermulti.jl index c38c78ba6fd..c454a6bcfbf 100644 --- a/test/test_tree_2d_eulermulti.jl +++ b/test/test_tree_2d_eulermulti.jl @@ -44,7 +44,7 @@ EXAMPLES_DIR = pkgdir(Trixi, "examples", "tree_2d_dgsem") 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 + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 15000 end end