]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove support for versions of PETSc before 3.3.0. 4481/head
authorDavid Wells <wellsd2@rpi.edu>
Sat, 3 Jun 2017 19:42:35 +0000 (15:42 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Sat, 3 Jun 2017 22:47:34 +0000 (18:47 -0400)
15 files changed:
cmake/configure/configure_3_petsc.cmake
doc/external-libs/petsc.html
doc/news/changes/incompatibilities/20170603DavidWells [new file with mode: 0644]
include/deal.II/lac/petsc_compatibility.h
include/deal.II/lac/petsc_matrix_base.h
include/deal.II/lac/slepc_solver.h
include/deal.II/lac/vector.templates.h
source/lac/petsc_matrix_base.cc
source/lac/petsc_parallel_sparse_matrix.cc
source/lac/petsc_parallel_vector.cc
source/lac/petsc_precondition.cc
source/lac/petsc_solver.cc
source/lac/petsc_vector_base.cc
source/lac/slepc_solver.cc
source/lac/slepc_spectral_transformation.cc

index 48517c7d7471b5ed955e1a6a3cd2f187c17454bd..dab2dd405d63c9db92d35d5c02ef5c92c826b2c8 100644 (file)
@@ -30,15 +30,16 @@ MACRO(FEATURE_PETSC_FIND_EXTERNAL var)
     SET(${var} TRUE)
 
     #
-    # We support petsc from version 3.x.x onwards
+    # We support petsc from version 3.3.x onwards
     #
-    IF(PETSC_VERSION_MAJOR LESS 3)
+    IF(PETSC_VERSION_MAJOR LESS 3 OR
+        ((PETSC_VERSION_MAJOR EQUAL 3) AND (PETSC_VERSION_MINOR LESS 3)))
       MESSAGE(STATUS "Could not find a sufficient modern PETSc installation: "
-        "Version >=3.0.0 required!"
+        "Version >=3.3.0 required!"
         )
       SET(PETSC_ADDITIONAL_ERROR_STRING
         "Could not find a sufficient modern PETSc installation: "
-        "Version >=3.0.0 required!\n"
+        "Version >=3.3.0 required!\n"
         )
       SET(${var} FALSE)
     ENDIF()
@@ -117,7 +118,7 @@ MACRO(FEATURE_PETSC_ERROR_MESSAGE)
   MESSAGE(FATAL_ERROR "\n"
     "Could not find the petsc library!\n"
     ${PETSC_ADDITIONAL_ERROR_STRING}
-    "\nPlease ensure that the petsc library version 3.0.0 or newer is "
+    "\nPlease ensure that the petsc library version 3.3.0 or newer is "
     "installed on your computer and is configured with the same mpi options "
     "as deal.II\n"
     "If the library is not at a default location, either provide some hints\n"
index 04ec2bf6d7e69972acbf49fdeddfb8321b3cf4e2..2b767f59002152edd63215efbac3759eefdde93e 100644 (file)
 
     <p style="color: red"><b>Note:</b> The most recent version of PETSc
       that has been reported to be compatible with
-      <acronym>deal.II</acronym> is version 3.6.0. If you use a later
-      version than this and encounter problems, let us know.
+      <acronym>deal.II</acronym> is version 3.7.6. If you use a later
+      version than this and encounter problems, let us
+      know. <acronym>deal.II</acronym> does not support versions of PETSc prior
+      to 3.3.0.
     </p>
 
     <p>
diff --git a/doc/news/changes/incompatibilities/20170603DavidWells b/doc/news/changes/incompatibilities/20170603DavidWells
new file mode 100644 (file)
index 0000000..a0f62d0
--- /dev/null
@@ -0,0 +1,3 @@
+Changed: Versions of PETSc prior to 3.3.0 are no longer supported.
+<br>
+(David Wells, 2017/06/03)
index abcbbdf657741fde5132f020ef6d89693f3d127c..17a2da3b433fa7f83ffbe1c8f45629b88f83a047 100644 (file)
@@ -36,11 +36,14 @@ DEAL_II_NAMESPACE_OPEN
 
 namespace PETScWrappers
 {
-#if DEAL_II_PETSC_VERSION_LT(3,2,0)
-  typedef PetscTruth PetscBooleanType;
-#else
-  typedef PetscBool PetscBooleanType;
-#endif
+  /**
+   * a compatibility typedef for older versions of PETSc.
+   *
+   * @deprecated The name of this type changed in PETSc 3.2: deal.II does not
+   * support versions of PETSc older than this so this typedef will be removed
+   * in a future release.
+   */
+  typedef PetscBool PetscBooleanType DEAL_II_DEPRECATED;
 
   /**
    * Set an option in the global PETSc database. This function just wraps
@@ -73,11 +76,7 @@ namespace PETScWrappers
   inline PetscErrorCode destroy_matrix (Mat &matrix)
   {
     // PETSc will check whether or not matrix is nullptr.
-#if DEAL_II_PETSC_VERSION_LT(3, 2, 0)
-    return MatDestroy (matrix);
-#else
     return MatDestroy (&matrix);
-#endif
   }
 
 
@@ -95,11 +94,7 @@ namespace PETScWrappers
   inline PetscErrorCode destroy_krylov_solver (KSP &krylov_solver)
   {
     // PETSc will check whether or not matrix is nullptr.
-#if DEAL_II_PETSC_VERSION_LT(3, 2, 0)
-    return KSPDestroy (krylov_solver);
-#else
     return KSPDestroy (&krylov_solver);
-#endif
   }
 
 
@@ -113,14 +108,9 @@ namespace PETScWrappers
    */
   inline void set_matrix_option (Mat &matrix,
                                  const MatOption option_name,
-                                 const PetscBooleanType option_value = PETSC_FALSE)
+                                 const PetscBool option_value = PETSC_FALSE)
   {
-#if DEAL_II_PETSC_VERSION_LT(3,0,0)
-    const PetscErrorCode ierr = MatSetOption (matrix, option_name);
-#else
     const PetscErrorCode ierr = MatSetOption (matrix, option_name, option_value);
-#endif
-
     AssertThrow (ierr == 0, ExcPETScError(ierr));
   }
 
@@ -132,19 +122,11 @@ namespace PETScWrappers
    */
   inline void close_matrix (Mat &matrix)
   {
-#if DEAL_II_PETSC_VERSION_LT(3, 0, 0)
-#  ifdef DEBUG
-    set_matrix_option (matrix, MAT_NEW_NONZERO_LOCATION_ERR);
-#  else
-    set_matrix_option (matrix, MAT_NO_NEW_NONZERO_LOCATIONS);
-#  endif
-#else
 #  ifdef DEBUG
     set_matrix_option (matrix, MAT_NEW_NONZERO_LOCATION_ERR, PETSC_TRUE);
 #  else
     set_matrix_option (matrix, MAT_NEW_NONZERO_LOCATIONS, PETSC_FALSE);
 #  endif
-#endif
   }
 
 
@@ -156,11 +138,7 @@ namespace PETScWrappers
    */
   inline void set_keep_zero_rows (Mat &matrix)
   {
-#if DEAL_II_PETSC_VERSION_LT(3, 1, 0)
-    set_matrix_option (matrix, MAT_KEEP_ZEROED_ROWS, PETSC_TRUE);
-#else
     set_matrix_option (matrix, MAT_KEEP_NONZERO_PATTERN, PETSC_TRUE);
-#endif
   }
 }
 
index 81c55596b27969259243a24d8e8bca00ae3bb4d4..cd3dd12c4ea9c7846a57b7807ca25238f329a465 100644 (file)
@@ -678,14 +678,11 @@ namespace PETScWrappers
     PetscScalar matrix_scalar_product (const VectorBase &u,
                                        const VectorBase &v) const;
 
-
-#if DEAL_II_PETSC_VERSION_GTE(3,1,0)
     /**
      * Return the trace of the matrix, i.e. the sum of all diagonal entries in
      * the matrix.
      */
     PetscScalar trace () const;
-#endif
 
     /**
      * Multiply the entire matrix by a fixed factor.
index e62ca174ba850d9263dd15bacab5a1b463c4b0c7..a49054f29d91a7cfad31433b081ab5a84a77da8f 100644 (file)
@@ -803,11 +803,7 @@ namespace SLEPcWrappers
     // One could still build a vector that is rich in the directions of all guesses,
     // by taking a linear combination of them. (TODO: make function virtual?)
 
-#if DEAL_II_PETSC_VERSION_LT(3,1,0)
-    const PetscErrorCode ierr = EPSSetInitialVector (eps, &vecs[0]);
-#else
     const PetscErrorCode ierr = EPSSetInitialSpace (eps, vecs.size(), &vecs[0]);
-#endif
     AssertThrow (ierr == 0, ExcSLEPcError(ierr));
   }
 
index a67a8b133e51ecffe708ab95175a3c1adb807ee3..cf4f399007e4072ca691478b1d38718b93319af0 100644 (file)
@@ -131,17 +131,10 @@ namespace internal
     ierr = VecRestoreArray (sequential_vector, &start_ptr);
     AssertThrow (ierr == 0, ExcPETScError(ierr));
 
-#if DEAL_II_PETSC_VERSION_LT(3,2,0)
-    ierr = VecScatterDestroy(scatter_context);
-    AssertNothrow (ierr == 0, ExcPETScError(ierr));
-    ierr = VecDestroy (sequential_vector);
-    AssertNothrow (ierr == 0, ExcPETScError(ierr));
-#else
     ierr = VecScatterDestroy(&scatter_context);
     AssertNothrow (ierr == 0, ExcPETScError(ierr));
     ierr = VecDestroy (&sequential_vector);
     AssertNothrow (ierr == 0, ExcPETScError(ierr));
-#endif
   }
 }
 
index 41dc140cd1094487a0cc4f8ae6a41afc8da5e2b4..e74f076ec7459ef91e11d1bbfad1343d8106483d 100644 (file)
@@ -149,27 +149,13 @@ namespace PETScWrappers
     // since this is a collective operation
     IS index_set;
 
-#if DEAL_II_PETSC_VERSION_LT(3,2,0)
-    ISCreateGeneral (get_mpi_communicator(), rows.size(),
-                     &petsc_rows[0], &index_set);
-#else
     ISCreateGeneral (get_mpi_communicator(), rows.size(),
                      &petsc_rows[0], PETSC_COPY_VALUES, &index_set);
-#endif
 
-#if DEAL_II_PETSC_VERSION_LT(3,2,0)
-    const PetscErrorCode ierr = MatZeroRowsIS(matrix, index_set, new_diag_value);
-#else
     const PetscErrorCode ierr = MatZeroRowsIS(matrix, index_set, new_diag_value,
                                               nullptr, nullptr);
-#endif
     AssertThrow (ierr == 0, ExcPETScError(ierr));
-
-#if DEAL_II_PETSC_VERSION_LT(3,2,0)
-    ISDestroy (index_set);
-#else
     ISDestroy (&index_set);
-#endif
   }
 
 
@@ -400,7 +386,6 @@ namespace PETScWrappers
   }
 
 
-#if DEAL_II_PETSC_VERSION_GTE(3,1,0)
   PetscScalar
   MatrixBase::trace () const
   {
@@ -411,7 +396,6 @@ namespace PETScWrappers
 
     return result;
   }
-#endif
 
 
 
index 48865c33cc823ef8702729ca8471902a8888e861..d922448588b842782276096b2b137e8a14c659f7 100644 (file)
@@ -237,15 +237,6 @@ namespace PETScWrappers
       // use the call sequence indicating only
       // a maximal number of elements per row
       // for all rows globally
-#if DEAL_II_PETSC_VERSION_LT(3,3,0)
-      const PetscErrorCode ierr = MatCreateMPIAIJ
-                                  (communicator,
-                                   local_rows, local_columns,
-                                   m, n,
-                                   n_nonzero_per_row, 0,
-                                   n_offdiag_nonzero_per_row, 0,
-                                   &matrix);
-#else
       const PetscErrorCode ierr = MatCreateAIJ
                                   (communicator,
                                    local_rows, local_columns,
@@ -254,7 +245,6 @@ namespace PETScWrappers
                                    n_offdiag_nonzero_per_row, nullptr,
                                    &matrix);
       set_matrix_option (matrix, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE);
-#endif
       AssertThrow (ierr == 0, ExcPETScError(ierr));
 
       // set symmetric flag, if so requested
@@ -304,15 +294,6 @@ namespace PETScWrappers
                                                            offdiag_row_lengths.end());
 
 //TODO: There must be a significantly better way to provide information about the off-diagonal blocks of the matrix. this way, petsc keeps allocating tiny chunks of memory, and gets completely hung up over this
-#if DEAL_II_PETSC_VERSION_LT(3,3,0)
-      const PetscErrorCode ierr = MatCreateMPIAIJ
-                                  (communicator,
-                                   local_rows, local_columns,
-                                   m, n,
-                                   0, &int_row_lengths[0],
-                                   0, offdiag_row_lengths.size() ? &int_offdiag_row_lengths[0] : 0,
-                                   &matrix);
-#else
       const PetscErrorCode ierr = MatCreateAIJ
                                   (communicator,
                                    local_rows, local_columns,
@@ -324,7 +305,6 @@ namespace PETScWrappers
 
 //TODO: Sometimes the actual number of nonzero entries allocated is greater than the number of nonzero entries, which petsc will complain about unless explicitly disabled with MatSetOption. There is probably a way to prevent a different number nonzero elements being allocated in the first place. (See also previous TODO).
       set_matrix_option (matrix, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE);
-#endif
       AssertThrow (ierr == 0, ExcPETScError(ierr));
 
       // set symmetric flag, if so requested
@@ -505,52 +485,6 @@ namespace PETScWrappers
       const size_type
       local_row_end = local_row_start + local_rows_per_process[this_process];
 
-#if DEAL_II_PETSC_VERSION_LT(2,3,3)
-      //old version to create the matrix, we
-      //can skip calculating the row length
-      //at least starting from 2.3.3 (tested,
-      //see below)
-
-      const size_type
-      local_col_end = local_col_start + local_columns_per_process[this_process];
-
-      // then count the elements in- and
-      // out-of-window for the rows we own
-      std::vector<PetscInt>
-
-      row_lengths_in_window (local_row_end - local_row_start),
-                            row_lengths_out_of_window (local_row_end - local_row_start);
-      for (size_type row = local_row_start; row<local_row_end; ++row)
-        for (size_type c=0; c<sparsity_pattern.row_length(row); ++c)
-          {
-            const size_type column = sparsity_pattern.column_number(row,c);
-
-            if ((column >= local_col_start) &&
-                (column < local_col_end))
-              ++row_lengths_in_window[row-local_row_start];
-            else
-              ++row_lengths_out_of_window[row-local_row_start];
-          }
-
-
-      // create the matrix. completely
-      // confusingly, PETSc wants us to pass
-      // arrays for the local number of
-      // elements that starts with zero for
-      // the first _local_ row, i.e. it
-      // doesn't index into an array for
-      // _all_ rows.
-      const PetscErrorCode ierr = MatCreateMPIAIJ(communicator,
-                                                  local_rows_per_process[this_process],
-                                                  local_columns_per_process[this_process],
-                                                  sparsity_pattern.n_rows(),
-                                                  sparsity_pattern.n_cols(),
-                                                  0, &row_lengths_in_window[0],
-                                                  0, &row_lengths_out_of_window[0],
-                                                  &matrix);
-      AssertThrow (ierr == 0, ExcPETScError(ierr));
-
-#else //PETSC_VERSION>=2.3.3
       // create the matrix. We
       // do not set row length but set the
       // correct SparsityPattern later.
@@ -566,8 +500,6 @@ namespace PETScWrappers
 
       ierr = MatSetType(matrix,MATMPIAIJ);
       AssertThrow (ierr == 0, ExcPETScError(ierr));
-#endif
-
 
       // next preset the exact given matrix
       // entries with zeros, if the user
@@ -631,49 +563,6 @@ namespace PETScWrappers
                                                nullptr);
           AssertThrow (ierr == 0, ExcPETScError(ierr));
 
-#if DEAL_II_PETSC_VERSION_LT(2,3,3)
-          // this is only needed for old
-          // PETSc versions:
-
-          // for some reason, it does not
-          // seem to be possible to force
-          // actual allocation of actual
-          // entries by using the last
-          // arguments to the call above. if
-          // we don't initialize the entries
-          // like in the following loop, then
-          // the program is unbearably slow
-          // because elements are allocated
-          // and accessed in random order,
-          // which is not what PETSc likes
-          //
-          // note that we actually have to
-          // set the entries to something
-          // non-zero! do the allocation one
-          // row at a time
-          {
-            const std::vector<PetscScalar>
-            values (sparsity_pattern.max_entries_per_row(),
-                    1.);
-
-            for (size_type i=local_row_start; i<local_row_end; ++i)
-              {
-                PetscInt petsc_i = i;
-                ierr = MatSetValues (matrix, 1, &petsc_i,
-                                     sparsity_pattern.row_length(i),
-                                     &colnums_in_window[rowstart_in_window[i-local_row_start]],
-                                     &values[0], INSERT_VALUES);
-                AssertThrow (ierr == 0, ExcPETScError(ierr));
-              }
-          }
-
-          compress (VectorOperation::insert);
-
-          // set the dummy entries set above
-          // back to zero
-          *this = 0;
-#endif // version <=2.3.3
-
           close_matrix (matrix);
           set_keep_zero_rows(matrix);
         }
@@ -773,10 +662,6 @@ namespace PETScWrappers
     IndexSet
     SparseMatrix::locally_owned_domain_indices () const
     {
-#if DEAL_II_PETSC_VERSION_LT(3,3,0)
-      Assert(false,ExcNotImplemented());
-      return IndexSet();
-#else
       PetscInt n_rows, n_cols, n_loc_rows, n_loc_cols, min, max;
       PetscErrorCode ierr;
 
@@ -796,16 +681,11 @@ namespace PETScWrappers
       indices.compress();
 
       return indices;
-#endif
     }
 
     IndexSet
     SparseMatrix::locally_owned_range_indices () const
     {
-#if DEAL_II_PETSC_VERSION_LT(3,3,0)
-      Assert(false,ExcNotImplemented());
-      return IndexSet();
-#else
       PetscInt n_rows, n_cols, n_loc_rows, n_loc_cols, min, max;
       PetscErrorCode ierr;
 
@@ -825,7 +705,6 @@ namespace PETScWrappers
       indices.compress();
 
       return indices;
-#endif
     }
 
   }
index ba2f8ee41d7c9f24ec1f075c183ffd7ab1da41aa..c09e57c75553615e88a4b1a34eb786453714e01c 100644 (file)
@@ -171,11 +171,7 @@ namespace PETScWrappers
 
           // so let's go the slow way:
 
-#if DEAL_II_PETSC_VERSION_LT(3,2,0)
-          const PetscErrorCode ierr = VecDestroy (vector);
-#else
           const PetscErrorCode ierr = VecDestroy (&vector);
-#endif
           AssertThrow (ierr == 0, ExcPETScError(ierr));
 
           create_vector (n, local_sz);
@@ -213,11 +209,7 @@ namespace PETScWrappers
                     const IndexSet &ghost,
                     const MPI_Comm     &comm)
     {
-#if DEAL_II_PETSC_VERSION_LT(3,2,0)
-      const PetscErrorCode ierr = VecDestroy (vector);
-#else
       const PetscErrorCode ierr = VecDestroy (&vector);
-#endif
       AssertThrow (ierr == 0, ExcPETScError(ierr));
 
       communicator = comm;
@@ -234,11 +226,7 @@ namespace PETScWrappers
     Vector::reinit (const IndexSet &local,
                     const MPI_Comm &comm)
     {
-#if DEAL_II_PETSC_VERSION_LT(3,2,0)
-      const PetscErrorCode ierr = VecDestroy (vector);
-#else
       const PetscErrorCode ierr = VecDestroy (&vector);
-#endif
       AssertThrow (ierr == 0, ExcPETScError(ierr));
 
       communicator = comm;
index d881f6997b7d087f2d406387c9d38e806dae3611..90039decba742d0a6ca51d50c09b5f9958d4e720 100644 (file)
@@ -52,11 +52,7 @@ namespace PETScWrappers
 
     if (pc!=nullptr)
       {
-#if DEAL_II_PETSC_VERSION_LT(3,2,0)
-        PetscErrorCode ierr = PCDestroy(pc);
-#else
         PetscErrorCode ierr = PCDestroy(&pc);
-#endif
         pc = nullptr;
         AssertThrow (ierr == 0, ExcPETScError(ierr));
       }
@@ -758,21 +754,13 @@ namespace PETScWrappers
     AssertThrow (ierr == 0, ExcPETScError(ierr));
 
     // set flags as given
-#if DEAL_II_PETSC_VERSION_LT(3,0,1)
-    ierr = PCFactorSetPivoting (pc, additional_data.pivoting);
-#else
     ierr = PCFactorSetColumnPivot (pc, additional_data.pivoting);
-#endif
     AssertThrow (ierr == 0, ExcPETScError(ierr));
 
     ierr = PCFactorSetZeroPivot (pc, additional_data.zero_pivot);
     AssertThrow (ierr == 0, ExcPETScError(ierr));
 
-#if DEAL_II_PETSC_VERSION_LT(3,0,1)
-    ierr = PCFactorSetShiftNonzero (pc, additional_data.damping);
-#else
     ierr = PCFactorSetShiftAmount (pc, additional_data.damping);
-#endif
     AssertThrow (ierr == 0, ExcPETScError(ierr));
 
     ierr = PCSetFromOptions (pc);
index 7fad31b1f1682997e152490b700d23a92b9390fc..f0659b48ab54c519e80e57e010b48503c4e30fce 100644 (file)
@@ -307,15 +307,7 @@ namespace PETScWrappers
   void
   SolverChebychev::set_solver_type (KSP &ksp) const
   {
-    // set the type of solver. note the
-    // completely pointless change in
-    // spelling Chebyshev between PETSc 3.2
-    // and 3.3...
-#if DEAL_II_PETSC_VERSION_LT(3,3,0)
-    PetscErrorCode ierr = KSPSetType (ksp, KSPCHEBYCHEV);
-#else
     PetscErrorCode ierr = KSPSetType (ksp, KSPCHEBYSHEV);
-#endif
     AssertThrow (ierr == 0, ExcPETScError(ierr));
 
     // in the deal.II solvers, we always
@@ -436,12 +428,7 @@ namespace PETScWrappers
     // right
     if (additional_data.right_preconditioning)
       {
-#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));
       }
 
@@ -770,11 +757,7 @@ namespace PETScWrappers
          * factorization here we start to see differences with the base
          * class solve function
          */
-#if DEAL_II_PETSC_VERSION_GTE(3,2,0)
         ierr = PCFactorSetMatSolverPackage (solver_data->pc, MATSOLVERMUMPS);
-#else
-        ierr = PCFactorSetMatSolverPackage (solver_data->pc, MAT_SOLVER_MUMPS);
-#endif
         AssertThrow (ierr == 0, ExcPETScError (ierr));
 
         /**
index 2b63c29b1910b3278b69ea6a9c82e64b2ddf00ad..99e0f0f1a12aa00a08883c9fb44816b16a7988d8 100644 (file)
@@ -163,11 +163,7 @@ namespace PETScWrappers
   {
     if (attained_ownership)
       {
-#if DEAL_II_PETSC_VERSION_LT(3,2,0)
-        const PetscErrorCode ierr = VecDestroy (vector);
-#else
         const PetscErrorCode ierr = VecDestroy (&vector);
-#endif
         AssertNothrow (ierr == 0, ExcPETScError(ierr));
         (void) ierr;
       }
@@ -180,11 +176,7 @@ namespace PETScWrappers
   {
     if (attained_ownership)
       {
-#if DEAL_II_PETSC_VERSION_LT(3,2,0)
-        const PetscErrorCode ierr = VecDestroy (vector);
-#else
         const PetscErrorCode ierr = VecDestroy (&vector);
-#endif
         AssertThrow (ierr == 0, ExcPETScError(ierr));
       }
 
index 31d9ea86c2a8ffd6510782cafb148169b8c4681f..2d72f296991dd819b8810c10f25b5d07fe431c29 100644 (file)
@@ -62,11 +62,8 @@ namespace SLEPcWrappers
     if (eps != nullptr)
       {
         // Destroy the solver object.
-#if DEAL_II_PETSC_VERSION_LT(3,2,0)
-        const PetscErrorCode ierr = EPSDestroy (eps);
-#else
         const PetscErrorCode ierr = EPSDestroy (&eps);
-#endif
+
         (void)ierr;
         AssertNothrow (ierr == 0, ExcSLEPcError(ierr));
       }
@@ -105,11 +102,8 @@ namespace SLEPcWrappers
            ExcMessage("Initial vector should be nonzero."));
 
     Vec vec = this_initial_vector;
-#if DEAL_II_PETSC_VERSION_LT(3,1,0)
-    const PetscErrorCode ierr = EPSSetInitialVector (eps, &vec);
-#else
     const PetscErrorCode ierr = EPSSetInitialSpace (eps, 1, &vec);
-#endif
+
     AssertThrow (ierr == 0, ExcSLEPcError(ierr));
   }
 
@@ -400,7 +394,6 @@ namespace SLEPcWrappers
     SolverBase (cn, mpi_communicator),
     additional_data (data)
   {
-#if DEAL_II_PETSC_VERSION_GTE(3,1,0)
     PetscErrorCode ierr = EPSSetType (eps, const_cast<char *>(EPSGD));
     AssertThrow (ierr == 0, ExcSLEPcError(ierr));
 
@@ -409,12 +402,6 @@ namespace SLEPcWrappers
         ierr = EPSGDSetDoubleExpansion (eps, PETSC_TRUE);
         AssertThrow (ierr == 0, ExcSLEPcError(ierr));
       }
-#else
-    // PETSc/SLEPc version must be > 3.1.0.
-    Assert ((false),
-            ExcMessage ("Your SLEPc installation does not include a copy of the "
-                        "Generalized Davidson solver. A SLEPc version > 3.1.0 is required."));
-#endif
   }
 
   /* ------------------ Jacobi Davidson -------------------- */
@@ -425,15 +412,8 @@ namespace SLEPcWrappers
     SolverBase (cn, mpi_communicator),
     additional_data (data)
   {
-#if DEAL_II_PETSC_VERSION_GTE(3,1,0)
     const PetscErrorCode ierr = EPSSetType (eps, const_cast<char *>(EPSJD));
     AssertThrow (ierr == 0, ExcSLEPcError(ierr));
-#else
-    // PETSc/SLEPc version must be > 3.1.0.
-    Assert ((false),
-            ExcMessage ("Your SLEPc installation does not include a copy of the "
-                        "Jacobi-Davidson solver. A SLEPc version > 3.1.0 is required."));
-#endif
   }
 
   /* ---------------------- LAPACK ------------------------- */
@@ -460,4 +440,3 @@ namespace SLEPcWrappers
 DEAL_II_NAMESPACE_CLOSE
 
 #endif // DEAL_II_WITH_SLEPC
-
index bc7c59a12636c0095ca5d7070b26089c388033c7..a5cdf950de15d270c2bcd4ffd61b0c4c55c57223 100644 (file)
@@ -92,11 +92,7 @@ namespace SLEPcWrappers
     TransformationBase(mpi_communicator),
     additional_data (data)
   {
-#if DEAL_II_PETSC_VERSION_LT(3,1,0)
-    PetscErrorCode ierr = STSetType (st, const_cast<char *>(STSINV));
-#else
     PetscErrorCode ierr = STSetType (st, const_cast<char *>(STSINVERT));
-#endif
     AssertThrow (ierr == 0, SolverBase::ExcSLEPcError(ierr));
 
     ierr = STSetShift (st, additional_data.shift_parameter);

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.