Skip to content

Commit

Permalink
Fix a few depwarns and errors
Browse files Browse the repository at this point in the history
  • Loading branch information
YingboMa committed Jul 14, 2018
1 parent b6750c8 commit 5674838
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 44 deletions.
6 changes: 3 additions & 3 deletions test/ode/ode_convergence_tests.jl
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# This definitely needs cleaning
using OrdinaryDiffEq, DiffEqDevTools, DiffEqBase, Test, Random
using OrdinaryDiffEq, Test, Random
import DiffEqProblemLibrary.ODEProblemLibrary: prob_ode_linear, prob_ode_2Dlinear
probArr = Vector{ODEProblem}(undef, 2)
probArr[1] = prob_ode_linear

probArr[2] = prob_ode_2Dlinear
srand(100)
## Convergence Testing
dts = 1.//2.^(8:-1:4)
dts1 = 1.//2.^(9:-1:5)
dts = 1 .//2 .^(8:-1:4)
dts1 = 1 .//2 .^(9:-1:5)
testTol = 0.2

for i = 1:2
Expand Down
2 changes: 1 addition & 1 deletion test/ode/ode_ssprk_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import DiffEqProblemLibrary.ODEProblemLibrary: prob_ode_linear, prob_ode_2Dlinea

srand(100)

dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
testTol = 0.25

f = (u,p,t)->cos(t)
Expand Down
6 changes: 2 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ is_APPVEYOR = ( Sys.iswindows() && haskey(ENV,"APPVEYOR") )

#Start Test Script

tic()
@time begin
if group == "All" || group == "Interface"
@time include("discrete_algorithm_test.jl")
@time include("ode/ode_tstops_tests.jl")
Expand Down Expand Up @@ -64,7 +64,6 @@ if !is_APPVEYOR && ( group == "All" || group == "AlgConvergence_I" )
# ~ 2 s
@time @testset "Adams Variable Coefficients Tests" begin include("ode/adams_tests.jl") end
# ~ 50 s
# broken
@time @testset "Nordsieck Tests" begin include("ode/nordsieck_tests.jl") end
#@time @testset "Linear Methods Tests" begin include("linear_method_tests.jl") end
# ~ 170 s
Expand All @@ -83,5 +82,4 @@ if !is_APPVEYOR && ( group == "All" || group == "AlgConvergence_II" )
# ~ 140 s
@time @testset "Linear-Nonlinear Krylov Methods Tests" begin include("linear_nonlinear_krylov_tests.jl") end
end

toc()
end # @time
72 changes: 36 additions & 36 deletions test/split_methods_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,32 +46,32 @@ fun = SplitFunction(f1, f2; analytic=(u0,p,t)->exp(2t)*u0)
prob = SplitODEProblem(fun,1.0,(0.0,1.0))

sol = solve(prob,KenCarp3())
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,KenCarp3())
@test abs(sim.𝒪est[:l∞]-3) < testTol

sol = solve(prob,KenCarp4())
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,KenCarp4())
@test abs(sim.𝒪est[:l∞]-4) < testTol

sol = solve(prob,KenCarp5())
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,KenCarp5())
@test abs(sim.𝒪est[:l∞]-5) < testTol

# IMEXEuler
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim1 = test_convergence(dts,prob,IMEXEuler())
@test abs(sim1.𝒪est[:l∞]-1) < testTol

# CNAB2
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,CNAB2())
@test abs(sim.𝒪est[:l∞]-2) < testTol

# CNLF2
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,CNLF2())
@test abs(sim.𝒪est[:l∞]-2) < testTol

Expand All @@ -84,32 +84,32 @@ fun = SplitFunction(f1, f2; analytic=(u0,p,t)->exp(2t)*u0)
prob = SplitODEProblem(fun,1.0,(0.0,1.0))

sol = solve(prob,KenCarp3())
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,KenCarp3())
@test abs(sim.𝒪est[:l∞]-3) < testTol

sol = solve(prob,KenCarp4())
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,KenCarp4())
@test abs(sim.𝒪est[:l∞]-4) < testTol

sol = solve(prob,KenCarp5())
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,KenCarp5())
@test abs(sim.𝒪est[:l∞]-5) < testTol

# IMEXEuler
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim2 = test_convergence(dts,prob,IMEXEuler())
@test abs(sim2.𝒪est[:l∞]-1) < testTol

# CNAB2
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,CNAB2())
@test abs(sim.𝒪est[:l∞]-2) < testTol

# CNLF2
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,CNLF2())
@test abs(sim.𝒪est[:l∞]-2) < testTol

