Skip to content
Snippets Groups Projects
Commit c98b8044 authored by wenqing's avatar wenqing
Browse files

Changed if-condition for PETSc version according to the suggestion by Nori

parent 879658df
No related branches found
No related tags found
No related merge requests found
......@@ -117,11 +117,7 @@ IF(OGS_USE_LIS)
ENDIF()
IF(OGS_USE_PETSC)
MESSAGE(STATUS "PETSc version is ${PETSC_VERSION}")
ADD_DEFINITIONS(-DUSE_PETSC)
IF(PETSC_VERSION VERSION_GREATER 3.4)
ADD_DEFINITIONS(-DPETSC_V35)
ENDIF(PETSC_VERSION VERSION_GREATER 3.4)
ENDIF()
IF(OGS_USE_EIGEN)
......
......@@ -41,9 +41,9 @@ bool PETScLinearSolver::solve(const PETScVector &b, PETScVector &x)
PetscMemoryGetCurrentUsage(&mem1);
#endif
#ifdef PETSC_V35
#if (PETSC_VERSION_MAJOR == 3) && (PETSC_VERSION_MINOR > 4)
KSPSetOperators(_solver, _A.getRawMatrix(), _A.getRawMatrix());
#else
#else
KSPSetOperators(_solver, _A.getRawMatrix(), _A.getRawMatrix(), DIFFERENT_NONZERO_PATTERN);
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment