From 9fcb6a73475d405f7f333c399e082168d1faaf20 Mon Sep 17 00:00:00 2001 From: young Date: Tue, 31 Mar 2009 13:13:03 +0000 Subject: [PATCH] Upgraded: PETSc sparse matrix to migrate to PETSc 3.0.0 git-svn-id: https://svn.dealii.org/trunk@18533 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/source/petsc_sparse_matrix.cc | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/deal.II/lac/source/petsc_sparse_matrix.cc b/deal.II/lac/source/petsc_sparse_matrix.cc index 9c2b655bb5..183127fd41 100644 --- a/deal.II/lac/source/petsc_sparse_matrix.cc +++ b/deal.II/lac/source/petsc_sparse_matrix.cc @@ -149,8 +149,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)); } } @@ -184,13 +190,19 @@ 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)); } } - + template void @@ -240,7 +252,14 @@ namespace PETScWrappers // In the end, tell the matrix that // it should not expect any new // entries. - 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)); } -- 2.39.5