From 0a6fe51a2a646e7d6a254658f95ef68e9d73316a Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Mon, 11 Dec 2023 22:00:13 -0500 Subject: [PATCH] Remove uses of NLsolve --- Project.toml | 4 ---- src/initialize_dae.jl | 7 +++---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Project.toml b/Project.toml index e4e0560ea9..74e4f96af8 100644 --- a/Project.toml +++ b/Project.toml @@ -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" @@ -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" @@ -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" @@ -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" diff --git a/src/initialize_dae.jl b/src/initialize_dae.jl index af4f96ceae..9f8bde7788 100644 --- a/src/initialize_dae.jl +++ b/src/initialize_dae.jl @@ -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 @@ -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)