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

deal.II/lac/source/petsc_sparse_matrix.cc

index 9c2b655bb521f08fd4a75bb0d740f7ce6e222cc7..183127fd41c6113caf3198d81a3fdbb894bec22d 100644 (file)
@@ -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 <typename SparsityType>
   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));
   }
 
 

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.