@@ -101,15 +101,43 @@ end
101101 end
102102
103103 @testset " Solves" begin
104- u0, p, success = SciMLBase. get_initial_values (
105- prob, integ, fn, SciMLBase. OverrideInit (),
106- Val (false ); nlsolve_alg = NewtonRaphson ())
104+ @testset " with explicit alg" begin
105+ u0, p, success = SciMLBase. get_initial_values (
106+ prob, integ, fn, SciMLBase. OverrideInit (),
107+ Val (false ); nlsolve_alg = NewtonRaphson ())
107108
108- @test u0 ≈ [2.0 , 2.0 ]
109- @test p ≈ 1.0
110- @test success
109+ @test u0 ≈ [2.0 , 2.0 ]
110+ @test p ≈ 1.0
111+ @test success
111112
112- initprob. p[1 ] = 1.0
113+ initprob. p[1 ] = 1.0
114+ end
115+ @testset " with alg in `OverrideInit`" begin
116+ u0, p, success = SciMLBase. get_initial_values (
117+ prob, integ, fn, SciMLBase. OverrideInit (nlsolve = NewtonRaphson ()),
118+ Val (false ))
119+
120+ @test u0 ≈ [2.0 , 2.0 ]
121+ @test p ≈ 1.0
122+ @test success
123+
124+ initprob. p[1 ] = 1.0
125+ end
126+ @testset " with trivial problem and no alg" begin
127+ iprob = NonlinearProblem ((u, p) -> 0.0 , nothing , 1.0 )
128+ iprobmap = (_) -> [1.0 , 1.0 ]
129+ initdata = SciMLBase. OverrideInitData (iprob, nothing , iprobmap, nothing )
130+ _fn = ODEFunction (rhs2; initialization_data = initdata)
131+ _prob = ODEProblem (_fn, [2.0 , 0.0 ], (0.0 , 1.0 ), 1.0 )
132+ _integ = init (_prob; initializealg = NoInit ())
133+
134+ u0, p, success = SciMLBase. get_initial_values (
135+ _prob, _integ, _fn, SciMLBase. OverrideInit (), Val (false ))
136+
137+ @test u0 ≈ [1.0 , 1.0 ]
138+ @test p ≈ 1.0
139+ @test success
140+ end
113141 end
114142
115143 @testset " Solves with non-integrator value provider" begin
0 commit comments