From fa3207d16e9b1bfe04a6eb7a48a8d594ccfc80cc Mon Sep 17 00:00:00 2001
From: Wenqing Wang <wenqing.wang@ufz.de>
Date: Tue, 9 Sep 2014 12:12:52 +0200
Subject: [PATCH] Added one more condition for PETSc versions

---
 MathLib/LinAlg/PETSc/PETScLinearSolver.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MathLib/LinAlg/PETSc/PETScLinearSolver.cpp b/MathLib/LinAlg/PETSc/PETScLinearSolver.cpp
index 2a3d6d2fefb..5a3c4880058 100644
--- a/MathLib/LinAlg/PETSc/PETScLinearSolver.cpp
+++ b/MathLib/LinAlg/PETSc/PETScLinearSolver.cpp
@@ -41,7 +41,7 @@ bool PETScLinearSolver::solve(const PETScVector &b, PETScVector &x)
     PetscMemoryGetCurrentUsage(&mem1);
 #endif
 
-#if (PETSC_VERSION_MAJOR == 3) && (PETSC_VERSION_MINOR > 4)
+#if (PETSC_VERSION_MAJOR == 3) && (PETSC_VERSION_MINOR > 4 || PETSC_VERSION_MAJOR > 3)
     KSPSetOperators(_solver, _A.getRawMatrix(), _A.getRawMatrix());
 #else
     KSPSetOperators(_solver, _A.getRawMatrix(), _A.getRawMatrix(), DIFFERENT_NONZERO_PATTERN);
-- 
GitLab