Skip to content

Commit

Permalink
more integrator interface on stochastic
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Nov 15, 2017
1 parent 80afc6b commit 743813d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/StochasticDiffEq.jl
Expand Up @@ -26,9 +26,10 @@ module StochasticDiffEq

import DiffEqBase: solve, solve!, init, step!, build_solution, initialize!

import DiffEqBase: resize!,deleteat!,addat!,full_cache,user_cache, u_cache,du_cache,
# Integrator Interface
import DiffEqBase: resize!,deleteat!,addat!,full_cache,user_cache,u_cache,du_cache,
resize_non_user_cache!,deleteat_non_user_cache!,addat_non_user_cache!,
terminate!,get_du, get_dt,get_proposed_dt,
terminate!,get_du, get_dt,get_proposed_dt,set_proposed_dt!,
u_modified!,savevalues!,add_tstop!,add_saveat!,set_reltol!,
set_abstol!

Expand Down
13 changes: 13 additions & 0 deletions src/integrators/integrator_interface.jl
Expand Up @@ -28,6 +28,19 @@ end

(integrator::SDEIntegrator)(val::AbstractArray,t::Union{Number,AbstractArray},deriv::Type=Val{0};idxs=nothing) = current_interpolant!(val,t,integrator,idxs,deriv)

function u_modified!(integrator::SDEIntegrator,bool::Bool)
integrator.u_modified = bool
end

get_proposed_dt(integrator::SDEIntegrator) = integrator.dtpropose
set_proposed_dt!(integrator::SDEIntegrator,dt::Number) = (integrator.dtpropose = dt)

function set_proposed_dt!(integrator::SDEIntegrator,integrator2::SDEIntegrator)
integrator.dtpropose = integrator2.dtpropose
integrator.qold = integrator2.qold
integrator.erracc = integrator2.erracc
integrator.dtacc = integrator2.dtacc
end

user_cache(integrator::SDEIntegrator) = user_cache(integrator.cache)
u_cache(integrator::SDEIntegrator) = u_cache(integrator.cache)
Expand Down

0 comments on commit 743813d

Please sign in to comment.