]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Function to instruct SLEPc to exploit symmetry operations.
authoryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 22 Mar 2013 15:52:10 +0000 (15:52 +0000)
committeryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 22 Mar 2013 15:52:10 +0000 (15:52 +0000)
git-svn-id: https://svn.dealii.org/trunk@28990 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 865296a36bd2500467384a6c07ac4941c471bb3d..1f955323813880c5a39885ac71cdff9411f749aa 100644 (file)
@@ -187,12 +187,24 @@ namespace SLEPcWrappers
 
     /**
      * Indicate which part of the spectrum is to be computed. By
-     * default largest magnitude eigenvalues are computed.  For other
-     * allowed values see the SLEPc documentation.
+     * default largest magnitude eigenvalues are computed.
+     *
+     * @note For other allowed values see the SLEPc documentation.
      */
     void
     set_which_eigenpairs (EPSWhich set_which);
 
+    /**
+     * Specify the type of the eigenspectrum problem. This can be used
+     * to exploit known symmetries of the matrices that make up the
+     * standard/generalized eigenspectrum problem.  By default a
+     * non-Hermitian problem is assumed.
+     *
+     * @note For other allowed values see the SLEPc documentation.
+     */
+    void
+    set_problem_type (EPSProblemType set_problem);
+
     /**
      * Solve the linear system for n_eigenvectors
      * eigenstates. Parameter <code>n_converged</code> contains the
@@ -286,6 +298,11 @@ namespace SLEPcWrappers
      */
     EPSWhich set_which;
 
+    /**
+     * Set the eigenspectrum problem type.
+     */
+    EPSProblemType set_problem;
+
     /**
      * The matrix $A$ of the generalized eigenvalue problem
      * $Ax=B\lambda x$, or the standard eigenvalue problem $Ax=\lambda
@@ -639,6 +656,9 @@ namespace SLEPcWrappers
                      std::vector<OutputVector>       &vr,
                      const unsigned int               n_eigenvectors = 1)
   {
+    // Panic if no eigenpairs are wanted.
+    AssertThrow (n_eigenvectors != 0, ExcSLEPcWrappersUsageError());
+
     unsigned int n_converged = 0;
 
     // Set the matrices of the problem
@@ -668,6 +688,9 @@ namespace SLEPcWrappers
                      std::vector<OutputVector>       &vr,
                      const unsigned int               n_eigenvectors = 1)
   {
+    // Panic if no eigenpairs are wanted.
+    AssertThrow (n_eigenvectors != 0, ExcSLEPcWrappersUsageError());
+
     unsigned int n_converged = 0;
 
     // Set the matrices of the problem
index ac453b8d0dac85fcdf267f345228d37d815b5866..a7bdf486706802a554f0cd9c315a261ae44b5969 100644 (file)
@@ -50,6 +50,7 @@ namespace SLEPcWrappers
     solver_control (cn),
     mpi_communicator (mpi_communicator),
     set_which (EPS_LARGEST_MAGNITUDE),
+    set_problem (EPS_NHEP),
     opA (NULL),
     opB (NULL),
     initial_vector (NULL),
@@ -94,6 +95,12 @@ namespace SLEPcWrappers
     set_which = eps_which;
   }
 
+  void
+  SolverBase::set_problem_type (const EPSProblemType eps_problem)
+  {
+    set_problem = eps_problem;
+  }
+
   void
   SolverBase::solve (const unsigned int  n_eigenvectors, 
                     unsigned int       *n_converged)

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.