*
* @ingroup SLEPcWrappers
*
- * @author Toby D. Young 2009
+ * @author Toby D. Young 2009; Denis Davydov 2015;
*/
class SolverLanczos : public SolverBase
{
* it be needed.
*/
struct AdditionalData
- {};
+ {
+ /**
+ * The type of reorthogonalization used during the Lanczos iteration.
+ */
+ EPSLanczosReorthogType reorthog;
+
+ /**
+ * Constructor. By default sets the type of reorthogonalization used during the Lanczos iteration to full.
+ */
+ AdditionalData(const EPSLanczosReorthogType r = EPS_LANCZOS_REORTHOG_FULL);
+ };
/**
* SLEPc solvers will want to have an MPI communicator context over which
*
* @ingroup SLEPcWrappers
*
- * @author Toby D. Young 2010
+ * @author Toby D. Young 2010; Denis Davydov 2015
*/
class SolverGeneralizedDavidson : public SolverBase
{
* it be needed.
*/
struct AdditionalData
- {};
+ {
+ /**
+ * Use double expansion in search subspace.
+ */
+ bool double_expansion;
+
+ /**
+ * Constructor. By default set double_expansion to false.
+ */
+ AdditionalData(bool double_expansion = false);
+ };
/**
* SLEPc solvers will want to have an MPI communicator context over which
}
/* ---------------------- Lanczos ------------------------ */
+ SolverLanczos::AdditionalData::
+ AdditionalData(const EPSLanczosReorthogType r)
+ : reorthog(r)
+ {}
+
SolverLanczos::SolverLanczos (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));
+
+ ierr = EPSLanczosSetReorthog(eps,additional_data.reorthog);
+ AssertThrow (ierr == 0, ExcSLEPcError(ierr));
}
/* ----------------------- Power ------------------------- */
}
/* ---------------- Generalized Davidson ----------------- */
+ SolverGeneralizedDavidson::AdditionalData::
+ AdditionalData(bool double_expansion)
+ : double_expansion(double_expansion)
+ {}
+
SolverGeneralizedDavidson::SolverGeneralizedDavidson (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 (additional_data.double_expansion)
+ {
+ ierr = EPSGDSetDoubleExpansion (eps, PETSC_TRUE);
+ AssertThrow (ierr == 0, ExcSLEPcError(ierr));
+ }
#else
// Suppress compiler warnings about unused parameters.
(void) eps;