Skip to content

Commit

Permalink
Fix allocations due to non-specialized routine
Browse files Browse the repository at this point in the history
  • Loading branch information
bennibolm committed Mar 1, 2024
1 parent a3472e5 commit 05ed2fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/solvers/dgsem_tree/subcell_limiters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function SubcellLimiterIDP(equations::AbstractEquations, basis;
positivity = (length(positivity_variables_cons) +
length(positivity_variables_nonlinear) > 0)

# When passing `min` or `max` in the elixir the specific function of Base is used.
# When passing `min` or `max` in the elixir, the specific function of Base is used.
# To speed up the simulation, we replace it with `Trixi.min` and `Trixi.max` respectively.
local_onesided_variables_nonlinear_ = Tuple{Function, Function}[]
for (variable, min_or_max) in local_onesided_variables_nonlinear
Expand All @@ -110,6 +110,7 @@ function SubcellLimiterIDP(equations::AbstractEquations, basis;
error("Parameter $min_or_max is not a valid input. Use `max` or `min` instead.")
end
end
local_onesided_variables_nonlinear_ = Tuple(local_onesided_variables_nonlinear_)

local_twosided_variables_cons_ = get_variable_index.(local_twosided_variables_cons,
equations)
Expand Down
2 changes: 1 addition & 1 deletion src/solvers/dgsem_tree/subcell_limiters_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ end
# Local one-sided limiting of nonlinear variables

@inline function idp_local_onesided!(alpha, limiter, u, t, dt, semi)
for (variable, min_or_max) in limiter.local_onesided_variables_nonlinear
foreach(limiter.local_onesided_variables_nonlinear) do (variable, min_or_max)
idp_local_onesided!(alpha, limiter, u, t, dt, semi, variable, min_or_max)
end

Expand Down

0 comments on commit 05ed2fd

Please sign in to comment.