Skip to content
Permalink
Browse files

Simulation support: reinitialise our solver, if needed, at the beginn…

…ing of our forever loop.

Not sure why it used to be at the end of our forever loop since it
clearly ought to be at the beginning (to ensure that our call to
OdeSolver::solve() is right).
  • Loading branch information...
agarny committed Mar 2, 2018
1 parent 0c6f407 commit 11d48a09bd7b6d1a1c83eb3ab4d925aab2535ecb
Showing with 11 additions and 11 deletions.
  1. +11 −11 src/plugins/support/SimulationSupport/src/simulationworker.cpp
@@ -285,6 +285,17 @@ void SimulationWorker::started()
QMutex pausedMutex;

forever {
// Reinitialise our solver, if we have an NLA solver or if the model
// got reset
// Note: indeed, with a solver such as CVODE, we need to update our
// internals...

if (nlaSolver || mReset) {
odeSolver->reinitialize(mCurrentPoint);

mReset = false;
}

// Determine our next point and compute our model up to it

++pointCounter;
@@ -348,17 +359,6 @@ void SimulationWorker::started()
timer.start();

}

// Reinitialise our solver, if we have an NLA solver or if the
// model got reset
// Note: indeed, with a solver such as CVODE, to solve an NLA
// system requires updating its internals...

if (nlaSolver || mReset) {
odeSolver->reinitialize(mCurrentPoint);

mReset = false;
}
}
}

0 comments on commit 11d48a0

Please sign in to comment.
You can’t perform that action at this time.