Skip to content

Commit

Permalink
fix in cpp runtime cvode, used wrong cvode zerosearch return value
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@17337 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
niklwors committed Sep 23, 2013
1 parent 3666077 commit 6358903
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 5 additions & 3 deletions SimulationRuntime/cpp/Solver/CVode/CVode.cpp
Expand Up @@ -294,7 +294,7 @@ void Cvode::CVodeCore()
}

// A root is found
if(_idid == 2)
if(_cv_rt == 2)
{
_zeroFound = true;
_time_system->setTime(_tCurrent);
Expand All @@ -308,11 +308,13 @@ void Cvode::CVodeCore()
if(_zeroFound)
{
_idid = CVodeGetRootInfo(_cvodeMem, _zeroSign);
for(int i=0;i<_dimZeroFunc;i++)
/* for(int i=0;i<_dimZeroFunc;i++)
_events[i] = bool(_zeroSign[i]);
*/
//Event Iteration starten
_event_system->getZeroFunc(_zeroVal);

_mixed_system->handleSystemEvents(_events);
_event_system->getZeroFunc(_zeroVal);

}//EVENT Iteration beendet

Expand Down
7 changes: 4 additions & 3 deletions SimulationRuntime/cpp/Solver/CVode/CVode.h
Expand Up @@ -99,7 +99,8 @@ class Cvode
long int
_dimSys, ///< Input - (total) Dimension of system (=number of ODE)
_idid, ///< Input, Output - Status Flag
_locStps; ///< Output - Number of Steps between two events
_locStps, ///< Output - Number of Steps between two events
_cv_rt; ///< Temp - CVode return flag

int
_outStps, ///< Output - Total number of output-steps
Expand All @@ -124,8 +125,8 @@ class Cvode

bool
_bWritten, ///< Temp - Is output already written
_zeroFound,
_cv_rt; ///< Temp - CVode return flag
_zeroFound;




Expand Down

0 comments on commit 6358903

Please sign in to comment.