]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Update bundle to provide deal.II <-> PETSc-3.2 compatibility
authoryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 13 Sep 2011 09:41:50 +0000 (09:41 +0000)
committeryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 13 Sep 2011 09:41:50 +0000 (09:41 +0000)
git-svn-id: https://svn.dealii.org/trunk@24320 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/petsc_matrix_base.h
deal.II/include/deal.II/lac/petsc_vector.h
deal.II/source/lac/petsc_matrix_base.cc
deal.II/source/lac/petsc_parallel_sparse_matrix.cc
deal.II/source/lac/petsc_parallel_vector.cc
deal.II/source/lac/petsc_precondition.cc
deal.II/source/lac/petsc_solver.cc
deal.II/source/lac/petsc_sparse_matrix.cc
deal.II/source/lac/petsc_vector.cc
deal.II/source/lac/petsc_vector_base.cc

index 5939f5c5ace127ee354a43cbc1eeabca19f81542..11a97cefa4511ddb8e6ccbf6ed32dd85f1e67977 100644 (file)
@@ -1108,10 +1108,10 @@ namespace PETScWrappers
                                         * $1000\times32$-bit machine
                                         * precision.
                                         */
-#if DEAL_II_PETSC_VERSION_DEV()
-      PetscBool
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
+      PetscTruth 
 #else
-       PetscTruth 
+       PetscBool
 #endif
        is_symmetric (const double tolerance = 1.e-12);
 
@@ -1125,14 +1125,14 @@ namespace PETScWrappers
                                         * $1000\times32$-bit machine
                                         * precision.
                                         */
-#if DEAL_II_PETSC_VERSION_DEV()
-      PetscBool
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
+      PetscTruth 
 #else
-       PetscTruth 
+       PetscBool
 #endif
        is_hermitian (const double tolerance = 1.e-12);
 #endif
