]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Upgraded: PETSc parallel sparse matrix to migrate to PETSc 3.0.0
authoryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 31 Mar 2009 13:12:22 +0000 (13:12 +0000)
committeryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 31 Mar 2009 13:12:22 +0000 (13:12 +0000)
git-svn-id: https://svn.dealii.org/trunk@18532 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/source/petsc_parallel_sparse_matrix.cc

index 04c0aba9a19fb3b98b2a4d7de59888cab46418f8..0b9c1c2a76360f426c9e8681003fa327cd8d7a00 100644 (file)
@@ -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));
         }
     }
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.