From 63c625824c3d510611dcebba12a0319d7e9cad9a Mon Sep 17 00:00:00 2001 From: Daniel Doehring Date: Fri, 10 Nov 2023 07:28:45 +0100 Subject: [PATCH 1/4] Fix bug (#1719) --- src/equations/compressible_euler_2d.jl | 2 +- test/test_p4est_2d.jl | 16 ++++++++-------- test/test_unit.jl | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/equations/compressible_euler_2d.jl b/src/equations/compressible_euler_2d.jl index 6c8f2e1e848..a992f99eaf4 100644 --- a/src/equations/compressible_euler_2d.jl +++ b/src/equations/compressible_euler_2d.jl @@ -1351,7 +1351,7 @@ of the numerical flux. v1_roe = (sqrt_rho_ll * v1_ll + sqrt_rho_rr * v1_rr) * inv_sum_sqrt_rho v2_roe = (sqrt_rho_ll * v2_ll + sqrt_rho_rr * v2_rr) * inv_sum_sqrt_rho v_roe = v1_roe * normal_direction[1] + v2_roe * normal_direction[2] - v_roe_mag = (v1_roe * normal_direction[1])^2 + (v2_roe * normal_direction[2])^2 + v_roe_mag = v1_roe^2 + v2_roe^2 H_roe = (sqrt_rho_ll * H_ll + sqrt_rho_rr * H_rr) * inv_sum_sqrt_rho c_roe = sqrt((equations.gamma - 1) * (H_roe - 0.5 * v_roe_mag)) * norm_ diff --git a/test/test_p4est_2d.jl b/test/test_p4est_2d.jl index 546e5bff8a6..07c6d02bbcd 100644 --- a/test/test_p4est_2d.jl +++ b/test/test_p4est_2d.jl @@ -203,16 +203,16 @@ end @trixi_testset "elixir_euler_sedov.jl (HLLE)" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_sedov.jl"), l2=[ - 0.411541263324004, - 0.2558929632770186, - 0.2558929632770193, - 1.298715766843915, + 0.40853279043747015, + 0.25356771650524296, + 0.2535677165052422, + 1.2984601729572691, ], linf=[ - 1.3457201726152221, - 1.3138961427140758, - 1.313896142714079, - 6.293305112638921, + 1.3840909333784284, + 1.3077772519086124, + 1.3077772519086157, + 6.298798630968632, ], surface_flux=flux_hlle, tspan=(0.0, 0.3)) diff --git a/test/test_unit.jl b/test/test_unit.jl index a73dfab5504..29390161ebe 100644 --- a/test/test_unit.jl +++ b/test/test_unit.jl @@ -1191,7 +1191,7 @@ end u_values = [SVector(1.0, 0.5, -0.7, 1.0), SVector(1.5, -0.2, 0.1, 5.0)] fluxes = [flux_central, flux_ranocha, flux_shima_etal, flux_kennedy_gruber, - flux_hll, FluxHLL(min_max_speed_davis)] + flux_hll, FluxHLL(min_max_speed_davis), flux_hlle] for f_std in fluxes f_rot = FluxRotated(f_std) @@ -1215,7 +1215,7 @@ end SVector(1.5, -0.2, 0.1, 0.2, 5.0)] fluxes = [flux_central, flux_ranocha, flux_shima_etal, flux_kennedy_gruber, FluxLMARS(340), - flux_hll, FluxHLL(min_max_speed_davis)] + flux_hll, FluxHLL(min_max_speed_davis), flux_hlle] for f_std in fluxes f_rot = FluxRotated(f_std) From 910df76691685040cd46ed661253f7348cb35344 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Fri, 10 Nov 2023 07:44:38 +0100 Subject: [PATCH 2/4] fix IndicatorMax with multi-threading on ARM (#1723) --- src/solvers/dgsem_tree/indicators_1d.jl | 3 ++- src/solvers/dgsem_tree/indicators_2d.jl | 3 ++- src/solvers/dgsem_tree/indicators_3d.jl | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/solvers/dgsem_tree/indicators_1d.jl b/src/solvers/dgsem_tree/indicators_1d.jl index 8b57348861c..40bfd1e98c7 100644 --- a/src/solvers/dgsem_tree/indicators_1d.jl +++ b/src/solvers/dgsem_tree/indicators_1d.jl @@ -289,6 +289,7 @@ function (indicator_max::IndicatorMax)(u::AbstractArray{<:Any, 3}, kwargs...) @unpack alpha, indicator_threaded = indicator_max.cache resize!(alpha, nelements(dg, cache)) + indicator_variable = indicator_max.variable @threaded for element in eachelement(dg, cache) indicator = indicator_threaded[Threads.threadid()] @@ -296,7 +297,7 @@ function (indicator_max::IndicatorMax)(u::AbstractArray{<:Any, 3}, # Calculate indicator variables at Gauss-Lobatto nodes for i in eachnode(dg) u_local = get_node_vars(u, equations, dg, i, element) - indicator[i] = indicator_max.variable(u_local, equations) + indicator[i] = indicator_variable(u_local, equations) end alpha[element] = maximum(indicator) diff --git a/src/solvers/dgsem_tree/indicators_2d.jl b/src/solvers/dgsem_tree/indicators_2d.jl index 2f34e0eb661..da81b2a1d36 100644 --- a/src/solvers/dgsem_tree/indicators_2d.jl +++ b/src/solvers/dgsem_tree/indicators_2d.jl @@ -323,6 +323,7 @@ function (indicator_max::IndicatorMax)(u::AbstractArray{<:Any, 4}, kwargs...) @unpack alpha, indicator_threaded = indicator_max.cache resize!(alpha, nelements(dg, cache)) + indicator_variable = indicator_max.variable @threaded for element in eachelement(dg, cache) indicator = indicator_threaded[Threads.threadid()] @@ -330,7 +331,7 @@ function (indicator_max::IndicatorMax)(u::AbstractArray{<:Any, 4}, # Calculate indicator variables at Gauss-Lobatto nodes for j in eachnode(dg), i in eachnode(dg) u_local = get_node_vars(u, equations, dg, i, j, element) - indicator[i, j] = indicator_max.variable(u_local, equations) + indicator[i, j] = indicator_variable(u_local, equations) end alpha[element] = maximum(indicator) diff --git a/src/solvers/dgsem_tree/indicators_3d.jl b/src/solvers/dgsem_tree/indicators_3d.jl index 69041ed1298..40362889397 100644 --- a/src/solvers/dgsem_tree/indicators_3d.jl +++ b/src/solvers/dgsem_tree/indicators_3d.jl @@ -234,6 +234,7 @@ function (indicator_max::IndicatorMax)(u::AbstractArray{<:Any, 5}, kwargs...) @unpack alpha, indicator_threaded = indicator_max.cache resize!(alpha, nelements(dg, cache)) + indicator_variable = indicator_max.variable @threaded for element in eachelement(dg, cache) indicator = indicator_threaded[Threads.threadid()] @@ -241,7 +242,7 @@ function (indicator_max::IndicatorMax)(u::AbstractArray{<:Any, 5}, # Calculate indicator variables at Gauss-Lobatto nodes for k in eachnode(dg), j in eachnode(dg), i in eachnode(dg) u_local = get_node_vars(u, equations, dg, i, j, k, element) - indicator[i, j, k] = indicator_max.variable(u_local, equations) + indicator[i, j, k] = indicator_variable(u_local, equations) end alpha[element] = maximum(indicator) From 9a00184c6ca656ce2fab4c8600bc837883a02b06 Mon Sep 17 00:00:00 2001 From: Daniel Doehring Date: Fri, 10 Nov 2023 07:46:35 +0100 Subject: [PATCH 3/4] Remove AMR CB from HLLE 2D Tree test (#1720) * remove amr cb * fmt --- test/test_tree_2d_euler.jl | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/test/test_tree_2d_euler.jl b/test/test_tree_2d_euler.jl index db36cb7d79f..93490f8ae09 100644 --- a/test/test_tree_2d_euler.jl +++ b/test/test_tree_2d_euler.jl @@ -425,19 +425,22 @@ end @trixi_testset "elixir_euler_sedov_blast_wave.jl (HLLE)" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_sedov_blast_wave.jl"), l2=[ - 0.35267161504176747, - 0.17218309138797958, - 0.17218307467125854, - 0.6236143054619037, + 0.352405949321075, + 0.17207721487429464, + 0.17207721487433883, + 0.6263024434020885, ], linf=[ - 2.77484045816607, - 1.8281111268370718, - 1.8281110470490887, - 6.24263735888126, + 2.760997358628186, + 1.8279186132509326, + 1.8279186132502805, + 6.251573757093399, ], tspan=(0.0, 0.5), - surface_flux=flux_hlle) + callbacks=CallbackSet(summary_callback, + analysis_callback, alive_callback, + stepsize_callback), + surface_flux=flux_hlle), # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let From cb8181f6e5ae2fa74054ab227b2e19a393edcee0 Mon Sep 17 00:00:00 2001 From: Patrick Ersing <114223904+patrickersing@users.noreply.github.com> Date: Fri, 10 Nov 2023 15:59:07 +0100 Subject: [PATCH 4/4] Fix the wet/dry test for SWE (#1727) * Adjust tolerance to fix wet_dry test * apply formatter --- test/test_tree_1d_shallowwater.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test_tree_1d_shallowwater.jl b/test/test_tree_1d_shallowwater.jl index 658f178c941..7ec3089d33a 100644 --- a/test/test_tree_1d_shallowwater.jl +++ b/test/test_tree_1d_shallowwater.jl @@ -109,7 +109,9 @@ end 2.2447689894899726e-13, 1.9999999999999714, ], - tspan=(0.0, 0.25)) + tspan=(0.0, 0.25), + # Soften the tolerance as test results vary between different CPUs + atol=1000 * eps()) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities) let