]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Merge from mainline.
authorBruno Turcksin <bruno.turcksin@gmail.com>
Fri, 3 May 2013 17:45:40 +0000 (17:45 +0000)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Fri, 3 May 2013 17:45:40 +0000 (17:45 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29448 0785d39b-7218-0410-832d-ea1e28bc413d

1  2 
deal.II/include/deal.II/lac/slepc_solver.h
deal.II/include/deal.II/lac/trilinos_sparse_matrix.h
deal.II/source/lac/slepc_solver.cc

index 765ebfa81669fbeea09aded4c4f9ef09f30ac0a9,402f4ebf69d4cfd42d516306f0867b98ed776658..2c44066774e02f667aadc1d4b6d31b6743ff6256
@@@ -155,9 -151,9 +155,9 @@@ namespace SLEPcWrapper
      template <typename OutputVector>
      void
      solve (const PETScWrappers::MatrixBase &A,
-            std::vector<double>             &kr,
-            std::vector<OutputVector>       &vr,
+            std::vector<double>             &r_eigenvalues,
+            std::vector<OutputVector>       &r_eigenvectors = std::vector<OutputVector> (),
 -           const unsigned int               n_eigenvectors = 1);
 +           const size_type                  n_eigenvectors = 1);
  
      /**
       * Same as above, but here a composite method for solving the
      void
      solve (const PETScWrappers::MatrixBase &A,
             const PETScWrappers::MatrixBase &B,
-            std::vector<double>             &kr,
-            std::vector<OutputVector>       &vr,
+            std::vector<double>             &r_eigenvalues,
+            std::vector<OutputVector>       &r_eigenvectors = std::vector<OutputVector> (),
 -           const unsigned int               n_eigenvectors = 1);
 +           const size_type                  n_eigenvectors = 1);
  
      /**
       * Set the initial vector for the solver.
    SolverBase::solve (const PETScWrappers::MatrixBase &A,
                       std::vector<double>             &kr,
                       std::vector<OutputVector>       &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); 
                       const PETScWrappers::MatrixBase &B,
                       std::vector<double>             &kr,
                       std::vector<OutputVector>       &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);
index 4b1150c23f16d1b9edce9260072d3cd3c37c4d45,9d5877f2aaa7eb8b1eb79f0482c912162952bb37..ae7088a473e1f40bdd7193f6cbc7b7de4a002bcc
@@@ -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<double>      &kr,
- #endif
                               PETScWrappers::VectorBase &vr)
    {
      AssertThrow (solver_data.get() != 0, ExcSLEPcWrappersUsageError());

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.