Skip to content

Commit ceddba3

Browse files
Merge pull request #1199 from AayushSabharwal/as/better-disc-save
feat: save discretes alongside callback save
2 parents 952e815 + 1b24bc8 commit ceddba3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Printf = "1.9"
9494
RecursiveArrayTools = "3.1"
9595
Reexport = "1.0"
9696
ReverseDiff = "1"
97-
SciMLBase = "2.114.0"
97+
SciMLBase = "2.115.0"
9898
SciMLOperators = "1"
9999
SciMLStructures = "1.5"
100100
Setfield = "1"

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)