Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 52cd6ad

Browse files
qichenghuaOpenModelica-Hudson
authored andcommitted
extended error message in Cvode in case of too many events in small time interval.
1 parent 4712b7a commit 52cd6ad

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

SimulationRuntime/cpp/Solver/CVode/CVode.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,15 @@ void Cvode::CVodeCore()
547547
_tLastEvent = _tCurrent;
548548
_event_n = 0;
549549
}
550-
else
551-
throw ModelicaSimulationError(EVENT_HANDLING,"Number of events exceeded in time interval " + to_string(_abs) + " at time " + to_string(_tCurrent));
550+
else{
551+
std::stringstream zeros;
552+
_idid = CVodeGetRootInfo(_cvodeMem, _zeroSign);
553+
for (int i = 0; i < _dimZeroFunc; i++){
554+
if(_zeroSign[i]!=0)
555+
zeros << i << " ";
556+
}
557+
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));
558+
}
552559

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

0 commit comments

Comments
 (0)