Skip to content

Commit

Permalink
extended error message in Cvode in case of too many events in small t…
Browse files Browse the repository at this point in the history
…ime interval.
  • Loading branch information
qichenghua authored and OpenModelica-Hudson committed Mar 21, 2017
1 parent 4712b7a commit 52cd6ad
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions SimulationRuntime/cpp/Solver/CVode/CVode.cpp
Expand Up @@ -547,8 +547,15 @@ void Cvode::CVodeCore()
_tLastEvent = _tCurrent;
_event_n = 0;
}
else
throw ModelicaSimulationError(EVENT_HANDLING,"Number of events exceeded in time interval " + to_string(_abs) + " at time " + to_string(_tCurrent));
else{
std::stringstream zeros;
_idid = CVodeGetRootInfo(_cvodeMem, _zeroSign);
for (int i = 0; i < _dimZeroFunc; i++){
if(_zeroSign[i]!=0)
zeros << i << " ";
}
throw ModelicaSimulationError(EVENT_HANDLING,"Number of events of zero function(s) " + zeros.str() + "exceeded in time interval " + to_string(_abs) + " at time " + to_string(_tCurrent));
}

// CVode has interpolated the states at time 'tCurrent'
_time_system->setTime(_tCurrent);
Expand Down

0 comments on commit 52cd6ad

Please sign in to comment.