Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Nov 22, 2018
2 parents c2bf19c + 44cc069 commit 8d80926
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 66 deletions.
12 changes: 8 additions & 4 deletions src/caches/adams_bashforth_moulton_caches.jl
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,8 @@ function alg_cache(alg::CNAB2,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoUni
uprev3 = u
tprev2 = t

nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,1//2,1,ηold,z₊,dz,tmp,b,k))
γ, c = 1//2, 1
@oopnlsolve
CNAB2ConstantCache(k2,uf,nlsolve,uprev3,tprev2)
end

Expand All @@ -936,7 +937,8 @@ function alg_cache(alg::CNAB2,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoUni
uprev3 = similar(u)
tprev2 = t

nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,1//2,1,ηold,z₊,dz,tmp,b,k))
γ, c = 1//2, 1
@iipnlsolve
CNAB2Cache(u,uprev,uprev2,fsalfirst,k,k1,k2,du₁,du1,z,dz,b,tmp,atmp,J,W,uf,jac_config,linsolve,nlsolve,uprev3,tprev2)
end

Expand Down Expand Up @@ -983,7 +985,8 @@ function alg_cache(alg::CNLF2,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoUni
uprev3 = u
tprev2 = t

nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,1//1,1,ηold,z₊,dz,tmp,b,k))
γ, c = 1//1, 1
@oopnlsolve
CNLF2ConstantCache(k2,uf,nlsolve,uprev2,uprev3,tprev2)
end

Expand All @@ -998,6 +1001,7 @@ function alg_cache(alg::CNLF2,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoUni
uprev3 = similar(u)
tprev2 = t

nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,1//1,1,ηold,z₊,dz,tmp,b,k))
γ, c = 1//1, 1
@iipnlsolve
CNLF2Cache(u,uprev,uprev2,fsalfirst,k,k1,k2,du₁,du1,z,dz,b,tmp,atmp,J,W,uf,jac_config,linsolve,nlsolve,uprev3,tprev2)
end
30 changes: 20 additions & 10 deletions src/caches/bdf_caches.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ end
function alg_cache(alg::ABDF2,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoUnits,tTypeNoUnits,
uprev,uprev2,f,t,dt,reltol,p,calck,::Type{Val{false}})
@oopnlcachefields
nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,1//1,1,ηold,z₊,dz,tmp,b,k))
γ, c = 1//1, 1
@oopnlsolve
eulercache = ImplicitEulerConstantCache(uf,nlsolve)
dtₙ₋₁ = one(dt)
fsalfirstprev = rate_prototype
Expand Down Expand Up @@ -45,7 +46,8 @@ end
function alg_cache(alg::ABDF2,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoUnits,
tTypeNoUnits,uprev,uprev2,f,t,dt,reltol,p,calck,::Type{Val{true}})
@iipnlcachefields
nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,1//1,1,ηold,z₊,dz,tmp,b,k))
γ, c = 1//1, 1
@iipnlsolve
atmp = similar(u,uEltypeNoUnits)

fsalfirstprev = similar(rate_prototype)
Expand Down Expand Up @@ -115,7 +117,8 @@ function alg_cache(alg::SBDF,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoUnit
du₁ = rate_prototype
du₂ = rate_prototype

nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,1//1,1,ηold,z₊,dz,tmp,b,k))
γ, c = 1//1, 1
@oopnlsolve
SBDFConstantCache(1,k2,uf,nlsolve,uprev2,uprev3,uprev4,k₁,k₂,k₃,du₁,du₂)
end

Expand All @@ -132,7 +135,8 @@ function alg_cache(alg::SBDF,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoUnit
du₁ = zero(rate_prototype)
du₂ = zero(rate_prototype)

nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,1//1,1,ηold,z₊,dz,tmp,b,k))
γ, c = 1//1, 1
@iipnlsolve
SBDFCache(1,u,uprev,fsalfirst,k,du1,z,dz,b,tmp,atmp,J,W,uf,jac_config,linsolve,nlsolve,uprev2,uprev3,uprev4,k₁,k₂,k₃,du₁,du₂)
end

Expand Down Expand Up @@ -184,7 +188,8 @@ function alg_cache(alg::QNDF1,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoUni
U = fill(zero(typeof(t)), 1, 1)

U!(1,U)
nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,zero(inv((1-alg.kappa))),1,ηold,z₊,dz,tmp,b,k))
γ, c = zero(inv((1-alg.kappa))), 1
@oopnlsolve

QNDF1ConstantCache(uf,nlsolve,D,D2,R,U,uprev2,dtₙ₋₁)
end
Expand All @@ -205,7 +210,8 @@ function alg_cache(alg::QNDF1,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoUni
utilde = similar(u)
uprev2 = similar(u)
dtₙ₋₁ = one(dt)
nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,zero(inv((1-alg.kappa))),1,ηold,z₊,dz,tmp,b,k))
γ, c = zero(inv((1-alg.kappa))), 1
@iipnlsolve

QNDF1Cache(uprev2,du1,fsalfirst,k,z,dz,b,D,D2,R,U,tmp,atmp,utilde,J,
W,uf,jac_config,linsolve,nlsolve,dtₙ₋₁)
Expand Down Expand Up @@ -266,7 +272,8 @@ function alg_cache(alg::QNDF2,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoUni

U!(2,U)

nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,zero(inv((1-alg.kappa))),1,ηold,z₊,dz,tmp,b,k))
γ, c = zero(inv((1-alg.kappa))), 1
@oopnlsolve
QNDF2ConstantCache(uf,nlsolve,D,D2,R,U,uprev2,uprev3,dtₙ₋₁,dtₙ₋₂)
end

Expand All @@ -289,7 +296,8 @@ function alg_cache(alg::QNDF2,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoUni
dtₙ₋₁ = zero(dt)
dtₙ₋₂ = zero(dt)

nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,zero(inv((1-alg.kappa))),1,ηold,z₊,dz,tmp,b,k))
γ, c = zero(inv((1-alg.kappa))), 1
@iipnlsolve
QNDF2Cache(uprev2,uprev3,du1,fsalfirst,k,z,dz,b,D,D2,R,U,tmp,atmp,utilde,J,
W,uf,jac_config,linsolve,nlsolve,dtₙ₋₁,dtₙ₋₂)
end
Expand Down Expand Up @@ -352,7 +360,8 @@ function alg_cache(alg::QNDF,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoUnit

max_order = 5

nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,zero(eltype(alg.kappa)),1,ηold,z₊,dz,tmp,b,k))
γ, c = zero(inv((alg.kappa))), 1
@oopnlsolve
QNDFConstantCache(uf,nlsolve,D,D2,R,U,1,max_order,udiff,dts,tmp,h,0)
end

Expand Down Expand Up @@ -382,7 +391,8 @@ function alg_cache(alg::QNDF,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoUnit
max_order = 5
atmp = similar(u,uEltypeNoUnits)
utilde = similar(u)
nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,zero(eltype(alg.kappa)),1,ηold,z₊,dz,tmp,b,k))
γ, c = zero(inv((alg.kappa))), 1
@iipnlsolve

