From 96a801b961ca1de5d750411a7f229b700f9d2707 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 20 Aug 2013 14:20:01 +0000 Subject: [PATCH] Fix bug #85 (http://code.google.com/p/dealii/issues/detail?id=85): Allow compilation of SLEPcWrappers also for 64-bit indices. git-svn-id: https://svn.dealii.org/trunk@30356 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/news/changes.h | 7 +++++ deal.II/include/deal.II/lac/slepc_solver.h | 32 ++++++++++------------ deal.II/source/lac/slepc_solver.cc | 6 ++-- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 50d1a2dd86..760fb61e26 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -56,6 +56,13 @@ inconvenience this causes.

Specific improvements

    +
  1. + Fixed: The SLEPcWrappers classes could not be compiled for 64-bit + indices. This is now fixed. +
    + (Denis Davydov, Wolfgang Bangerth, 2013/08/20) +
  2. +
  3. Fixed: SolutionTransfer used to crash whenever one transfered in the hp context between cells that use FE_Nothing and FE_Q. This is now fixed. diff --git a/deal.II/include/deal.II/lac/slepc_solver.h b/deal.II/include/deal.II/lac/slepc_solver.h index 509297a574..184164369d 100644 --- a/deal.II/include/deal.II/lac/slepc_solver.h +++ b/deal.II/include/deal.II/lac/slepc_solver.h @@ -119,11 +119,6 @@ namespace SLEPcWrappers class SolverBase { public: - /** - * Declare type for container size. - */ - typedef types::global_dof_index size_type; - /** * Constructor. Takes the MPI communicator over which parallel * computations are to happen. @@ -161,7 +156,7 @@ namespace SLEPcWrappers solve (const PETScWrappers::MatrixBase &A, std::vector &eigenvalues, std::vector &eigenvectors, - const size_type n_eigenpairs = 1); + const unsigned int n_eigenpairs = 1); /** * Same as above, but here a composite method for solving the @@ -174,7 +169,7 @@ namespace SLEPcWrappers const PETScWrappers::MatrixBase &B, std::vector &eigenvalues, std::vector &eigenvectors, - const size_type n_eigenpairs = 1); + const unsigned int n_eigenpairs = 1); /** * Same as above, but here a composite method for solving the @@ -299,12 +294,13 @@ namespace SLEPcWrappers /** * Solve the linear system for n_eigenpairs * eigenstates. Parameter n_converged contains the - * actual number of eigenstates that have . converged; this can + * actual number of eigenstates that have converged; this can * be both fewer or more than n_eigenpairs, depending on the * SLEPc eigensolver used. */ void - solve (const unsigned int n_eigenpairs, unsigned int *n_converged); + solve (const unsigned int n_eigenpairs, + unsigned int *n_converged); /** * Access the real parts of solutions for a solved eigenvector @@ -754,7 +750,7 @@ namespace SLEPcWrappers SolverBase::solve (const PETScWrappers::MatrixBase &A, std::vector &eigenvalues, std::vector &eigenvectors, - const size_type n_eigenpairs) + const unsigned int n_eigenpairs) { // Panic if the number of eigenpairs wanted is out of bounds. AssertThrow ((n_eigenpairs > 0) && (n_eigenpairs <= A.m ()), @@ -764,7 +760,7 @@ namespace SLEPcWrappers set_matrices (A); // and solve - size_type n_converged = 0; + unsigned int n_converged = 0; solve (n_eigenpairs, &n_converged); if (n_converged > n_eigenpairs) @@ -776,7 +772,7 @@ namespace SLEPcWrappers eigenvectors.resize (n_converged, eigenvectors.front()); eigenvalues.resize (n_converged); - for (size_type index=0; index &eigenvalues, std::vector &eigenvectors, - const size_type n_eigenpairs) + const unsigned int n_eigenpairs) { // Guard against incompatible matrix sizes: AssertThrow (A.m() == B.m (), ExcDimensionMismatch(A.m(), B.m())); @@ -800,7 +796,7 @@ namespace SLEPcWrappers set_matrices (A, B); // and solve - size_type n_converged = 0; + unsigned int n_converged = 0; solve (n_eigenpairs, &n_converged); if (n_converged>=n_eigenpairs) @@ -813,7 +809,7 @@ namespace SLEPcWrappers eigenvectors.resize (n_converged, eigenvectors.front()); eigenvalues.resize (n_converged); - for (size_type index=0; index &imag_eigenvalues, std::vector &real_eigenvectors, std::vector &imag_eigenvectors, - const size_type n_eigenpairs) + const unsigned int n_eigenpairs) { // Guard against incompatible matrix sizes: AssertThrow (A.m() == B.m (), ExcDimensionMismatch(A.m(), B.m())); @@ -845,7 +841,7 @@ namespace SLEPcWrappers set_matrices (A, B); // and solve - size_type n_converged = 0; + unsigned int n_converged = 0; solve (n_eigenpairs, &n_converged); if (n_converged>=n_eigenpairs) @@ -861,7 +857,7 @@ namespace SLEPcWrappers real_eigenvalues.resize (n_converged); imag_eigenvalues.resize (n_converged); - for (size_type index=0; index