Skip to content

Commit

Permalink
apply absolute value function (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickersing authored Aug 21, 2024
1 parent 846f4a1 commit 7e1d491
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/equations/shallow_water_exner_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7e1d491

Please sign in to comment.