Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Oct 9, 2024
1 parent 114319f commit a8aea88
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/forwardproblem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,16 +315,16 @@ void ForwardProblem::storeEvent() {
}

void ForwardProblem::store_pre_event_state(bool seflag, bool initial_event) {
/* if we need to do forward sensitivities later on we need to store the old
* x and the old xdot */
// if we need to do forward sensitivities later on,
// we need to store the old x and the old xdot
if (solver->getSensitivityOrder() >= SensitivityOrder::first) {
/* store x and xdot to compute jump in sensitivities */
x_old_.copy(x_);
}
if (solver->computingFSA()) {
model->fxdot(t_, x_, dx_, xdot_);
xdot_old_.copy(xdot_);
dx_old_.copy(dx_);
}
if (solver->computingFSA()) {
/* compute event-time derivative only for primary events, we get
* into trouble with multiple simultaneously firing events here (but
* is this really well defined then?), in that case just use the
Expand All @@ -340,9 +340,6 @@ void ForwardProblem::store_pre_event_state(bool seflag, bool initial_event) {
if (initial_event) // t0 has no parameter dependency
std::fill(stau_.begin(), stau_.end(), 0.0);
} else if (solver->computingASA()) {
model->fxdot(t_, x_, dx_, xdot_);
xdot_old_ = xdot_;
dx_old_ = dx_;
/* store x to compute jump in discontinuity */
x_old_disc_.push_back(x_old_);

Check warning on line 344 in src/forwardproblem.cpp

View check run for this annotation

Codecov / codecov/patch

src/forwardproblem.cpp#L344

Added line #L344 was not covered by tests
xdot_old_disc_.push_back(xdot_old_);
Expand Down

0 comments on commit a8aea88

Please sign in to comment.