]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Deal kindly with PETSC_USE_COMPLEX in SLEPcWrappers.
authorToby D. Young <tyoung@ippt.pan.pl>
Mon, 3 Jun 2013 10:33:47 +0000 (10:33 +0000)
committerToby D. Young <tyoung@ippt.pan.pl>
Mon, 3 Jun 2013 10:33:47 +0000 (10:33 +0000)
git-svn-id: https://svn.dealii.org/trunk@29738 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/slepc_solver.h
deal.II/source/lac/slepc_solver.cc

index d363702a981ddc7c611ed28e43b2819c39a25576..ecc4a39005804e2607579dc09a1f4d74af635f81 100644 (file)
@@ -305,7 +305,7 @@ namespace SLEPcWrappers
      */
     void
     get_eigenpair (const unsigned int         index,
-                   double                    &eigenvalues,
+                   PetscScalar               &eigenvalues,
                    PETScWrappers::VectorBase &eigenvectors);
 
     /**
index 4640a0e50c7abb5c56fbb420d48b75d44a35fb24..a1ef8196e1f08d793d91c8c2e3e1e75cfcfc73d5 100644 (file)
@@ -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 ()
   {

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.