File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -840,9 +840,17 @@ function SciMLBase.create_parameter_timeseries_collection(
840840 return ParameterTimeseriesCollection (Tuple (buffers), copy (ps))
841841end
842842
843+ @inline __get_blocks (tsidx:: Int ) = ()
844+ @inline function __get_blocks (tsidx:: Int , buffer:: BlockedArray , buffers... )
845+ (buffer[Block (tsidx)], __get_blocks (tsidx, buffers... )... )
846+ end
847+ @inline function __get_blocks (tsidx:: Int , buffer:: BlockedArray{<:AbstractArray} , buffers... )
848+ (copy .(buffer[Block (tsidx)]), __get_blocks (tsidx, buffers... )... )
849+ end
850+
843851function SciMLBase. get_saveable_values (
844852 sys:: AbstractSystem , ps:: MTKParameters , timeseries_idx)
845- return NestedGetIndex (Tuple (buffer[ Block ( timeseries_idx)] for buffer in ps. discrete))
853+ return NestedGetIndex (__get_blocks ( timeseries_idx, ps. discrete... ))
846854end
847855
848856function save_callback_discretes! (integ:: SciMLBase.DEIntegrator , callback)
You can’t perform that action at this time.
0 commit comments