Skip to content

Commit

Permalink
fix in Ida, Ida did not stop if an error accrued in non linear solver
Browse files Browse the repository at this point in the history
  • Loading branch information
niklwors committed Aug 13, 2015
1 parent ed2fbf8 commit 4906ef4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions SimulationRuntime/cpp/Solver/IDA/IDA.cpp
Expand Up @@ -692,7 +692,7 @@ int Ida::calcFunction(const double& time, const double* y, double* f)
{
std::string error = ex.what();
cerr << "IDA integration error: " << error;
returnValue = 1;
returnValue = -1;
}

#ifdef RUNTIME_PROFILING
Expand All @@ -709,9 +709,9 @@ int Ida::CV_fCallback(double t, N_Vector y, N_Vector ydot, N_Vector resval, void
{
double* ypval=NV_DATA_S(ydot);
double* rval=NV_DATA_S(resval);
((Ida*) user_data)->calcFunction(t, NV_DATA_S(y), NV_DATA_S(resval));
int status = ((Ida*) user_data)->calcFunction(t, NV_DATA_S(y), NV_DATA_S(resval));
for(size_t i(0); i<((Ida*) user_data)->_dimSys; ++i) rval[i]-=ypval[i];
return 0;
return status;
}

void Ida::giveZeroVal(const double &t, const double *y, double *zeroValue)
Expand Down

0 comments on commit 4906ef4

Please sign in to comment.