From: young Date: Wed, 23 Sep 2009 10:52:58 +0000 (+0000) Subject: lac directory compiles for PETSc complex X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a31c42845b7caf0308c20e46d6aa4d47c6cedd8d;p=dealii-svn.git lac directory compiles for PETSc complex git-svn-id: https://svn.dealii.org/trunk@19502 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/constraint_matrix.h b/deal.II/lac/include/lac/constraint_matrix.h index 391c9bbf2a..e590cf36d1 100644 --- a/deal.II/lac/include/lac/constraint_matrix.h +++ b/deal.II/lac/include/lac/constraint_matrix.h @@ -13,6 +13,7 @@ #ifndef __deal2__constraint_matrix_h #define __deal2__constraint_matrix_h +#include #include #include diff --git a/deal.II/lac/include/lac/slepc_solver.h b/deal.II/lac/include/lac/slepc_solver.h index fd7381a32e..eb72940ffd 100755 --- a/deal.II/lac/include/lac/slepc_solver.h +++ b/deal.II/lac/include/lac/slepc_solver.h @@ -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()); diff --git a/deal.II/lac/source/constraint_matrix.cc b/deal.II/lac/source/constraint_matrix.cc index 7dafcffe43..6d806f72a5 100644 --- a/deal.II/lac/source/constraint_matrix.cc +++ b/deal.II/lac/source/constraint_matrix.cc @@ -2147,11 +2147,13 @@ VECTOR_FUNCTIONS(BlockVector); // 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); diff --git a/deal.II/lac/source/slepc_solver.cc b/deal.II/lac/source/slepc_solver.cc index 9f042f3c9b..9e71e18782 100644 --- a/deal.II/lac/source/slepc_solver.cc +++ b/deal.II/lac/source/slepc_solver.cc @@ -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(solver_control_x);