]> https://gitweb.dealii.org/ - dealii.git/commitdiff
lac directory compiles for PETSc complex
authorToby D. Young <tyoung@ippt.pan.pl>
Wed, 23 Sep 2009 10:52:58 +0000 (10:52 +0000)
committerToby D. Young <tyoung@ippt.pan.pl>
Wed, 23 Sep 2009 10:52:58 +0000 (10:52 +0000)
git-svn-id: https://svn.dealii.org/trunk@19502 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 391c9bbf2aff75532a5c474f4cde8299e9057f61..e590cf36d1a64536124649a634dda60f707cc971 100644 (file)
@@ -13,6 +13,7 @@
 #ifndef __deal2__constraint_matrix_h
 #define __deal2__constraint_matrix_h
 
+#include <complex>
 
 #include <base/config.h>
 #include <base/exceptions.h>
index fd7381a32ec04d3c1525301df5331f1c1c3b2977..eb72940ffd8a9d9abe1c6907d2fadbee3c8f0713 100755 (executable)
@@ -318,8 +318,12 @@ namespace SLEPcWrappers
       static
        int
        convergence_test (EPS                 eps,
+#ifdef PETSC_USE_64BIT_INDICES
+                         const PetscInt      iteration,
+#else
                          const int           iteration,
-                         const PetscScalar   residual_norm,
+#endif
+                         const PetscReal     residual_norm,
                          EPSConvergedReason *reason,
                          void               *solver_control);
 
@@ -523,6 +527,7 @@ namespace SLEPcWrappers
       
       if (n_converged > n_eigenvectors)
        n_converged = n_eigenvectors;
+      AssertThrow (n_converged == n_eigenvectors, ExcSLEPcWrappersUsageError());
       
       AssertThrow (vr.size() >= 1, ExcSLEPcWrappersUsageError());
       vr.resize (n_converged, vr.front());
@@ -548,10 +553,7 @@ namespace SLEPcWrappers
       
       if (n_converged > n_eigenvectors)
        n_converged = n_eigenvectors;
-
-      // TODO: Fix this properly
-      if (n_converged < n_eigenvectors)
-       {}
+      AssertThrow (n_converged == n_eigenvectors, ExcSLEPcWrappersUsageError());
       
       AssertThrow (vr.size() >= 1, ExcSLEPcWrappersUsageError());
       vr.resize (n_converged, vr.front());
index 7dafcffe43e5c82f4563e69bba9209ba5a5d060f..6d806f72a5897d9308a9b94baeef55c9e739fcc0 100644 (file)
@@ -2147,11 +2147,13 @@ VECTOR_FUNCTIONS(BlockVector<float>);
 // use them. The key is to use local ranges etc., which still needs to be
 // implemented.
 #ifdef DEAL_II_USE_PETSC
+#ifndef DEAL_II_USE_PETSC_COMPLEX
 VECTOR_FUNCTIONS(PETScWrappers::Vector);
 VECTOR_FUNCTIONS(PETScWrappers::BlockVector);
 VECTOR_FUNCTIONS(PETScWrappers::MPI::Vector);
 VECTOR_FUNCTIONS(PETScWrappers::MPI::BlockVector);
 #endif
+#endif
 
 #ifdef DEAL_II_USE_TRILINOS
 VECTOR_FUNCTIONS(TrilinosWrappers::Vector);
index 9f042f3c9bf57b9680651dcf33a7cd55f7534714..9e71e18782286b97a9486591a763026d308624d7 100644 (file)
@@ -187,10 +187,14 @@ namespace SLEPcWrappers
 
   int
   SolverBase::convergence_test (EPS                 /*eps*/,
-                                const int           iteration,
-                                const PetscScalar   residual_norm,
-                                EPSConvergedReason *reason,
-                                void               *solver_control_x)
+#ifdef PETSC_USE_64BIT_INDICES
+                               const PetscInt      iteration,
+#else
+                               const int           iteration,
+#endif
+                               const PetscReal     residual_norm,
+                               EPSConvergedReason *reason,
+                               void               *solver_control_x)
   {
     SolverControl &solver_control
       = *reinterpret_cast<SolverControl*>(solver_control_x);

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.