Skip to content

Commit

Permalink
Remove uses of NLsolve
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Dec 12, 2023
1 parent 80e0201 commit 0a6fe51
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 0 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
LoopVectorization = "bdcacae8-1622-11e9-2a5c-532679323890"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
MuladdMacro = "46d2c3a1-f734-5fdb-9937-b9b9aeba4221"
NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56"
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
Polyester = "f517fe37-dbe3-4b94-8317-1923a5111588"
PreallocationTools = "d236fae5-4411-538c-8e31-a6e3d9e00b46"
Expand All @@ -35,7 +34,6 @@ Preferences = "21216c6a-2e73-6563-6e65-726566657250"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
SciMLNLSolve = "e9a6253c-8580-4d32-9898-8661bb511710"
SciMLOperators = "c0aeaf25-5076-4817-a8d5-81caf7dfa961"
SimpleNonlinearSolve = "727e6d20-b764-4bd8-a329-72de5adea6c7"
SimpleUnPack = "ce78b400-467f-4804-87d8-8f486da07d0a"
Expand Down Expand Up @@ -68,7 +66,6 @@ Logging = "1.9"
LoopVectorization = "0.12"
MacroTools = "0.5"
MuladdMacro = "0.2.1"
NLsolve = "4.3"
NonlinearSolve = "3"
Polyester = "0.7"
PreallocationTools = "0.4"
Expand All @@ -77,7 +74,6 @@ Preferences = "1.3"
RecursiveArrayTools = "2.36"
Reexport = "1.0"
SciMLBase = "2"
SciMLNLSolve = "0.1"
SciMLOperators = "0.3"
SimpleNonlinearSolve = "1"
SimpleUnPack = "1"
Expand Down
7 changes: 3 additions & 4 deletions src/initialize_dae.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ function BrownFullBasicInit(; abstol = 1e-10, nlsolve = nothing)
end
BrownFullBasicInit(abstol) = BrownFullBasicInit(; abstol = abstol, nlsolve = nothing)

using SciMLNLSolve
default_nlsolve(alg, isinplace, u, autodiff = false) = alg
function default_nlsolve(::Nothing, isinplace, u, autodiff = false)
NLSolveJL(autodiff = autodiff ? :forward : :central)
TrustRegion(; autodiff = autodiff ? AutoForwardDiff() : AutoFiniteDiff())
end
function default_nlsolve(::Nothing, isinplace::Val{false}, u::StaticArray, autodiff = false)
SimpleNewtonRaphson(autodiff = autodiff)
SimpleNewtonRaphson(autodiff = autodiff ? AutoForwardDiff() : AutoFiniteDiff())
end

## Notes
Expand Down Expand Up @@ -564,7 +563,7 @@ function _initialize_dae!(integrator, prob::DAEProblem,
if alg.nlsolve !== nothing
nlsolve = alg.nlsolve
else
nlsolve = NewtonRaphson(autodiff = isAD)
nlsolve = NewtonRaphson(autodiff = alg_autodiff(integrator.alg))
end

nlfunc = NonlinearFunction(nlequation!; jac_prototype = f.jac_prototype)
Expand Down

0 comments on commit 0a6fe51

Please sign in to comment.