Skip to content

Commit

Permalink
fix kinsol, reinit klu matrix onyl if klu is used
Browse files Browse the repository at this point in the history
  • Loading branch information
Willi Braun authored and OpenModelica-Hudson committed Apr 10, 2017
1 parent 639c7bd commit 32a70d2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions SimulationRuntime/c/simulation/solver/kinsolSolver.c
Expand Up @@ -748,11 +748,13 @@ int nlsKinsolErrorHandler(int errorCode, DATA *data, NONLINEAR_SYSTEM_DATA *nlsD
case KIN_LSETUP_FAIL:
case KIN_LSOLVE_FAIL:
warningStreamPrint(LOG_NLS, 0, "kinsols matrix need new factorization. Try again.\n");
KINKLUReInit(kinsolData->kinsolMemory, kinsolData->size, kinsolData->nnz, 2);
if (nlsData->isPatternAvailable){
KINKLUReInit(kinsolData->kinsolMemory, kinsolData->size, kinsolData->nnz, 2);
}
return 1;
case KIN_MAXITER_REACHED:
case KIN_REPTD_SYSFUNC_ERR:
warningStreamPrint(LOG_NLS, 0, "kinsols runs into issues retry with differnt configuration.\n");
warningStreamPrint(LOG_NLS, 0, "kinsols runs into issues retry with different configuration.\n");
retValue = 1;
break;
default:
Expand Down

0 comments on commit 32a70d2

Please sign in to comment.