Skip to content

Commit

Permalink
- improved error handling
Browse files Browse the repository at this point in the history
- reactivated colored jacobian

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@22386 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Marcus Walther committed Sep 22, 2014
1 parent b7d6d38 commit 0bbf7da
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
29 changes: 24 additions & 5 deletions SimulationRuntime/cpp/Core/SimController/SimManager.cpp
Expand Up @@ -391,17 +391,36 @@ void SimManager::runSingleProcess()
boost::shared_ptr<IEvent> event_system = boost::dynamic_pointer_cast<IEvent>(_mixed_system);
boost::shared_ptr<IContinuous> cont_system = boost::dynamic_pointer_cast<IContinuous>(_mixed_system);
boost::shared_ptr<ITime> timeevent_system = boost::dynamic_pointer_cast<ITime>(_mixed_system);
boost::shared_ptr<IStepEvent> step_event_system = boost::dynamic_pointer_cast<IStepEvent>(_mixed_system);
boost::shared_ptr<IStepEvent> step_event_system = boost::dynamic_pointer_cast<IStepEvent>(_mixed_system);
double
startTime,
endTime,
*zeroVal_0,
*zeroVal_new;
int
dimZeroF;
int dimZeroF;

std::vector<std::pair<double,int> > tStopsSub;

std::vector<std::pair<double,int> >
tStopsSub;
if(!event_system)
{
std::cerr << "Could not get event system" << std::endl;
return;
}
if(!cont_system)
{
std::cerr << "Could not get continuous-event system" << std::endl;
return;
}
if(!timeevent_system)
{
std::cerr << "Could not get time-event system" << std::endl;
return;
}
if(!step_event_system)
{
std::cerr << "Could not get step-event system" << std::endl;
return;
}

_H =_tEnd;
_solverTask = ISolver::SOLVERCALL(_solverTask | ISolver::RECORDCALL);
Expand Down
4 changes: 2 additions & 2 deletions SimulationRuntime/cpp/Solver/CVode/CVode.cpp
Expand Up @@ -219,13 +219,13 @@ void Cvode::initialize()
throw std::invalid_argument("Cvode::initialize()");

// Use own jacobian matrix
// _idid = CVDlsSetDenseJacFn(_cvodeMem, CV_JCallback);
_idid = CVDlsSetDenseJacFn(_cvodeMem, &CV_JCallback);
if (_idid < 0)
throw std::invalid_argument("CVode::initialize()");

if (_dimZeroFunc)
{
_idid = CVodeRootInit(_cvodeMem, _dimZeroFunc, CV_ZerofCallback);
_idid = CVodeRootInit(_cvodeMem, _dimZeroFunc, &CV_ZerofCallback);

memset(_zeroSign, 0, _dimZeroFunc * sizeof(int));
_idid = CVodeSetRootDirection(_cvodeMem, _zeroSign);
Expand Down

0 comments on commit 0bbf7da

Please sign in to comment.