Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change solve to lower level interface __solve #77

Merged
merged 1 commit into from
Jul 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions src/solve.jl
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
function SciMLBase.solve(prob::NonlinearProblem,
alg::AbstractNonlinearSolveAlgorithm, args...;
kwargs...)
function SciMLBase.__solve(prob::NonlinearProblem,
alg::AbstractNonlinearSolveAlgorithm, args...;
kwargs...)
solver = init(prob, alg, args...; kwargs...)
sol = solve!(solver)
end

function SciMLBase.init(prob::NonlinearProblem{uType, iip},
alg::AbstractBracketingAlgorithm, args...;
alias_u0 = false,
maxiters = 1000,
kwargs...) where {uType, iip}
function SciMLBase.__init(prob::NonlinearProblem{uType, iip},
alg::AbstractBracketingAlgorithm, args...;
alias_u0 = false,
maxiters = 1000,
kwargs...) where {uType, iip}
if !(prob.u0 isa Tuple)
error("You need to pass a tuple of u0 in bracketing algorithms.")
end
Expand All @@ -32,13 +32,13 @@ function SciMLBase.init(prob::NonlinearProblem{uType, iip},
DEFAULT, cache, iip, prob)
end

function SciMLBase.init(prob::NonlinearProblem{uType, iip}, alg::AbstractNewtonAlgorithm,
args...;
alias_u0 = false,
maxiters = 1000,
tol = 1e-6,
internalnorm = DEFAULT_NORM,
kwargs...) where {uType, iip}
function SciMLBase.__init(prob::NonlinearProblem{uType, iip}, alg::AbstractNewtonAlgorithm,
args...;
alias_u0 = false,
maxiters = 1000,
tol = 1e-6,
internalnorm = DEFAULT_NORM,
kwargs...) where {uType, iip}
if alias_u0
u = prob.u0
else
Expand Down