Skip to content

Commit 23f113d

Browse files
Merge #125
125: Do not allocate T_imp cache if nothing r=charleskawczynski a=charleskawczynski This PR fixes the cache allocation when `T_imp!` is `nothing`, a peel off from #115. Co-authored-by: Charles Kawczynski <[email protected]>
2 parents 4f05304 + 06321be commit 23f113d

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
@@ -66,7 +66,7 @@ function cache(prob::DiffEqBase.AbstractODEProblem, alg::IMEXARKAlgorithm; kwarg
6666
γs = unique(filter(!iszero, diag(a_imp)))
6767
γ = length(γs) == 1 ? γs[1] : nothing # TODO: This could just be a constant.
6868
jac_prototype = has_jac(T_imp!) ? T_imp!.jac_prototype : nothing
69-
newtons_method_cache = allocate_cache(newtons_method, u0, jac_prototype)
69+
newtons_method_cache = isnothing(T_imp!) ? nothing : allocate_cache(newtons_method, u0, jac_prototype)
7070
return IMEXARKCache(U, T_lim, T_exp, T_imp, temp, γ, newtons_method_cache)
7171
end
7272

0 commit comments

Comments
 (0)