Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
initialized checking for individual modifications
  • Loading branch information
ChrisRackauckas committed Oct 18, 2017
commit 86e233631b52f9f9c203ab3174914b6b1419e151
12 changes: 9 additions & 3 deletions src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ function init{algType<:OrdinaryDiffEqAlgorithm,recompile_flag}(
verbose = true, force_dtmin = false,
timeseries_errors = true, dense_errors=false,
advance_to_tstop = false,stop_at_next_tstop=false,
initialize_save = true,
progress=false,progress_steps=1000,progress_name="ODE",
progress_message = ODE_DEFAULT_PROG_MESSAGE,
userdata=nothing,callback=nothing,
Expand Down Expand Up @@ -310,13 +311,12 @@ function init{algType<:OrdinaryDiffEqAlgorithm,recompile_flag}(
just_hit_tstop,accept_step,isout,reeval_fsal,
u_modified,opts)
if initialize_integrator
integrator.u_modified = true

initialize!(callbacks_internal,t,u,integrator)
u_modified = initialize!(callbacks_internal,t,u,integrator)

# if the user modifies u, we need to fix previous values before initializing
# FSAL in order for the starting derivatives to be correct
if integrator.u_modified
if u_modified
if alg_extrapolates(integrator.alg)
if isinplace(integrator.sol.prob)
recursivecopy!(integrator.uprev2,integrator.uprev)
Expand All @@ -329,7 +329,13 @@ function init{algType<:OrdinaryDiffEqAlgorithm,recompile_flag}(
else
integrator.uprev = integrator.u
end

# reset this as it is now handled so the integrators should proceed as normal
integrator.u_modified = false

if initialize_save && any((c)->c.save_positions[2],callbacks_internal)
savevalues!(integrator,true)
end
end

initialize!(integrator,integrator.cache)
Expand Down