Skip to content

Commit

Permalink
fix-init-FBDF
Browse files Browse the repository at this point in the history
  • Loading branch information
oscardssmith committed Oct 8, 2024
1 parent 27c8076 commit ce0fd74
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/OrdinaryDiffEqBDF/src/bdf_perform_step.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,11 @@ function initialize!(integrator, cache::FBDFConstantCache)
integrator.fsallast = zero(integrator.fsalfirst)
integrator.k[1] = integrator.fsalfirst
integrator.k[2] = integrator.fsallast

u_modified = integrator.u_modified
integrator.u_modified = true
reinitFBDF!(integrator, cache)
integrator.u_modified = u_modified
end

function perform_step!(integrator, cache::FBDFConstantCache{max_order},
Expand Down Expand Up @@ -1222,6 +1227,11 @@ function initialize!(integrator, cache::FBDFCache)
integrator.k[2] = integrator.fsallast
integrator.f(integrator.fsalfirst, integrator.uprev, integrator.p, integrator.t)
OrdinaryDiffEqCore.increment_nf!(integrator.stats, 1)

u_modified = integrator.u_modified
integrator.u_modified = true
reinitFBDF!(integrator, cache)
integrator.u_modified = u_modified
end

function perform_step!(integrator, cache::FBDFCache{max_order},
Expand Down
10 changes: 10 additions & 0 deletions lib/OrdinaryDiffEqBDF/src/dae_perform_step.jl
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ function initialize!(integrator, cache::DFBDFConstantCache)
integrator.fsallast = zero(integrator.fsalfirst)
integrator.k[1] = integrator.fsalfirst
integrator.k[2] = integrator.fsallast

u_modified = integrator.u_modified
integrator.u_modified = true
reinitFBDF!(integrator, cache)
integrator.u_modified = u_modified
end

function perform_step!(integrator, cache::DFBDFConstantCache{max_order},
Expand Down Expand Up @@ -355,6 +360,11 @@ function initialize!(integrator, cache::DFBDFCache)
integrator.k[2] = integrator.fsallast
#integrator.f(integrator.fsalfirst, integrator.du, integrator.uprev, integrator.p, integrator.t) # For the interpolation, needs k at the updated point
#OrdinaryDiffEqCore.increment_nf!(integrator.stats, 1)

u_modified = integrator.u_modified
integrator.u_modified = true
reinitFBDF!(integrator, cache)
integrator.u_modified = u_modified
end

function perform_step!(integrator, cache::DFBDFCache{max_order},
Expand Down

0 comments on commit ce0fd74

Please sign in to comment.