QNDFCache(du1,fsalfirst,k,z,dz,b,D,D2,R,U,1,max_order,udiff,dts,tmp,atmp,utilde,J,
W,uf,jac_config,linsolve,nlsolve,h,0)
Expand Down
30 changes: 20 additions & 10 deletions src/caches/kencarp_kvaerno_caches.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ function alg_cache(alg::KenCarp3,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNo
uprev,uprev2,f,t,dt,reltol,p,calck,::Type{Val{false}})
@oopnlcachefields
tab = KenCarp3Tableau(uToltype,real(tTypeNoUnits))
nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,tab.γ,tab.c3,ηold,z₊,dz,tmp,b,k))
γ, c = tab.γ, tab.c3
@oopnlsolve

KenCarp3ConstantCache(uf,nlsolve,tab)
end
Expand Down Expand Up @@ -56,7 +57,8 @@ function alg_cache(alg::KenCarp3,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNo
uf = DiffEqDiffTools.UJacobianWrapper(f,t,p)
end
tab = KenCarp3Tableau(uToltype,real(tTypeNoUnits))
nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,tab.γ,tab.c3,ηold,z₊,dz,tmp,b,k))
γ, c = tab.γ, tab.c3
@iipnlsolve

KenCarp3Cache(u,uprev,du1,fsalfirst,k,z₁,z₂,z₃,z₄,k1,k2,k3,k4,dz,b,tmp,atmp,J,
W,uf,jac_config,linsolve,nlsolve,tab)
Expand All @@ -75,7 +77,8 @@ function alg_cache(alg::Kvaerno4,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNo
tprev2 = t

tab = Kvaerno4Tableau(uToltype,real(tTypeNoUnits))
nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,tab.γ,tab.c3,ηold,z₊,dz,tmp,b,k))
γ, c = tab.γ, tab.c3
@oopnlsolve

