Skip to content

Commit

Permalink
Fix segmentation fault when using KINSOL with LAPACK as linear solver.
Browse files Browse the repository at this point in the history
Allocate memory for dense Jacobian when LAPACK is selected.
  • Loading branch information
AnHeuermann authored and AnHeuermann committed Sep 3, 2021
1 parent 5eb2c51 commit 0f49ff7
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -165,7 +165,7 @@ static void resetKinsolMemory(NLS_KINSOL_DATA *kinsolData,
checkReturnFlag_SUNDIALS(flag, SUNDIALS_KIN_FLAG, "KINInit");

/* Create matrix object */
if (kinsolData->linearSolverMethod == NLS_LS_DEFAULT) {
if (kinsolData->linearSolverMethod == NLS_LS_DEFAULT || kinsolData->linearSolverMethod == NLS_LS_LAPACK) {
kinsolData->J = SUNDenseMatrix(size, size);
} else if (kinsolData->linearSolverMethod == NLS_LS_KLU) {
kinsolData->nnz = nlsData->sparsePattern->numberOfNoneZeros;
Expand Down

0 comments on commit 0f49ff7

Please sign in to comment.