Skip to content

Commit ba57b46

Browse files
Merge #232
232: Eliminate a call to `lim!` r=charleskawczynski a=charleskawczynski While working on the limiters, it occurred to me that when we have limiters with `i = 1` in the ARK method: ```julia `@.` U = u for j in 1:(i - 1) iszero(a_exp[i, j]) && continue `@.` U += dt * a_exp[i, j] * T_lim[j] end lim!(U, p, t_exp, u) ``` we have ```julia `@.` U = u lim!(U, p, t_exp, u) ``` and I think that, since `u` is just a copy of `U`, `lim!(U, p, t_exp, u)` will do nothing (based on the existing implementation with automatically computing bounds). Therefore, we can eliminate this call (for `i = 1`). Doing this optimization of course assumes that `lim!(U, p, t_exp, U)` does nothing, and this will be wrong if later we decide that it should do something. However, it's not clear to me that we will need to/want to change it. Co-authored-by: Charles Kawczynski <[email protected]>
2 parents 6839f2e + 5749a92 commit ba57b46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/solvers/imex_ark.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function step_u!(integrator, cache::IMEXARKCache)
7979
iszero(a_exp[i, j]) && continue
8080
@. U += dt * a_exp[i, j] * T_lim[j]
8181
end
82-
lim!(U, p, t_exp, u)
82+
i 1 && lim!(U, p, t_exp, u)
8383
end
8484

8585
if !isnothing(T_exp!) # Update based on explicit tendencies from previous stages

0 commit comments

Comments
 (0)