Skip to content

Commit

Permalink
Fix custom jacobian test interference
Browse files Browse the repository at this point in the history
  • Loading branch information
MSeeker1340 committed Aug 6, 2018
1 parent 67f588c commit 86afe48
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions test/linear_nonlinear_krylov_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,23 @@ end
println(EPIRK5s3) # prevent Travis hanging
end

@testset "Adaptive exponential Rosenbrock" begin
dt = 0.05
abstol=1e-4; reltol=1e-3
sol_ref = solve(prob, Tsit5(); abstol=abstol, reltol=reltol)

sol = solve(prob, Exprb32(krylov=true,m=20); adaptive=true, abstol=abstol, reltol=reltol)
@test isapprox(sol(1.0), sol_ref(1.0); rtol=reltol)
sol = solve(prob_ip, Exprb32(krylov=true,m=20); adaptive=true, abstol=abstol, reltol=reltol)
@test isapprox(sol(1.0), sol_ref(1.0); rtol=reltol)

sol = solve(prob, Exprb43(krylov=true,m=20); adaptive=true, abstol=abstol, reltol=reltol)
@test isapprox(sol(1.0), sol_ref(1.0); rtol=reltol)
sol = solve(prob_ip, Exprb43(krylov=true,m=20); adaptive=true, abstol=abstol, reltol=reltol)
@test isapprox(sol(1.0), sol_ref(1.0); rtol=reltol)
end
end

@testset "ExpRK with custom jacobian" begin
N = 10
# Sparse Jacobian
Expand All @@ -101,20 +118,3 @@ end
@test sol(1.0) exp_fun2.analytic(u0,nothing,1.0)
end
end

@testset "Adaptive exponential Rosenbrock" begin
dt = 0.05
abstol=1e-4; reltol=1e-3
sol_ref = solve(prob, Tsit5(); abstol=abstol, reltol=reltol)

sol = solve(prob, Exprb32(krylov=true,m=20); adaptive=true, abstol=abstol, reltol=reltol)
@test isapprox(sol(1.0), sol_ref(1.0); rtol=reltol)
sol = solve(prob_ip, Exprb32(krylov=true,m=20); adaptive=true, abstol=abstol, reltol=reltol)
@test isapprox(sol(1.0), sol_ref(1.0); rtol=reltol)

sol = solve(prob, Exprb43(krylov=true,m=20); adaptive=true, abstol=abstol, reltol=reltol)
@test isapprox(sol(1.0), sol_ref(1.0); rtol=reltol)
sol = solve(prob_ip, Exprb43(krylov=true,m=20); adaptive=true, abstol=abstol, reltol=reltol)
@test isapprox(sol(1.0), sol_ref(1.0); rtol=reltol)
end
end

0 comments on commit 86afe48

Please sign in to comment.