*/
virtual void set_solver_type (EPS &eps) const = 0;
- /*
- * Attributes that store the
- * relevant information for the
- * eigenproblem solver
- * context. These are: which
- * portion of the spectrum to solve
- * from; and the matrices and
- * vectors that discribe the
- * problem.
+ /**
+ * Which portion of the spectrum to
+ * solve from.
+ */
+ EPSWhich set_which;
+
+ /**
+ * The matrix $A$ of the
+ * generalized eigenvalue problem
+ * $Ax=B\lambda x$, or the standard
+ * eigenvalue problem $Ax=\lambda
+ * x$.
*/
- EPSWhich set_which;
+ const PETScWrappers::MatrixBase *opA;
- const PETScWrappers::MatrixBase *opA;
- const PETScWrappers::MatrixBase *opB;
- const PETScWrappers::VectorBase *initial_vector;
+ /**
+ * The matrix $B$ of the
+ * generalized eigenvalue problem
+ * $Ax=B\lambda x$.
+ */
+ const PETScWrappers::MatrixBase *opB;
+
+ const PETScWrappers::VectorBase *initial_vector;
/**
* Pointer to an an object that
* the PETScWrappers, but you can
* change that.
*/
- SolverKrylovSchur (SolverControl &cn,
- const MPI_Comm &mpi_communicator = PETSC_COMM_WORLD,
+ SolverKrylovSchur (SolverControl &cn,
+ const MPI_Comm &mpi_communicator = PETSC_COMM_SELF,
const AdditionalData &data = AdditionalData());
protected:
* solver. Usage: All spectrum, all problem types, complex.
*
* @ingroup SLEPcWrappers
- * @author Toby D. Young 2008
+ * @author Toby D. Young 2008, 2011
*/
class SolverArnoldi : public SolverBase
{
* should it be needed.
*/
struct AdditionalData
- {};
+ {
+ /**
+ * Constructor. By default, set the
+ * option of delayed
+ * reorthogonalization to false,
+ * i.e. don't do it.
+ */
+ AdditionalData (const bool delayed_reorthogonalization = false);
+
+ /**
+ * Flag for delayed
+ * reorthogonalization.
+ */
+ bool delayed_reorthogonalization;
+ };
/**
* SLEPc solvers will want to have
* change that.
*/
SolverArnoldi (SolverControl &cn,
- const MPI_Comm &mpi_communicator = PETSC_COMM_WORLD,
+ const MPI_Comm &mpi_communicator = PETSC_COMM_SELF,
const AdditionalData &data = AdditionalData());
protected:
* change that.
*/
SolverLanczos (SolverControl &cn,
- const MPI_Comm &mpi_communicator = PETSC_COMM_WORLD,
+ const MPI_Comm &mpi_communicator = PETSC_COMM_SELF,
const AdditionalData &data = AdditionalData());
protected:
* change that.
*/
SolverPower (SolverControl &cn,
- const MPI_Comm &mpi_communicator = PETSC_COMM_WORLD,
+ const MPI_Comm &mpi_communicator = PETSC_COMM_SELF,
const AdditionalData &data = AdditionalData());
protected:
* change that.
*/
SolverDavidson (SolverControl &cn,
- const MPI_Comm &mpi_communicator = PETSC_COMM_WORLD,
+ const MPI_Comm &mpi_communicator = PETSC_COMM_SELF,
const AdditionalData &data = AdditionalData());
protected:
/* ---------------------- SolverArnoldi ------------------------ */
+ SolverArnoldi::AdditionalData::
+ AdditionalData (const bool delayed_reorthogonalization)
+ :
+ delayed_reorthogonalization (delayed_reorthogonalization)
+ {}
+
SolverArnoldi::SolverArnoldi (SolverControl &cn,
const MPI_Comm &mpi_communicator,
const AdditionalData &data)
ierr = EPSSetTolerances(eps, this->solver_control.tolerance(),
this->solver_control.max_steps());
AssertThrow (ierr == 0, ExcSLEPcError(ierr));
+
+ // if requested, set delayed
+ // reorthogonalization in the
+ // Arnoldi iteration.
+ if (additional_data.delayed_reorthogonalization)
+ {
+ ierr = EPSArnoldiSetDelayed (eps, PETSC_TRUE);
+ AssertThrow (ierr == 0, ExcSLEPcError(ierr));
+ }
}
/* ---------------------- Lanczos ------------------------ */