Adds ExecuteForcedEvents() to trigger all the forced events in a System (or Diagram) and write any modified variables back to a Context.
This is like the existing System::ExecuteInitializationEvents(), but for Forced triggers rather than Initialization triggers. ExecuteForcedEvents() sequences the events in the same way as the Simulator does: unrestricted events, then discrete events, then publish events. There is an option to suppress publish events.
Adds
ExecuteForcedEvents()
to trigger all the forced events in a System (or Diagram) and write any modified variables back to a Context.This is like the existing
System::ExecuteInitializationEvents()
, but for Forced triggers rather than Initialization triggers.ExecuteForcedEvents()
sequences the events in the same way as the Simulator does: unrestricted events, then discrete events, then publish events. There is an option to suppress publish events.Unit tests and python bindings are included.
Resolves #21659
This change is![Reviewable](https://reviewable.io/review_button.svg)