Skip to content

Commit

Permalink
silly mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
kanav99 committed Jul 15, 2019
1 parent b171a9b commit d435290
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/caches/kencarp_kvaerno_caches.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function alg_cache(alg::Kvaerno4,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNo
γ, c = tab.γ, tab.c3
J, W = oop_generate_W(alg,u,uprev,p,t,dt,f,uEltypeNoUnits)
nlsolver = oopnlsolve(alg,u,uprev,p,t,dt,f,W,J,rate_prototype,uEltypeNoUnits,uBottomEltypeNoUnits,γ,c)
Kvaerno4ConstantCache(uf,nlsolver,tab)
Kvaerno4ConstantCache(nlsolver,tab)
end

@cache mutable struct Kvaerno4Cache{uType,rateType,uNoUnitsType,N,Tab} <: SDIRKMutableCache
Expand Down
9 changes: 3 additions & 6 deletions src/perform_step/sdirk_perform_step.jl
Original file line number Diff line number Diff line change
Expand Up @@ -373,23 +373,20 @@ end

# TODO: Add extrapolation
@.. zᵧ = zprev
nlsolver.z = zᵧ

z .= zᵧ
@.. tmp = uprev + d*zprev
nlsolver.c = γ
zᵧ = nlsolve!(integrator, cache)
zᵧ .= nlsolve!(integrator, cache)
nlsolvefail(nlsolver) && return

################################## Solve BDF2 Step

### Initial Guess From Shampine
@.. z = α1*zprev + α2*zᵧ
nlsolver.z = z

@.. tmp = uprev + ω*zprev + ω*zᵧ
nlsolver.c = 1
set_new_W!(nlsolver, false)
z = nlsolve!(integrator, cache)
nlsolve!(integrator, cache)
nlsolvefail(nlsolver) && return

@.. u = tmp + d*z
Expand Down

0 comments on commit d435290

Please sign in to comment.