From: turcksin Date: Fri, 3 May 2013 17:45:40 +0000 (+0000) Subject: Merge from mainline. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebebbcaa5c56ab50d57e886d64143e6b566d123c;p=dealii-svn.git Merge from mainline. git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29448 0785d39b-7218-0410-832d-ea1e28bc413d --- ebebbcaa5c56ab50d57e886d64143e6b566d123c diff --cc deal.II/include/deal.II/lac/slepc_solver.h index 765ebfa816,402f4ebf69..2c44066774 --- a/deal.II/include/deal.II/lac/slepc_solver.h +++ b/deal.II/include/deal.II/lac/slepc_solver.h @@@ -155,9 -151,9 +155,9 @@@ namespace SLEPcWrapper template void solve (const PETScWrappers::MatrixBase &A, - std::vector &kr, - std::vector &vr, + std::vector &r_eigenvalues, + std::vector &r_eigenvectors = std::vector (), - const unsigned int n_eigenvectors = 1); + const size_type n_eigenvectors = 1); /** * Same as above, but here a composite method for solving the @@@ -167,9 -163,9 +167,9 @@@ void solve (const PETScWrappers::MatrixBase &A, const PETScWrappers::MatrixBase &B, - std::vector &kr, - std::vector &vr, + std::vector &r_eigenvalues, + std::vector &r_eigenvectors = std::vector (), - const unsigned int n_eigenvectors = 1); + const size_type n_eigenvectors = 1); /** * Set the initial vector for the solver. @@@ -725,12 -717,11 +721,11 @@@ SolverBase::solve (const PETScWrappers::MatrixBase &A, std::vector &kr, std::vector &vr, - const unsigned int n_eigenvectors) + const size_type n_eigenvectors) { - // Panic if no eigenpairs are wanted. - AssertThrow (n_eigenvectors != 0, ExcSLEPcWrappersUsageError()); - - size_type n_converged = 0; + // Panic if the number of eigenpairs wanted is out of bounds. + AssertThrow ((n_eigenvectors > 0) && (n_eigenvectors <= A.m ()), + ExcSLEPcWrappersUsageError()); // Set the matrices of the problem set_matrices (A); @@@ -764,13 -749,15 +753,15 @@@ const PETScWrappers::MatrixBase &B, std::vector &kr, std::vector &vr, -- const unsigned int n_eigenvectors) - >>>>>>> .merge-right.r29387 ++ const size_type n_eigenvectors) { - // Panic if no eigenpairs are wanted. - AssertThrow (n_eigenvectors != 0, ExcSLEPcWrappersUsageError()); + // Guard against incompatible matrix sizes: + AssertThrow (A.m() == B.m (), ExcDimensionMismatch(A.m(), B.m())); + AssertThrow (A.n() == B.n (), ExcDimensionMismatch(A.n(), B.n())); - size_type n_converged = 0; + // Panic if the number of eigenpairs wanted is out of bounds. + AssertThrow ((n_eigenvectors > 0) && (n_eigenvectors <= A.m ()), + ExcSLEPcWrappersUsageError()); // Set the matrices of the problem set_matrices (A, B); diff --cc deal.II/source/lac/slepc_solver.cc index 4b1150c23f,9d5877f2aa..ae7088a473 --- a/deal.II/source/lac/slepc_solver.cc +++ b/deal.II/source/lac/slepc_solver.cc @@@ -219,12 -219,8 +219,8 @@@ namespace SLEPcWrapper } void - SolverBase::get_eigenpair (const unsigned int index, + SolverBase::get_eigenpair (const size_type index, - #ifndef PETSC_USE_COMPLEX double &kr, - #else - std::complex &kr, - #endif PETScWrappers::VectorBase &vr) { AssertThrow (solver_data.get() != 0, ExcSLEPcWrappersUsageError());