@@ -362,42 +362,26 @@ function generate_discrete_affect(
362
362
for (val, i) in zip (result, $ cont_to_disc_idxs)
363
363
$ (_set_parameter_unchecked!)(p, val, i; update_dependent = false )
364
364
end
365
- end
366
- else
367
- :(copyto! (c2d_view, c2d_obs (integrator. u, p, t)))
368
- end
369
- )
370
- # @show "after c2d", p
371
- $ (
372
- if use_index_cache
373
- quote
374
365
if ! $ empty_disc
375
366
# NOTE: the first and third arguments to `disc` MAY NOT be aliased
376
367
disc (cache, disc_unknowns, p... , t) # Cache needed for atomic state update
377
368
for (val, i) in zip (cache, $ disc_range)
378
369
$ (_set_parameter_unchecked!)(p, val, i; update_dependent = false )
379
370
end
380
- copyto! (disc_unknowns, cache)
371
+ # copyto!(disc_unknowns, cache)
381
372
end
382
- end
383
- else
384
- quote
385
- $ empty_disc || disc (cache, disc_unknowns, p, t) # Cache needed for atomic state update
386
- copyto! (disc_unknowns, cache)
387
- end
388
- end
389
- )
390
- # @show "after state update", p
391
- $ (
392
- if use_index_cache
393
- quote
394
373
result = d2c_obs (disc_unknowns, p... , t)
395
374
for (val, i) in zip (result, $ disc_to_cont_idxs)
396
375
$ (_set_parameter_unchecked!)(p, val, i; update_dependent = false )
397
376
end
398
377
end
399
378
else
400
- :(copyto! (d2c_view, d2c_obs (disc_unknowns, p, t)))
379
+ quote
380
+ copyto! (c2d_view, c2d_obs (integrator. u, p, t))
381
+ $ empty_disc || disc (cache, disc_unknowns, p, t) # Cache needed for atomic state update
382
+ copyto! (disc_unknowns, cache)
383
+ copyto! (d2c_view, d2c_obs (disc_unknowns, p, t))
384
+ end
401
385
end
402
386
)
403
387
0 commit comments