From 76386593c716a5cdb1b6f1052662f4519f8dc271 Mon Sep 17 00:00:00 2001 From: Michael Schlottke-Lakemper Date: Fri, 20 Dec 2024 11:29:07 +0100 Subject: [PATCH] Use recommended approach for treating `equations` as a scalar in broadcasting x-ref: https://github.com/trixi-framework/Trixi.jl/pull/2214/files/550e2e25321048c013bb908dcfe129f4ad824d22#r1893474496 --- src/equations/equations.jl | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/equations/equations.jl b/src/equations/equations.jl index 3f5be3fe84..9e88ac2454 100644 --- a/src/equations/equations.jl +++ b/src/equations/equations.jl @@ -87,15 +87,8 @@ end @inline Base.ndims(::AbstractEquations{NDIMS}) where {NDIMS} = NDIMS -# TODO: @ranocha may this be removed? # Equations act like scalars in broadcasting. -# Using `Ref(equations)` would be more convenient in some circumstances. -# However, this does not work with Julia v1.9.3 correctly due to a (performance) -# bug in Julia, see -# - https://github.com/trixi-framework/Trixi.jl/pull/1618 -# - https://github.com/JuliaLang/julia/issues/51118 -# Thus, we use the workaround below. -Base.broadcastable(equations::AbstractEquations) = (equations,) +Base.broadcastable(equations::AbstractEquations) = Ref(equations) """ flux(u, orientation_or_normal, equations)