Skip to content

Commit 6526e5a

Browse files
feat: save discretes alongside callback save
1 parent 3979645 commit 6526e5a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/callbacks.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,11 @@ function apply_callback!(integrator,
596596

597597
@inbounds if callback.save_positions[2]
598598
savevalues!(integrator, true)
599+
if callback isa VectorContinuousCallback
600+
SciMLBase.save_discretes!(integrator, callback, event_idx)
601+
else
602+
SciMLBase.save_discretes!(integrator, callback)
603+
end
599604
saved_in_cb = true
600605
end
601606
return true, saved_in_cb
@@ -622,6 +627,7 @@ end
622627
end
623628
@inbounds if callback.save_positions[2]
624629
savevalues!(integrator, true)
630+
SciMLBase.save_discretes!(integrator, callback)
625631
saved_in_cb = true
626632
end
627633
end

0 commit comments

Comments
 (0)