From 65b9f1677d22eaaa3b0d23c5bf02009b775e096d Mon Sep 17 00:00:00 2001 From: Alexander Grayver Date: Fri, 15 Aug 2014 14:46:51 +0200 Subject: [PATCH] Add workaround to be able to use SLEPc >= 3.5.0 with deal.II. This requires disabling support for STFOLD spectrum transformation type since it was removed in SLEPc 3.5.0 and newer. Also log the corresponding entry in changes.h --- doc/news/changes.h | 7 +++++++ include/deal.II/lac/slepc_spectral_transformation.h | 3 ++- source/lac/slepc_spectral_transformation.cc | 7 +++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/news/changes.h b/doc/news/changes.h index 7631e8d60e..ec80a4f962 100644 --- a/doc/news/changes.h +++ b/doc/news/changes.h @@ -250,6 +250,13 @@ inconvenience this causes.

Specific improvements

    +
  1. Fixed: Support SLEPc 3.5 by disabling SDFOLD spectrum transformation type + that has been removed from SLEPc. Therefore, TransformationSpectrumFolding + cannot be used with newer SLEPc versions. +
    + (Alexander Grayver, 2014/08/15) +
  2. +
  3. New: To better support applications that want to use C++11's range-based for loops, there are now functions Triangulation::cell_iterators(), diff --git a/include/deal.II/lac/slepc_spectral_transformation.h b/include/deal.II/lac/slepc_spectral_transformation.h index 4598afbb84..4449b2e41e 100644 --- a/include/deal.II/lac/slepc_spectral_transformation.h +++ b/include/deal.II/lac/slepc_spectral_transformation.h @@ -232,7 +232,8 @@ namespace SLEPcWrappers /** * An implementation of the transformation interface using the SLEPc - * Spectrum Folding. + * Spectrum Folding. This transformation type has been removed in + * SLEPc 3.5.0 and thus cannot be used in the newer versions. * * @ingroup SLEPcWrappers * @author Toby D. Young 2009 diff --git a/source/lac/slepc_spectral_transformation.cc b/source/lac/slepc_spectral_transformation.cc index fdd6eb5ae7..c7970361d6 100644 --- a/source/lac/slepc_spectral_transformation.cc +++ b/source/lac/slepc_spectral_transformation.cc @@ -122,12 +122,19 @@ namespace SLEPcWrappers void TransformationSpectrumFolding::set_transformation_type (ST &st) const { +#if DEAL_II_PETSC_VERSION_LT(3,5,0) int ierr; ierr = STSetType (st, const_cast(STFOLD)); AssertThrow (ierr == 0, SolverBase::ExcSLEPcError(ierr)); ierr = STSetShift (st, additional_data.shift_parameter); AssertThrow (ierr == 0, SolverBase::ExcSLEPcError(ierr)); +#else + // PETSc/SLEPc version must be < 3.5.0. + Assert ((false), + ExcMessage ("Folding transformation has been removed in SLEPc 3.5.0 and newer." + "You cannot use this transformation anymore.")); +#endif } /* ------------------- TransformationCayley --------------------- */ -- 2.39.5