Skip to content

Commit

Permalink
save_end
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Oct 20, 2017
1 parent 5493e11 commit 1e5a24c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/integrators/integrator_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ end
end

@inline function solution_endpoint_match_cur_integrator!(integrator)
if integrator.sol.t[integrator.saveiter] != integrator.t
if integrator.opts.save_end && integrator.sol.t[integrator.saveiter] != integrator.t
integrator.saveiter += 1
copyat_or_push!(integrator.sol.t,integrator.saveiter,integrator.t)
if integrator.opts.save_idxs == nothing
Expand Down
1 change: 1 addition & 0 deletions src/options_type.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ mutable struct SDEOptions{tTypeNoUnits,tType,F2,F3,F4,F5,F6,tstopsType,ECType,ST
qoldinit::tTypeNoUnits
dense::Bool
save_start::Bool
save_end::Bool
save_noise::Bool
callback::F3
isoutofdomain::F4
Expand Down
10 changes: 5 additions & 5 deletions src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function init(
save_timeseries = nothing,
save_everystep = isempty(saveat),
save_idxs = nothing,
save_start = true,
save_start = true,save_end = true,
dense = save_everystep,
calck = (!isempty(setdiff(saveat,tstops)) || dense),
adaptive=isadaptive(alg),gamma=9//10,
Expand Down Expand Up @@ -228,7 +228,7 @@ function init(
progress_name,progress_message,
timeseries_errors,dense_errors,
tTypeNoUnits(beta1),tTypeNoUnits(beta2),map(uEltypeNoUnits,delta),tTypeNoUnits(qoldinit),
dense,save_start,save_noise,
dense,save_start,save_end,save_noise,
callbacks_internal,isoutofdomain,unstable_check,verbose,calck,force_dtmin,
advance_to_tstop,stop_at_next_tstop)

Expand Down Expand Up @@ -373,16 +373,16 @@ function init(
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.discrete_callbacks) ||
any((c)->c.save_positions[2],callbacks_internal.continuous_callbacks))
savevalues!(integrator,true)
end
end

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

initialize!(integrator,integrator.cache)
end

Expand Down

0 comments on commit 1e5a24c

Please sign in to comment.