Skip to content

Commit

Permalink
Fixed bug with premature exit when event at stop time.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@2631 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Peter Aronsson committed Dec 14, 2006
1 parent c24bf7c commit c3c4f23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions c_runtime/solver_dasrt.cpp
Expand Up @@ -261,7 +261,7 @@ int dassl_main(int argc, char**argv,double &start, double &stop, double &step,
// Restart simulation
info[0] = 0;
if (tout-globalData->timeValue < atol) tout = newTime(globalData->timeValue,step,stop);
if (tout == stop) goto exit; // If already at end of simulation disregard event.
if (globalData->timeValue >= stop ) goto exit;
calcEnabledZeroCrossings();
DDASRT(functionDAE_res,
&globalData->nStates, &globalData->timeValue,
Expand Down Expand Up @@ -289,7 +289,7 @@ int dassl_main(int argc, char**argv,double &start, double &stop, double &step,

saveall();
tout = newTime(globalData->timeValue,step,stop); // TODO: check time events here. Maybe dassl should not be allowed to simulate past the scheduled time event.

if (globalData->timeValue >= stop) goto exit;
calcEnabledZeroCrossings();
DDASRT(functionDAE_res,
&globalData->nStates, &globalData->timeValue,
Expand Down

0 comments on commit c3c4f23

Please sign in to comment.