From 0345e0e74a12166e9b67d9dccd80c3c68279c903 Mon Sep 17 00:00:00 2001 From: "Toby D. Young" Date: Mon, 3 Jun 2013 10:33:47 +0000 Subject: [PATCH] Deal kindly with PETSC_USE_COMPLEX in SLEPcWrappers. git-svn-id: https://svn.dealii.org/trunk@29738 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/lac/slepc_solver.h | 2 +- deal.II/source/lac/slepc_solver.cc | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/deal.II/include/deal.II/lac/slepc_solver.h b/deal.II/include/deal.II/lac/slepc_solver.h index d363702a98..ecc4a39005 100644 --- a/deal.II/include/deal.II/lac/slepc_solver.h +++ b/deal.II/include/deal.II/lac/slepc_solver.h @@ -305,7 +305,7 @@ namespace SLEPcWrappers */ void get_eigenpair (const unsigned int index, - double &eigenvalues, + PetscScalar &eigenvalues, PETScWrappers::VectorBase &eigenvectors); /** diff --git a/deal.II/source/lac/slepc_solver.cc b/deal.II/source/lac/slepc_solver.cc index 4640a0e50c..a1ef8196e1 100644 --- a/deal.II/source/lac/slepc_solver.cc +++ b/deal.II/source/lac/slepc_solver.cc @@ -219,7 +219,7 @@ namespace SLEPcWrappers void SolverBase::get_eigenpair (const unsigned int index, - double &eigenvalues, + PetscScalar &eigenvalues, PETScWrappers::VectorBase &eigenvectors) { AssertThrow (solver_data.get() != 0, ExcSLEPcWrappersUsageError()); @@ -231,6 +231,7 @@ namespace SLEPcWrappers AssertThrow (ierr == 0, ExcSLEPcError(ierr)); } + void SolverBase::get_eigenpair (const unsigned int index, double &real_eigenvalues, @@ -238,6 +239,7 @@ namespace SLEPcWrappers PETScWrappers::VectorBase &real_eigenvectors, PETScWrappers::VectorBase &imag_eigenvectors) { +#ifndef PETSC_USE_COMPLEX AssertThrow (solver_data.get() != 0, ExcSLEPcWrappersUsageError()); // get converged eigenpair @@ -245,8 +247,14 @@ namespace SLEPcWrappers &real_eigenvalues, &imag_eigenvalues, real_eigenvectors, imag_eigenvectors); AssertThrow (ierr == 0, ExcSLEPcError(ierr)); +#else + Assert ((false), + ExcMessage ("Your PETSc/SLEPc installation was configured with scalar-type complex " + "but this function is not defined for complex types.")); +#endif } + void SolverBase::reset () { -- 2.39.5