From f2ddeebe2144b31dcc38291ceaf281f1046b56e4 Mon Sep 17 00:00:00 2001 From: BalticPinguin Date: Fri, 30 Jun 2023 12:21:04 +0200 Subject: [PATCH] Set operators also for unrestricted solve & without preconditioner. --- src/solvers/petsc_linear_solver.C | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/solvers/petsc_linear_solver.C b/src/solvers/petsc_linear_solver.C index 5d82ead5120..784d77c2691 100644 --- a/src/solvers/petsc_linear_solver.C +++ b/src/solvers/petsc_linear_solver.C @@ -632,6 +632,11 @@ PetscLinearSolver::solve_base (SparseMatrix * matrix, ierr = KSPSetOperators(_ksp, mat, const_cast *>(precond)->mat()); LIBMESH_CHKERR(ierr); } + else + { + ierr = KSPSetOperators(_ksp, mat, mat); + LIBMESH_CHKERR(ierr); + } if (this->_preconditioner) {