From: young Date: Tue, 31 Mar 2009 13:12:22 +0000 (+0000) Subject: Upgraded: PETSc parallel sparse matrix to migrate to PETSc 3.0.0 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2c10acda2c451ba4ae8a21051c9f80c31163e54;p=dealii-svn.git Upgraded: PETSc parallel sparse matrix to migrate to PETSc 3.0.0 git-svn-id: https://svn.dealii.org/trunk@18532 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/source/petsc_parallel_sparse_matrix.cc b/deal.II/lac/source/petsc_parallel_sparse_matrix.cc index 04c0aba9a1..0b9c1c2a76 100644 --- a/deal.II/lac/source/petsc_parallel_sparse_matrix.cc +++ b/deal.II/lac/source/petsc_parallel_sparse_matrix.cc @@ -192,8 +192,14 @@ namespace PETScWrappers // set symmetric flag, if so requested if (is_symmetric == true) { +#if (PETSC_VERSION_MAJOR <= 2) const int ierr = MatSetOption (matrix, MAT_SYMMETRIC); +#else + const int ierr + = MatSetOption (matrix, MAT_SYMMETRIC, PETSC_TRUE); +#endif + AssertThrow (ierr == 0, ExcPETScError(ierr)); } } @@ -246,8 +252,14 @@ namespace PETScWrappers // set symmetric flag, if so requested if (is_symmetric == true) { +#if (PETSC_VERSION_MAJOR <= 2) const int ierr = MatSetOption (matrix, MAT_SYMMETRIC); +#else + const int ierr + = MatSetOption (matrix, MAT_SYMMETRIC, PETSC_TRUE); +#endif + AssertThrow (ierr == 0, ExcPETScError(ierr)); } } @@ -453,7 +465,15 @@ namespace PETScWrappers // further entries, so PETSc can // internally optimize some data // structures. - MatSetOption (matrix, MAT_NO_NEW_NONZERO_LOCATIONS); +#if (PETSC_VERSION_MAJOR <= 2) + const int ierr = + MatSetOption (matrix, MAT_NO_NEW_NONZERO_LOCATIONS); +#else + const int ierr = + MatSetOption (matrix, MAT_NEW_NONZERO_LOCATIONS, PETSC_FALSE); +#endif + + AssertThrow (ierr == 0, ExcPETScError(ierr)); } }