Skip to content

Commit

Permalink
Merge pull request #762 from JuliaDiffEq/tests
Browse files Browse the repository at this point in the history
Restructure tests
  • Loading branch information
ChrisRackauckas committed Jun 5, 2019
2 parents b440729 + c328561 commit d5b9534
Show file tree
Hide file tree
Showing 68 changed files with 1,192 additions and 91 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ env:
- GROUP=AlgConvergence_I
- GROUP=AlgConvergence_II
- GROUP=AlgConvergence_III
- GROUP=ODEInterfaceRegression
addons:
apt:
packages:
- gfortran
#matrix:
# allow_failures:
# - julia: nightly
Expand Down
24 changes: 12 additions & 12 deletions src/perform_step/kencarp_kvaerno_perform_step.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ end
nlsolver.z = z₂ = z₁

nlsolver.tmp = uprev + γ*z₁
nlsolver.c = 2γ
nlsolver.c = γ
z₂ = nlsolve!(integrator, cache)
nlsolvefail(nlsolver) && return

Expand Down Expand Up @@ -115,7 +115,7 @@ end
nlsolver.z = z₂

@.. tmp = uprev + γ*z₁
nlsolver.c = 2γ
nlsolver.c = γ
z₂ = nlsolve!(integrator, cache)
nlsolvefail(nlsolver) && return
set_new_W!(nlsolver, false)
Expand Down Expand Up @@ -210,7 +210,7 @@ end
nlsolver.tmp += ea21*k1
end

nlsolver.c = 2γ
nlsolver.c = γ
z₂ = nlsolve!(integrator, cache)
nlsolvefail(nlsolver) && return

Expand Down Expand Up @@ -337,7 +337,7 @@ end
@.. tmp += ea21*k1
end

nlsolver.c = 2γ
nlsolver.c = γ
z₂ = nlsolve!(integrator, cache)
nlsolvefail(nlsolver) && return
set_new_W!(nlsolver, false)
Expand Down Expand Up @@ -452,7 +452,7 @@ end
nlsolver.z = z₂ = zero(u)

nlsolver.tmp = uprev + γ*z₁
nlsolver.c = 2γ
nlsolver.c = γ
z₂ = nlsolve!(integrator, cache)
nlsolvefail(nlsolver) && return

Expand Down Expand Up @@ -530,7 +530,7 @@ end
nlsolver.z = z₂

@.. tmp = uprev + γ*z₁
nlsolver.c = 2γ
nlsolver.c = γ
z₂ = nlsolve!(integrator, cache)
nlsolvefail(nlsolver) && return
set_new_W!(nlsolver, false)
Expand Down Expand Up @@ -636,7 +636,7 @@ end
tmp += ea21*k1
end
nlsolver.tmp = tmp
nlsolver.c = 2γ
nlsolver.c = γ

z₂ = nlsolve!(integrator, cache)
nlsolvefail(nlsolver) && return
Expand Down Expand Up @@ -808,7 +808,7 @@ end
@.. tmp += ea21*k1
end

nlsolver.c = 2γ
nlsolver.c = γ
z₂ = nlsolve!(integrator, cache)
nlsolvefail(nlsolver) && return
set_new_W!(nlsolver, false)
Expand Down Expand Up @@ -979,7 +979,7 @@ end
nlsolver.z = z₂ = zero(u)

nlsolver.tmp = uprev + γ*z₁
nlsolver.c = 2γ
nlsolver.c = γ
z₂ = nlsolve!(integrator, cache)
nlsolvefail(nlsolver) && return

Expand Down Expand Up @@ -1075,7 +1075,7 @@ end
nlsolver.z = z₂

@.. tmp = uprev + γ*z₁
nlsolver.c = 2γ
nlsolver.c = γ
z₂ = nlsolve!(integrator, cache)
nlsolvefail(nlsolver) && return
set_new_W!(nlsolver, false)
Expand Down Expand Up @@ -1213,7 +1213,7 @@ end
tmp += ea21*k1
end
nlsolver.tmp = tmp
nlsolver.c = 2γ
nlsolver.c = γ

z₂ = nlsolve!(integrator, cache)
nlsolvefail(nlsolver) && return
Expand Down Expand Up @@ -1426,7 +1426,7 @@ end
@.. tmp += ea21*k1
end

nlsolver.c = 2γ
nlsolver.c = γ
z₂ = nlsolve!(integrator, cache)
nlsolvefail(nlsolver) && return
set_new_W!(nlsolver, false)
Expand Down
4 changes: 2 additions & 2 deletions src/perform_step/sdirk_perform_step.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ end
nlsolver.z = z₂ = zero(z₁)

nlsolver.tmp = uprev + γ*z₁
nlsolver.c = 2γ
nlsolver.c = γ
z₂ = nlsolve!(integrator, cache)
nlsolvefail(nlsolver) && return

Expand Down Expand Up @@ -1107,7 +1107,7 @@ end
nlsolver.z = z₂

@.. tmp = uprev + γ*z₁
nlsolver.c = 2γ
nlsolver.c = γ
z₂ = nlsolve!(integrator, cache)
nlsolvefail(nlsolver) && return
set_new_W!(nlsolver, false)
Expand Down
2 changes: 2 additions & 0 deletions test/REQUIRE
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ DiffEqCallbacks
DiffEqOperators
SafeTestsets
Calculus
Unitful
DiffEqSensitivity
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
54 changes: 54 additions & 0 deletions test/algconvergence/ode_feagin_tests.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using OrdinaryDiffEq, DiffEqBase, Test, DiffEqProblemLibrary, DiffEqDevTools,
Random

using DiffEqProblemLibrary.ODEProblemLibrary: importodeproblems; importodeproblems()
import DiffEqProblemLibrary.ODEProblemLibrary: prob_ode_bigfloatlinear,
prob_ode_bigfloat2Dlinear,
prob_ode_2Dlinear

## Convergence Testing
println("Convergence Test on Linear")

testTol = 1
prob = prob_ode_2Dlinear
println("Feagin RKs")
dts = (1//2) .^ (4:-1:2)
sol = solve(prob,Feagin10(),dt=dts[1])
prob = remake(prob_ode_bigfloat2Dlinear,tspan=(big(0)//1,big(1)//1))
sol = solve(prob,Feagin10(),dt=dts[1])

prob = remake(prob_ode_bigfloat2Dlinear,tspan=(big(0.0),big(1.0)))
dts = (1//2) .^ (4:-1:2)
sim = test_convergence(dts,prob,Feagin10())
@test abs(sim.𝒪est[:final]-8) < testTol #Lowered due to low test dt

sim = test_convergence(dts,prob,Feagin12())
@test abs(sim.𝒪est[:final]-12) < testTol

sim = test_convergence(dts,prob,Feagin14())
@test abs(sim.𝒪est[:final]-15) < testTol #Upped to 15 for test

prob = prob_ode_bigfloatlinear

dts = (1//2) .^ (6:-1:3)
sim = test_convergence(dts,prob,Feagin10())
@test abs(sim.𝒪est[:final]-10) < testTol

dts = (1//2) .^ (4:-1:2)
sim = test_convergence(dts,prob,Feagin12())
@test abs(sim.𝒪est[:final]-12) < testTol

sim = test_convergence(dts,prob,Feagin14())
@test abs(sim.𝒪est[:final]-15) < testTol #Upped to 15 for test

prob = prob_ode_bigfloat2Dlinear

#compile
sol =solve(prob,Feagin10(),dt=dts[1])
sol =solve(prob,Feagin12(),dt=dts[1])
sol =solve(prob,Feagin14(),dt=dts[1])

#test
@time sol =solve(prob,Feagin10(),dt=dts[1])
@time sol =solve(prob,Feagin12(),dt=dts[1])
@time sol =solve(prob,Feagin14(),dt=dts[1])
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit d5b9534

Please sign in to comment.