Skip to content

Commit

Permalink
feat: implement initialization for GeneralizedDFSaneCache
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Dec 5, 2024
1 parent 0377273 commit 0cd0037
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/NonlinearSolveSpectralMethods/src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ end
retcode::ReturnCode.T
force_stop::Bool
kwargs

initializealg
end

function InternalAPI.reinit_self!(
Expand Down Expand Up @@ -112,7 +114,7 @@ function SciMLBase.__init(
prob::AbstractNonlinearProblem, alg::GeneralizedDFSane, args...;
stats = NLStats(0, 0, 0, 0, 0), alias_u0 = false, maxiters = 1000,
abstol = nothing, reltol = nothing, termination_condition = nothing,
maxtime = nothing, kwargs...
maxtime = nothing, initializealg = NonlinearSolveBase.NonlinearSolveDefaultInit(), kwargs...
)
timer = get_timer_output()

Expand Down Expand Up @@ -145,13 +147,16 @@ function SciMLBase.__init(
σ_n = T(alg.σ_1)
end

return GeneralizedDFSaneCache(
cache = GeneralizedDFSaneCache(
fu, fu_cache, u, u_cache, prob.p, du, alg, prob,
σ_n, T(alg.σ_min), T(alg.σ_max),
linesearch_cache, stats, 0, maxiters, maxtime, timer, 0.0,
tc_cache, trace, ReturnCode.Default, false, kwargs
tc_cache, trace, ReturnCode.Default, false, kwargs, initializealg,
)
end

NonlinearSolveBase.initialize_cache!(cache)
return cache
end

function InternalAPI.step!(
Expand Down

0 comments on commit 0cd0037

Please sign in to comment.