Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 32a70d2

Browse files
Willi BraunOpenModelica-Hudson
authored andcommitted
fix kinsol, reinit klu matrix onyl if klu is used
1 parent 639c7bd commit 32a70d2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

SimulationRuntime/c/simulation/solver/kinsolSolver.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,11 +748,13 @@ int nlsKinsolErrorHandler(int errorCode, DATA *data, NONLINEAR_SYSTEM_DATA *nlsD
748748
case KIN_LSETUP_FAIL:
749749
case KIN_LSOLVE_FAIL:
750750
warningStreamPrint(LOG_NLS, 0, "kinsols matrix need new factorization. Try again.\n");
751-
KINKLUReInit(kinsolData->kinsolMemory, kinsolData->size, kinsolData->nnz, 2);
751+
if (nlsData->isPatternAvailable){
752+
KINKLUReInit(kinsolData->kinsolMemory, kinsolData->size, kinsolData->nnz, 2);
753+
}
752754
return 1;
753755
case KIN_MAXITER_REACHED:
754756
case KIN_REPTD_SYSFUNC_ERR:
755-
warningStreamPrint(LOG_NLS, 0, "kinsols runs into issues retry with differnt configuration.\n");
757+
warningStreamPrint(LOG_NLS, 0, "kinsols runs into issues retry with different configuration.\n");
756758
retValue = 1;
757759
break;
758760
default:

0 commit comments

Comments
 (0)