Skip to content

Commit 63b5189

Browse files
Merge pull request #2460 from SciML/hotfix
Hotfix precompilation with initialization movement
2 parents 5bb0876 + b88f62f commit 63b5189

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

lib/OrdinaryDiffEqCore/src/initialize_dae.jl

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,20 +111,30 @@ default_nlsolve(alg, isinplace, u, initprob, autodiff = false) = alg
111111

112112
## If the initialization is trivial just use nothing alg
113113
function default_nlsolve(
114-
::Nothing, isinplace, u::Nothing, ::NonlinearProblem, autodiff = false)
114+
::Nothing, isinplace::Val{true}, u::Nothing, ::NonlinearProblem, autodiff = false)
115115
nothing
116116
end
117117

118118
function default_nlsolve(
119-
::Nothing, isinplace, u::Nothing, ::NonlinearLeastSquaresProblem, autodiff = false)
119+
::Nothing, isinplace::Val{true}, u::Nothing, ::NonlinearLeastSquaresProblem, autodiff = false)
120120
nothing
121121
end
122122

123-
function OrdinaryDiffEqCore.default_nlsolve(::Nothing, isinplace::Val{true}, u, ::NonlinearProblem, autodiff = false)
123+
function default_nlsolve(
124+
::Nothing, isinplace::Val{false}, u::Nothing, ::NonlinearProblem, autodiff = false)
125+
nothing
126+
end
127+
128+
function default_nlsolve(
129+
::Nothing, isinplace::Val{false}, u::Nothing, ::NonlinearLeastSquaresProblem, autodiff = false)
130+
nothing
131+
end
132+
133+
function OrdinaryDiffEqCore.default_nlsolve(::Nothing, isinplace, u, ::NonlinearProblem, autodiff = false)
124134
error("This ODE requires a DAE initialization and thus a nonlinear solve but no nonlinear solve has been loaded. To solve this problem, do `using OrdinaryDiffEqNonlinearSolve` or pass a custom `nlsolve` choice into the `initializealg`.")
125135
end
126136

127-
function OrdinaryDiffEqCore.default_nlsolve(::Nothing, isinplace::Val{true}, u, ::NonlinearLeastSquaresProblem, autodiff = false)
137+
function OrdinaryDiffEqCore.default_nlsolve(::Nothing, isinplace, u, ::NonlinearLeastSquaresProblem, autodiff = false)
128138
error("This ODE requires a DAE initialization and thus a nonlinear solve but no nonlinear solve has been loaded. To solve this problem, do `using OrdinaryDiffEqNonlinearSolve` or pass a custom `nlsolve` choice into the `initializealg`.")
129139
end
130140

lib/OrdinaryDiffEqNonlinearSolve/src/initialize_dae.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ function default_nlsolve(
66
::Nothing, isinplace::Val{true}, u, ::NonlinearLeastSquaresProblem, autodiff = false)
77
FastShortcutNLLSPolyalg(; autodiff = autodiff ? AutoForwardDiff() : AutoFiniteDiff())
88
end
9+
function default_nlsolve(::Nothing, isinplace::Val{false}, u, ::NonlinearProblem, autodiff = false)
10+
FastShortcutNonlinearPolyalg(;
11+
autodiff = autodiff ? AutoForwardDiff() : AutoFiniteDiff())
12+
end
13+
function default_nlsolve(
14+
::Nothing, isinplace::Val{false}, u, ::NonlinearLeastSquaresProblem, autodiff = false)
15+
FastShortcutNLLSPolyalg(; autodiff = autodiff ? AutoForwardDiff() : AutoFiniteDiff())
16+
end
917
function default_nlsolve(::Nothing, isinplace::Val{false}, u::StaticArray,
1018
::NonlinearProblem, autodiff = false)
1119
SimpleTrustRegion(autodiff = autodiff ? AutoForwardDiff() : AutoFiniteDiff())

lib/OrdinaryDiffEqRosenbrock/Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
5353
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
5454
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
5555
ODEProblemLibrary = "fdc4e326-1af4-4b90-96e7-779fcce2daa5"
56+
OrdinaryDiffEqNonlinearSolve = "127b3ac7-2247-4354-8eb6-78cf4e7c58e8"
5657
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
5758
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
5859
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
5960

6061
[targets]
61-
test = ["DiffEqDevTools", "Random", "SafeTestsets", "Test", "LinearAlgebra", "LinearSolve", "ForwardDiff", "ODEProblemLibrary"]
62+
test = ["DiffEqDevTools", "Random", "OrdinaryDiffEqNonlinearSolve", "SafeTestsets", "Test", "LinearAlgebra", "LinearSolve", "ForwardDiff", "ODEProblemLibrary"]

0 commit comments

Comments
 (0)