Expand All @@ -122,32 +122,32 @@ fun = SplitFunction(f1, f2; analytic=(u0,p,t)->exp(2t)*u0)
prob = SplitODEProblem(fun,1.0,(0.0,1.0))

sol = solve(prob,KenCarp3())
dts = 1.//2.^(12:-1:8)
dts = 1 .//2 .^(12:-1:8)
sim = test_convergence(dts,prob,KenCarp3())
@test abs(sim.𝒪est[:l∞]-3) < testTol

sol = solve(prob,KenCarp4())
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,KenCarp4())
@test abs(sim.𝒪est[:l∞]-4) < testTol

sol = solve(prob,KenCarp5())
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,KenCarp5())
@test abs(sim.𝒪est[:l∞]-5) < testTol

# IMEXEuler
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim3 = test_convergence(dts,prob,IMEXEuler())
@test abs(sim3.𝒪est[:l∞]-2) < testTol # Super-convergence

# CNAB2
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,CNAB2())
@test abs(sim.𝒪est[:l∞]-2) < testTol

# CNLF2
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,CNLF2())
@test abs(sim.𝒪est[:l∞]-2) < testTol

Expand All @@ -160,32 +160,32 @@ fun = SplitFunction(f1, f2; analytic=(u0,p,t)->exp(2t)*u0)
prob = SplitODEProblem(fun,rand(4,2),(0.0,1.0))

sol = solve(prob,KenCarp3())
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,KenCarp3())
@test abs(sim.𝒪est[:l∞]-3) < testTol

sol = solve(prob,KenCarp4())
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,KenCarp4())
@test abs(sim.𝒪est[:l∞]-4) < testTol

sol = solve(prob,KenCarp5())
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,KenCarp5())
@test abs(sim.𝒪est[:l∞]-5) < testTol

# IMEXEuler
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim1 = test_convergence(dts,prob,IMEXEuler())
@test abs(sim1.𝒪est[:l∞]-1) < testTol

# CNAB2
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,CNAB2())
@test abs(sim.𝒪est[:l∞]-2) < testTol

# CNLF2
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,CNLF2())
@test abs(sim.𝒪est[:l∞]-2) < testTol

Expand All @@ -198,32 +198,32 @@ fun = SplitFunction(f1, f2; analytic=(u0,p,t)->exp(2t)*u0)
prob = SplitODEProblem(fun,rand(4,2),(0.0,1.0))

sol = solve(prob,KenCarp3())
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,KenCarp3())
@test abs(sim.𝒪est[:l∞]-3) < testTol

sol = solve(prob,KenCarp4())
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,KenCarp4())
@test abs(sim.𝒪est[:l∞]-4) < testTol

sol = solve(prob,KenCarp5())
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,KenCarp5())
@test abs(sim.𝒪est[:l∞]-5) < testTol

# IMEXEuler
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim2 = test_convergence(dts,prob,IMEXEuler())
@test abs(sim2.𝒪est[:l∞]-1) < testTol

# CNAB2
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,CNAB2())
@test abs(sim.𝒪est[:l∞]-2) < testTol

# CNLF2
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,CNLF2())
@test abs(sim.𝒪est[:l∞]-2) < testTol

Expand All @@ -236,31 +236,31 @@ fun = SplitFunction(f1, f2; analytic=(u0,p,t)->exp(2t)*u0)
prob = SplitODEProblem(fun,rand(4,2),(0.0,1.0))

sol = solve(prob,KenCarp3())
dts = 1.//2.^(12:-1:8)
dts = 1 .//2 .^(12:-1:8)
sim = test_convergence(dts,prob,KenCarp3())
@test abs(sim.𝒪est[:l∞]-3) < testTol

sol = solve(prob,KenCarp4())
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,KenCarp4())
@test abs(sim.𝒪est[:l∞]-4) < testTol

sol = solve(prob,KenCarp5())
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,KenCarp5())
@test abs(sim.𝒪est[:l∞]-5) < testTol

# IMEXEuler
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim3 = test_convergence(dts,prob,IMEXEuler())
@test abs(sim3.𝒪est[:l∞]-2) < testTol # Super-convergence

# CNAB2
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,CNAB2())
@test abs(sim.𝒪est[:l∞]-2) < testTol

# CNLF2
dts = 1.//2.^(8:-1:4)
dts = 1 .//2 .^(8:-1:4)
sim = test_convergence(dts,prob,CNLF2())
@test abs(sim.𝒪est[:l∞]-2) < testTol

0 comments on commit 5674838

Please sign in to comment.