Skip to content

Commit 3b4510e

Browse files
revert bad initdt "fix"
1 parent ec9ff94 commit 3b4510e

File tree

4 files changed

+25
-24
lines changed

4 files changed

+25
-24
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ os:
44
- linux
55
- osx
66
julia:
7-
- 0.5
87
- 0.6
98
- nightly
109
matrix:
1110
allow_failures:
12-
- julia: 0.6
1311
- julia: nightly
1412
notifications:
1513
email: false

appveyor.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
environment:
22
matrix:
3-
- JULIAVERSION: "julialang/bin/winnt/x86/0.5/julia-0.5-latest-win32.exe"
4-
- JULIAVERSION: "julialang/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe"
53
- JULIAVERSION: "julialang/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
64
- JULIAVERSION: "julialang/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
75
- JULIAVERSION: "julianightlies/bin/winnt/x86/julia-latest-win32.exe"
86
- JULIAVERSION: "julianightlies/bin/winnt/x64/julia-latest-win64.exe"
97
matrix:
108
allow_failures:
11-
- JULIAVERSION: "julialang/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
12-
- JULIAVERSION: "julialang/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
139
- JULIAVERSION: "julianightlies/bin/winnt/x86/julia-latest-win32.exe"
1410
- JULIAVERSION: "julianightlies/bin/winnt/x64/julia-latest-win64.exe"
1511
branches:

src/initdt.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function ode_determine_initdt{tType,uType}(u0,t::tType,tdir,dtmax,abstol,reltol,
1212
else
1313
dt₀ = tType((d₀/d₁)/100)
1414
end
15-
dt₀ = min(dt₀,dtmax)
15+
dt₀ = min(dt₀,tdir*dtmax)
1616
@inbounds for i in eachindex(u0)
1717
u₁[i] = u0[i] + tdir*dt₀*f₀[i]
1818
end
@@ -26,7 +26,7 @@ function ode_determine_initdt{tType,uType}(u0,t::tType,tdir,dtmax,abstol,reltol,
2626
else
2727
dt₁ = tType(10.0^(-(2+log10(unitless_max))/(order)))
2828
end
29-
dt = tdir*min(100dt₀,dt₁,dtmax)
29+
dt = tdir*min(100dt₀,dt₁,tdir*dtmax)
3030
end
3131

3232
function ode_determine_initdt{uType,tType}(u0::uType,t,tdir,dtmax,abstol,reltol,internalnorm,prob::AbstractODEProblem{uType,tType,false},order)
@@ -42,7 +42,7 @@ function ode_determine_initdt{uType,tType}(u0::uType,t,tdir,dtmax,abstol,reltol,
4242
else
4343
dt₀ = tType((d₀/d₁)/100)
4444
end
45-
dt₀ = min(dt₀,dtmax)
45+
dt₀ = min(dt₀,tdir*dtmax)
4646
u₁ = u0 + tdir*dt₀*f₀
4747
f₁ = f(t+tdir*dt₀,u₁)
4848
d₂ = internalnorm((f₁-f₀)./(abstol+abs.(u0).*reltol))/dt₀*tType(1)
@@ -51,5 +51,5 @@ function ode_determine_initdt{uType,tType}(u0::uType,t,tdir,dtmax,abstol,reltol,
5151
else
5252
dt₁ = tType(10.0^(-(2+log10(max(d₁,d₂)/T1(1)))/(order)))
5353
end
54-
dt = tdir*min(100dt₀,dt₁,dtmax)
54+
dt = tdir*min(100dt₀,dt₁,tdir*dtmax)
5555
end

test/ode/ode_initdt_tests.jl

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,33 +23,40 @@ dt₀ = sol3.t[2]
2323

2424
@test 1e-7 < dt₀ < .3
2525

26+
prob = prob_ode_linear
27+
sol = solve(prob,DP5())
28+
2629
if !is_windows()
2730
using ODEInterfaceDiffEq, Base.Test
28-
prob = prob_ode_linear
29-
sol = solve(prob,DP5())
3031
sol2 = solve(prob,dopri5())
31-
3232
@test sol.t[2] sol2.t[2]
33+
end
34+
3335

34-
prob = prob_ode_2Dlinear
35-
sol = solve(prob,DP5(),internalnorm=(u)->sqrt(sum(abs2,u)))
36+
prob = prob_ode_2Dlinear
37+
sol = solve(prob,DP5(),internalnorm=(u)->sqrt(sum(abs2,u)))
38+
39+
if !is_windows()
3640
# Change the norm due to error in dopri5.f
3741
sol2 = solve(prob,dopri5())
38-
3942
@test sol.t[2] sol2.t[2]
43+
end
4044

41-
prob = deepcopy(prob_ode_linear)
42-
prob.tspan = (1.0,0.0)
43-
sol = solve(prob,DP5())
44-
sol2 = solve(prob,dopri5())
45+
prob = deepcopy(prob_ode_linear)
46+
prob.tspan = (1.0,0.0)
47+
sol = solve(prob,DP5())
4548

49+
if !is_windows()
50+
sol2 = solve(prob,dopri5())
4651
@test sol.t[2] sol2.t[2]
52+
end
53+
54+
prob = deepcopy(prob_ode_2Dlinear)
55+
prob.tspan = (1.0,0.0)
56+
sol = solve(prob,DP5(),internalnorm=(u)->sqrt(sum(abs2,u)))
4757

48-
prob = deepcopy(prob_ode_2Dlinear)
49-
prob.tspan = (1.0,0.0)
50-
sol = solve(prob,DP5(),internalnorm=(u)->sqrt(sum(abs2,u)))
58+
if !is_windows()
5159
# Change the norm due to error in dopri5.f
5260
sol2 = solve(prob,dopri5())
53-
5461
@test sol.t[2] sol2.t[2]
5562
end

0 commit comments

Comments
 (0)