1
1
using OrdinaryDiffEq, Sundials, SciMLBase, Test
2
2
3
3
@testset " CheckInit" begin
4
+ abstol = 1e-10
4
5
@testset " Sundials + ODEProblem" begin
5
6
function rhs (u, p, t)
6
7
return [u[1 ] * t, u[1 ]^ 2 - u[2 ]^ 2 ]
@@ -17,13 +18,13 @@ using OrdinaryDiffEq, Sundials, SciMLBase, Test
17
18
prob = ODEProblem (f, [1.0 , 1.0 ], (0.0 , 1.0 ))
18
19
integ = init (prob, Sundials. ARKODE ())
19
20
u0, _, success = SciMLBase. get_initial_values (
20
- prob, integ, f, SciMLBase. CheckInit (), Val (SciMLBase. isinplace (f)))
21
+ prob, integ, f, SciMLBase. CheckInit (), Val (SciMLBase. isinplace (f)); abstol )
21
22
@test success
22
23
@test u0 == prob. u0
23
24
24
25
integ. u[2 ] = 2.0
25
26
@test_throws SciMLBase. CheckInitFailureError SciMLBase. get_initial_values (
26
- prob, integ, f, SciMLBase. CheckInit (), Val (SciMLBase. isinplace (f)))
27
+ prob, integ, f, SciMLBase. CheckInit (), Val (SciMLBase. isinplace (f)); abstol )
27
28
end
28
29
end
29
30
@@ -43,18 +44,18 @@ using OrdinaryDiffEq, Sundials, SciMLBase, Test
43
44
prob = DAEProblem (f, [1.0 , 0.0 ], [1.0 , 1.0 ], (0.0 , 1.0 ), 1.0 )
44
45
integ = init (prob, Sundials. IDA ())
45
46
u0, _, success = SciMLBase. get_initial_values (
46
- prob, integ, f, SciMLBase. CheckInit (), Val (SciMLBase. isinplace (f)))
47
+ prob, integ, f, SciMLBase. CheckInit (), Val (SciMLBase. isinplace (f)); abstol )
47
48
@test success
48
49
@test u0 == prob. u0
49
50
50
51
integ. u[2 ] = 2.0
51
52
@test_throws SciMLBase. CheckInitFailureError SciMLBase. get_initial_values (
52
- prob, integ, f, SciMLBase. CheckInit (), Val (SciMLBase. isinplace (f)))
53
+ prob, integ, f, SciMLBase. CheckInit (), Val (SciMLBase. isinplace (f)); abstol )
53
54
54
55
integ. u[2 ] = 1.0
55
56
integ. du[1 ] = 2.0
56
57
@test_throws SciMLBase. CheckInitFailureError SciMLBase. get_initial_values (
57
- prob, integ, f, SciMLBase. CheckInit (), Val (SciMLBase. isinplace (f)))
58
+ prob, integ, f, SciMLBase. CheckInit (), Val (SciMLBase. isinplace (f)); abstol )
58
59
end
59
60
end
60
61
end
0 commit comments