@@ -56,7 +56,7 @@ function initialize!(nlsolver::NLSolver{<:NonlinearSolveAlg, true},
5656 cache. invγdt = inv (dt * nlsolver. γ)
5757 cache. tstep = integrator. t + nlsolver. c * dt
5858
59- @unpack ustep, tstep, k, invγdt = cache
59+ @unpack ustep, atmp, tstep, k, invγdt = cache
6060
6161 if SciMLBase. has_stats (integrator)
6262 integrator. stats. nf += cache. cache. stats. nf
@@ -66,25 +66,25 @@ function initialize!(nlsolver::NLSolver{<:NonlinearSolveAlg, true},
6666
6767 nlstep_data = f. nlstep_data
6868 if nlstep_data != = nothing
69+ atmp .= 0
6970 if method === COEFFICIENT_MULTISTEP
7071 nlstep_data. set_γ_c (nlstep_data. nlprob, (one (t), one (t), α * invγdt, tstep))
71- nlstep_data. set_inner_tmp (nlstep_data. nlprob, zero (z) )
72+ nlstep_data. set_inner_tmp (nlstep_data. nlprob, atmp )
7273 nlstep_data. set_outer_tmp (nlstep_data. nlprob, tmp)
7374 else
7475 nlstep_data. set_γ_c (nlstep_data. nlprob, (dt, γ, one (t), tstep))
7576 nlstep_data. set_inner_tmp (nlstep_data. nlprob, tmp)
76- nlstep_data. set_outer_tmp (nlstep_data. nlprob, zero (z) )
77+ nlstep_data. set_outer_tmp (nlstep_data. nlprob, atmp )
7778 end
7879 nlstep_data. nlprob. u0 .= @view z[nlstep_data. u0perm]
79- cache. cache = init ( nlstep_data. nlprob, alg . alg )
80+ SciMLBase . reinit! ( cache. cache, nlstep_data. nlprob. u0, p = nlstep_data . nlprob . p )
8081 else
8182 if f isa DAEFunction
8283 nlp_params = (tmp, ztmp, ustep, γ, α, tstep, k, invγdt, p, dt, f)
8384 else
8485 nlp_params = (tmp, ustep, γ, α, tstep, k, invγdt, method, p, dt, f)
8586 end
86- new_prob = remake (cache. prob, p = nlp_params, u0 = z)
87- cache. cache = init (new_prob, alg. alg)
87+ SciMLBase. reinit! (cache. cache, z, p= nlp_params)
8888 end
8989 nothing
9090end
127127 nlcache. prob, nlcache. alg, nlcache. u, nlcache. fu;
128128 nlcache. retcode, nlcache. stats, nlcache. trace
129129 )
130- ztmp . = nlstep_data. nlprobmap (nlstepsol)
130+ nlstep_data. nlprobmap (ztmp, nlstepsol)
131131 ustep = compute_ustep! (ustep, tmp, γ, z, method)
132132 calculate_residuals! (@view (atmp[nlstep_data. u0perm]), nlcache. fu,
133133 @view (uprev[nlstep_data. u0perm]),
0 commit comments