Kvaerno4ConstantCache(uf,nlsolve,tab)
end
Expand Down Expand Up @@ -112,7 +115,8 @@ function alg_cache(alg::Kvaerno4,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNo
z₅ = z
atmp = similar(u,uEltypeNoUnits)
tab = Kvaerno4Tableau(uToltype,real(tTypeNoUnits))
nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,tab.γ,tab.c3,ηold,z₊,dz,tmp,b,k))
γ, c = tab.γ, tab.c3
@iipnlsolve

Kvaerno4Cache(u,uprev,du1,fsalfirst,k,z₁,z₂,z₃,z₄,z₅,dz,b,tmp,atmp,J,
W,uf,jac_config,linsolve,nlsolve,tab)
Expand All @@ -130,7 +134,8 @@ function alg_cache(alg::KenCarp4,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNo
uprev3 = u
tprev2 = t
tab = KenCarp4Tableau(uToltype,real(tTypeNoUnits))
nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,tab.γ,tab.c3,ηold,z₊,dz,tmp,b,k))
γ, c = tab.γ, tab.c3
@oopnlsolve

KenCarp4ConstantCache(uf,nlsolve,tab)
end
Expand Down Expand Up @@ -186,7 +191,8 @@ function alg_cache(alg::KenCarp4,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNo
end

tab = KenCarp4Tableau(uToltype,real(tTypeNoUnits))
nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,tab.γ,tab.c3,ηold,z₊,dz,tmp,b,k))
γ, c = tab.γ, tab.c3
@iipnlsolve

KenCarp4Cache(u,uprev,du1,fsalfirst,k,z₁,z₂,z₃,z₄,z₅,z₆,k1,k2,k3,k4,k5,k6,
dz,b,tmp,atmp,J,
Expand All @@ -203,7 +209,8 @@ function alg_cache(alg::Kvaerno5,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNo
uprev,uprev2,f,t,dt,reltol,p,calck,::Type{Val{false}})
@oopnlcachefields
tab = Kvaerno5Tableau(uToltype,real(tTypeNoUnits))
nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,tab.γ,tab.c3,ηold,z₊,dz,tmp,b,k))
γ, c = tab.γ, tab.c3
@oopnlsolve

Kvaerno5ConstantCache(uf,nlsolve,tab)
end
Expand Down Expand Up @@ -243,7 +250,8 @@ function alg_cache(alg::Kvaerno5,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNo
z₇ = z
atmp = similar(u,uEltypeNoUnits)
tab = Kvaerno5Tableau(uToltype,real(tTypeNoUnits))
nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,tab.γ,tab.c3,ηold,z₊,dz,tmp,b,k))
γ, c = tab.γ, tab.c3
@iipnlsolve

Kvaerno5Cache(u,uprev,du1,fsalfirst,k,z₁,z₂,z₃,z₄,z₅,z₆,z₇,dz,b,tmp,atmp,J,
W,uf,jac_config,linsolve,nlsolve,tab)
Expand All @@ -259,7 +267,8 @@ function alg_cache(alg::KenCarp5,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNo
uprev,uprev2,f,t,dt,reltol,p,calck,::Type{Val{false}})
@oopnlcachefields
tab = KenCarp5Tableau(uToltype,real(tTypeNoUnits))
nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,tab.γ,tab.c3,ηold,z₊,dz,tmp,b,k))
γ, c = tab.γ, tab.c3
@oopnlsolve

KenCarp5ConstantCache(uf,nlsolve,tab)
end
Expand Down Expand Up @@ -322,7 +331,8 @@ function alg_cache(alg::KenCarp5,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNo
end

tab = KenCarp5Tableau(real(uBottomEltypeNoUnits),real(tTypeNoUnits))
nlsolve = typeof(_nlsolve)(NLSolverCache(κ,tol,min_iter,max_iter,10000,new_W,z,W,tab.γ,tab.c3,ηold,z₊,dz,tmp,b,k))
γ, c = tab.γ, tab.c3
@iipnlsolve

KenCarp5Cache(u,uprev,du1,fsalfirst,k,z₁,z₂,z₃,z₄,z₅,z₆,z₇,z₈,
k1,k2,k3,k4,k5,k6,k7,k8,
Expand Down
Loading

0 comments on commit 8d80926

Please sign in to comment.