From: Toby D. Young Date: Mon, 3 Jun 2013 10:33:47 +0000 (+0000) Subject: Deal kindly with PETSC_USE_COMPLEX in SLEPcWrappers. X-Git-Tag: v8.0.0~323 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0345e0e74a12166e9b67d9dccd80c3c68279c903;p=dealii.git Deal kindly with PETSC_USE_COMPLEX in SLEPcWrappers. git-svn-id: https://svn.dealii.org/trunk@29738 0785d39b-7218-0410-832d-ea1e28bc413d --- 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 () {