Skip to content

Commit

Permalink
- provide some more information if kinsol failes
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@14747 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
lochel committed Jan 11, 2013
1 parent 354f270 commit 84e495e
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions SimulationRuntime/c/simulation/solver/kinsolSolver.c
Expand Up @@ -272,9 +272,27 @@
N_VDestroy_Serial(c);
KINFree(&kmem);

if(error_code < 0)
if(DEBUG_STREAM(LOG_NLS))
{
if(error_code == KIN_LINESEARCH_NONCONV)
{
WARNING(LOG_NLS, "kinsol failed. The linesearch algorithm was unable to find an iterate sufficiently distinct from the current iterate.");
return 0;
}
else if(error_code == KIN_MAXITER_REACHED)
{
WARNING(LOG_NLS, "kinsol failed. The maximum number of nonlinear iterations has been reached.");
return 0;
}
else if(error_code < 0)
{
WARNING1(LOG_NLS, "kinsol failed [error_code=%d]", error_code);
return 0;
}
}
else if(error_code < 0)
{
WARNING1(LOG_STDOUT, "kinsol failed [error_code=%d]. see last warning. use [-lv LOG_NLS] for more output.", error_code);
WARNING(LOG_STDOUT, "kinsol failed. Use [-lv LOG_NLS] for more output.");
return 0;
}

Expand Down

0 comments on commit 84e495e

Please sign in to comment.