From 7e1d491752f8cf3c56d9bc03a89d048d0f3a88b9 Mon Sep 17 00:00:00 2001 From: Patrick Ersing <114223904+patrickersing@users.noreply.github.com> Date: Wed, 21 Aug 2024 11:33:32 +0200 Subject: [PATCH] apply absolute value function (#55) --- src/equations/shallow_water_exner_1d.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/equations/shallow_water_exner_1d.jl b/src/equations/shallow_water_exner_1d.jl index 3aa34c9..cf77759 100644 --- a/src/equations/shallow_water_exner_1d.jl +++ b/src/equations/shallow_water_exner_1d.jl @@ -469,11 +469,12 @@ end @inline function Trixi.max_abs_speed_naive(u_ll, u_rr, orientation::Integer, equations::ShallowWaterExnerEquations1D) - return max(eigvals_cardano(u_rr, equations)..., eigvals_cardano(u_ll, equations)...) + return max(maximum(abs, eigvals_cardano(u_rr, equations)), + maximum(abs, eigvals_cardano(u_ll, equations))) end @inline function Trixi.max_abs_speeds(u, equations::ShallowWaterExnerEquations1D) - return maximum(eigvals_cardano(u, equations)) + return maximum(abs, eigvals_cardano(u, equations)) end #Helper function to extract the velocity vector from the conservative variables