-
+      
                                         /*
                                         * Abstract PETSc object that helps view
                                         * in ASCII other PETSc objects. Currently
index 98ca66313dbcf4f4d2340d9678021eab8736e1dc..b088a7ff7b098ee4a5ac63a8f542c7a9aa620809 100644 (file)
@@ -283,10 +283,10 @@ namespace PETScWrappers
                                      // the petsc function we call wants to
                                      // generate the vector itself, so destroy
                                      // the old one first
-#if DEAL_II_PETSC_VERSION_DEV()
-       ierr = VecDestroy (&vector);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
        ierr = VecDestroy (vector);
+#else
+       ierr = VecDestroy (&vector);
 #endif
        AssertThrow (ierr == 0, ExcPETScError(ierr));
       }
@@ -335,10 +335,10 @@ namespace PETScWrappers
 #endif        
     AssertThrow (ierr == 0, ExcPETScError(ierr));
 
-#if DEAL_II_PETSC_VERSION_DEV()
-    ierr = VecScatterDestroy (&ctx);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
     ierr = VecScatterDestroy (ctx);
+#else
+    ierr = VecScatterDestroy (&ctx);
 #endif
     AssertThrow (ierr == 0, ExcPETScError(ierr));
 #endif
index ebabbdfd7ab0960fcfb14c846f0136447e0b9fc5..002f5ba661108aac1942c0ba103674c03dbc370a 100644 (file)
@@ -90,10 +90,10 @@ namespace PETScWrappers
 
   MatrixBase::~MatrixBase ()
   {
-#if DEAL_II_PETSC_VERSION_DEV()
-    const int ierr = MatDestroy (&matrix);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
     const int ierr = MatDestroy (matrix);
+#else
+    const int ierr = MatDestroy (&matrix);
 #endif
     AssertThrow (ierr == 0, ExcPETScError(ierr));
   }
@@ -104,10 +104,10 @@ namespace PETScWrappers
   MatrixBase::clear ()
   {
                                      // destroy the matrix...
-#if DEAL_II_PETSC_VERSION_DEV()
-    int ierr = MatDestroy (&matrix);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
     int ierr = MatDestroy (matrix);
+#else
+    int ierr = MatDestroy (&matrix);
 #endif
     AssertThrow (ierr == 0, ExcPETScError(ierr));
                                      // ...and replace it by an empty
@@ -154,10 +154,10 @@ namespace PETScWrappers
 #endif
 
     IS index_set;
-#if DEAL_II_PETSC_VERSION_DEV()
-    ISCreateGeneral (get_mpi_communicator(), 1, &petsc_row, PETSC_COPY_VALUES, &index_set);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
     ISCreateGeneral (get_mpi_communicator(), 1, &petsc_row, &index_set);
+#else
+    ISCreateGeneral (get_mpi_communicator(), 1, &petsc_row, PETSC_COPY_VALUES, &index_set);
 #endif
 
 
@@ -165,21 +165,21 @@ namespace PETScWrappers
     const int ierr
       = MatZeroRows(matrix, index_set, &new_diag_value);
 #else
-#if DEAL_II_PETSC_VERSION_DEV()
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
     const int ierr
-      = MatZeroRowsIS(matrix, index_set, new_diag_value, PETSC_NULL, PETSC_NULL);
+      = MatZeroRowsIS(matrix, index_set, new_diag_value);
 #else
     const int ierr
-      = MatZeroRowsIS(matrix, index_set, new_diag_value);
+      = MatZeroRowsIS(matrix, index_set, new_diag_value, PETSC_NULL, PETSC_NULL);
 #endif
 #endif
 
     AssertThrow (ierr == 0, ExcPETScError(ierr));
 
-#if DEAL_II_PETSC_VERSION_DEV()
-    ISDestroy (&index_set);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
     ISDestroy (index_set);
+#else
+    ISDestroy (&index_set);
 #endif
 
     compress ();
@@ -205,33 +205,34 @@ namespace PETScWrappers
                                      // to call them even if #rows is empty,
                                      // since this is a collective operation
     IS index_set;
-#if DEAL_II_PETSC_VERSION_DEV()
+
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
     ISCreateGeneral (get_mpi_communicator(), rows.size(),
-                     &petsc_rows[0], PETSC_COPY_VALUES, &index_set);
+                     &petsc_rows[0], &index_set);
 #else
     ISCreateGeneral (get_mpi_communicator(), rows.size(),
-                     &petsc_rows[0], &index_set);
+                     &petsc_rows[0], PETSC_COPY_VALUES, &index_set);
 #endif
 
 #if DEAL_II_PETSC_VERSION_LT(2,3,0)
     const int ierr
       = MatZeroRows(matrix, index_set, &new_diag_value);
 #else
-#if DEAL_II_PETSC_VERSION_DEV()
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
     const int ierr
-      = MatZeroRowsIS(matrix, index_set, new_diag_value, PETSC_NULL, PETSC_NULL);
+      = MatZeroRowsIS(matrix, index_set, new_diag_value);
 #else
     const int ierr
-      = MatZeroRowsIS(matrix, index_set, new_diag_value);
+      = MatZeroRowsIS(matrix, index_set, new_diag_value, PETSC_NULL, PETSC_NULL);
 #endif
 #endif
 
     AssertThrow (ierr == 0, ExcPETScError(ierr));
 
-#if DEAL_II_PETSC_VERSION_DEV()
-    ISDestroy (&index_set);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
     ISDestroy (index_set);
+#else
+    ISDestroy (&index_set);
 #endif
 
     compress ();
@@ -606,17 +607,17 @@ namespace PETScWrappers
     AssertThrow (ierr == 0, ExcPETScError(ierr));
   }
 
-#if DEAL_II_PETSC_VERSION_DEV()
-  PetscBool
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
   PetscTruth
+#else
+  PetscBool
 #endif
   MatrixBase::is_symmetric (const double tolerance)
   {
-#if DEAL_II_PETSC_VERSION_DEV()
-    PetscBool
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
     PetscTruth 
+#else
+      PetscBool
 #endif
       truth;
                                        // First flush PETSc caches
@@ -625,17 +626,17 @@ namespace PETScWrappers
     return truth;
   }
 
-#if DEAL_II_PETSC_VERSION_DEV()
-  PetscBool
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
   PetscTruth
+#else
+  PetscBool
 #endif
   MatrixBase::is_hermitian (const double tolerance)
   {
-#if DEAL_II_PETSC_VERSION_DEV()
-    PetscBool
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
     PetscTruth 
+#else
+      PetscBool
 #endif
       truth;
 
index 81906c4e481deae81f63a75ed49caf1a3424fa44..8c5838729ce90a60ae87021e2cbc706b320c914a 100644 (file)
@@ -114,10 +114,10 @@ namespace PETScWrappers
 
                                        // get rid of old matrix and generate a
                                        // new one
-#if DEAL_II_PETSC_VERSION_DEV()
-      const int ierr = MatDestroy (&matrix);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
       const int ierr = MatDestroy (matrix);
+#else
+      const int ierr = MatDestroy (&matrix);
 #endif
       AssertThrow (ierr == 0, ExcPETScError(ierr));
 
@@ -140,10 +140,10 @@ namespace PETScWrappers
 
                                        // get rid of old matrix and generate a
                                        // new one
-#if DEAL_II_PETSC_VERSION_DEV()
-      const int ierr = MatDestroy (&matrix);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
       const int ierr = MatDestroy (matrix);
+#else
+      const int ierr = MatDestroy (&matrix);
 #endif
       AssertThrow (ierr == 0, ExcPETScError(ierr));
 
@@ -166,10 +166,10 @@ namespace PETScWrappers
 
                                        // get rid of old matrix and generate a
                                        // new one
-#if DEAL_II_PETSC_VERSION_DEV()
-      const int ierr = MatDestroy (&matrix);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
       const int ierr = MatDestroy (matrix);
+#else
+      const int ierr = MatDestroy (&matrix);
 #endif
       AssertThrow (ierr == 0, ExcPETScError(ierr));
 
index 04a6cb75b9d56b4509bfb1046339fdac5d411b61..7596e96b9e1f9d7d35b59f5dce6f77085038323b 100644 (file)
@@ -113,10 +113,11 @@ namespace PETScWrappers
 
                                            // so let's go the slow way:
           int ierr;
-#if DEAL_II_PETSC_VERSION_DEV()
-          ierr = VecDestroy (&vector);
-#else
+
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
           ierr = VecDestroy (vector);
+#else
+          ierr = VecDestroy (&vector);
 #endif
 
           AssertThrow (ierr == 0, ExcPETScError(ierr));
index a01bae67326f5d190f893afd3b22f289e29ab42d..7d4f70c1ed3e7de602d5661718d7a39912f0f700 100644 (file)
@@ -37,10 +37,10 @@ namespace PETScWrappers
   {
     if (pc!=NULL)
       {
-#if DEAL_II_PETSC_VERSION_DEV()
-       int ierr = PCDestroy(&pc);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
        int ierr = PCDestroy(pc);
+#else
+       int ierr = PCDestroy(&pc);
 #endif
        AssertThrow (ierr == 0, ExcPETScError(ierr));
       }
index 362967807fe3daa6e5ab3a91d6844ec88f39d46f..c35282df56546da40d4c069267bf8dcbe948f534 100644 (file)
@@ -34,10 +34,10 @@ namespace PETScWrappers
   SolverBase::SolverData::~SolverData ()
   {
                                      // destroy the solver object
-#if DEAL_II_PETSC_VERSION_DEV()
-    int ierr = KSPDestroy (&ksp);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
     int ierr = KSPDestroy (ksp);
+#else
+    int ierr = KSPDestroy (&ksp);
 #endif
     
     AssertThrow (ierr == 0, ExcPETScError(ierr));
@@ -402,10 +402,10 @@ namespace PETScWrappers
                                     // right
     if (additional_data.right_preconditioning)
       {
-#if DEAL_II_PETSC_VERSION_DEV()
-       ierr = KSPSetPCSide(ksp, PC_RIGHT);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
        ierr = KSPSetPreconditionerSide(ksp, PC_RIGHT);
+#else
+       ierr = KSPSetPCSide(ksp, PC_RIGHT);
 #endif
 
        AssertThrow (ierr == 0, ExcPETScError(ierr));
index 0fb4b70d5df37bfc93319f8236dd92ad10164b39..01e67563261be34c2a5af4196d1d071b503a9e4d 100644 (file)
@@ -83,10 +83,10 @@ namespace PETScWrappers
   {
                                      // get rid of old matrix and generate a
                                      // new one
-#if DEAL_II_PETSC_VERSION_DEV()
-    const int ierr = MatDestroy (&matrix);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
     const int ierr = MatDestroy (matrix);
+#else
+    const int ierr = MatDestroy (&matrix);
 #endif
     AssertThrow (ierr == 0, ExcPETScError(ierr));
 
@@ -103,10 +103,10 @@ namespace PETScWrappers
   {
                                      // get rid of old matrix and generate a
                                      // new one
-#if DEAL_II_PETSC_VERSION_DEV()
-    const int ierr = MatDestroy (&matrix);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
     const int ierr = MatDestroy (matrix);
+#else
+    const int ierr = MatDestroy (&matrix);
 #endif
     AssertThrow (ierr == 0, ExcPETScError(ierr));
 
@@ -123,10 +123,10 @@ namespace PETScWrappers
   {
                                      // get rid of old matrix and generate a
                                      // new one
-#if DEAL_II_PETSC_VERSION_DEV()
-    const int ierr = MatDestroy (&matrix);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
     const int ierr = MatDestroy (matrix);
+#else
+    const int ierr = MatDestroy (&matrix);
 #endif
     AssertThrow (ierr == 0, ExcPETScError(ierr));
 
index 4ea59af9d474c6a2b60bf475fa54e39680da76db..ff52aa0a7154938bc7265e282803b9b67d596c3e 100644 (file)
@@ -78,10 +78,10 @@ namespace PETScWrappers
                                          // so let's go the slow way:
        if (attained_ownership)
          {
-#if DEAL_II_PETSC_VERSION_DEV()
-           int ierr = VecDestroy (&vector);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
            int ierr = VecDestroy (vector);
+#else
+           int ierr = VecDestroy (&vector);
 #endif
            AssertThrow (ierr == 0, ExcPETScError(ierr));
          }
index 130bb33b2f64ecbc6c1ae9d012ae7a11bea662a7..34ffaeee278c8c54dd34c2facb4822ac8a60872f 100644 (file)
@@ -215,10 +215,10 @@ namespace PETScWrappers
   {
     if (attained_ownership)
       {        
-#if DEAL_II_PETSC_VERSION_DEV()
-       const int ierr = VecDestroy (&vector);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
        const int ierr = VecDestroy (vector);
+#else
+       const int ierr = VecDestroy (&vector);
 #endif
        AssertThrow (ierr == 0, ExcPETScError(ierr));
       }
@@ -257,10 +257,10 @@ namespace PETScWrappers
     Assert (size() == v.size(),
             ExcDimensionMismatch(size(), v.size()));
 
-#if DEAL_II_PETSC_VERSION_DEV()
-    PetscBool 
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
     PetscTruth 
+#else
+      PetscBool 
 #endif
       flag;
 
@@ -278,10 +278,10 @@ namespace PETScWrappers
     Assert (size() == v.size(),
             ExcDimensionMismatch(size(), v.size()));
 
-#if DEAL_II_PETSC_VERSION_DEV()
-    PetscBool 
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
     PetscTruth 
+#else
+      PetscBool 
 #endif
       flag;
 

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.