Class xlifepp::BlockDavidsonSolMgr#
-
template<class ScalarType, class MV, class OP>
class BlockDavidsonSolMgr : public xlifepp::SolverManager<ScalarType, MV, OP>#
-
Inheritence diagram for xlifepp::BlockDavidsonSolMgr:
Collaboration diagram for xlifepp::BlockDavidsonSolMgr:
The BlockDavidsonSolMgr provides a powerful solver manager over the BlockDavidson eigensolver.
This solver manager implements a hard-locking mechanism, whereby eigenpairs designated to be locked are moved from the eigensolver and placed in auxilliary storage. The eigensolver is then restarted and continues to iterate, orthogonal to the locked eigenvectors.
The solver manager provides to the solver a StatusTestCombo object constructed as follows:
combo = globaltest OR lockingtest OR debugtest
where-
globaltest
terminates computation when global convergence has been detected.
It is encapsulated in a
StatusTestWithOrderingobject, to ensure that computation is terminated only after the most significant eigenvalues/eigenvectors have met the convergence criteria.
If not specified via
setGlobalStatusTest(),globaltest
is a StatusTestResNorm object which tests the M-norms of the direct residuals relative to the Ritz values. -
lockingtest
halts BlockDavidson::iterate()in order to deflate converged eigenpairs for locking.
It will query the underlying
BlockDavidsoneigensolver to determine when eigenvectors should be locked.
If not specified via
setLockingStatusTest(),lockingtest
is a StatusTestResNorm object. -
debugtest
allows a user to specify additional monitoring of the iteration, encapsulated in a StatusTestobject
If not specified via
setDebugStatusTest(),debugtest
is ignored.
In most cases, it should return
_failed; if it returns _passed, solve() will throw an XlifeppError exception.
Additionally, the solver manager will terminate solve() after a specified number of restarts.
Much of this behavior is controlled via parameters and options passed to the solver manager. For more information, see BlockDavidsonSolMgr().
Solver application methods
Return the timers for this object.
The timers are ordered as follows:
time spent in solve() routine
time spent restarting
time spent locking converged eigenvectors
-
virtual ComputationInfo solve()#
-
This method performs possibly repeated calls to the underlying eigensolver’s iterate() routine until the problem has been solved (as decided by the solver manager) or the solver manager decides to quit.
This method calls BlockDavidson::iterate(), which will return either because a specially constructed status test evaluates to _passed or an exception is thrown.
A return from BlockDavidson::iterate() signifies one of the following scenarios:
-
the maximum number of restarts has been exceeded. In this scenario, the solver manager will place
all converged eigenpairs into the eigenproblem and return
_noConvergence. -
the locking conditions have been met. In this scenario, some of the current eigenpairs will be removed
from the eigensolver and placed into auxiliary storage. The eigensolver will be restarted with the remaining part of the Krylov subspace
and some random information to replace the removed subspace. -
global convergence has been met. In this case, the most significant NEV eigenpairs in the solver and locked storage
have met the convergence criterion. (Here, NEV refers to the number of eigenpairs requested by the
EigenProblem.)
In this scenario, the solver manager will return
_success.
- Returns:
-
ReturnType specifying:
_success: the eigenproblem was solved to the specification required by the solver manager.
_noConvergence: the eigenproblem was not solved to the specification desired by the solver manager.
-
-
void setGlobalStatusTest(const SmartPtr<StatusTest<ScalarType, MV, OP>> &global)#
-
Set the status test defining global convergence.
-
const SmartPtr<StatusTest<ScalarType, MV, OP>> &getGlobalStatusTest() const#
-
Get the status test defining global convergence.
-
void setLockingStatusTest(const SmartPtr<StatusTest<ScalarType, MV, OP>> &locking)#
-
Set the status test defining locking.
-
const SmartPtr<StatusTest<ScalarType, MV, OP>> &getLockingStatusTest() const#
-
Get the status test defining locking.
-
void setDebugStatusTest(const SmartPtr<StatusTest<ScalarType, MV, OP>> &debug)#
-
Set the status test for debugging.
-
const SmartPtr<StatusTest<ScalarType, MV, OP>> &getDebugStatusTest() const#
-
Get the status test for debugging.
Constructors/Destructor
-
BlockDavidsonSolMgr(const SmartPtr<EigenProblem<ScalarType, MV, OP>> &problem, Parameters &pl)#
-
Basic constructor for BlockDavidsonSolMgr.
This constructor accepts the EigenProblem to be solved in addition to a parameter list of options for the solver manager. These options include the following:
-
Solver parameters
"Which"
- astring
specifying the desired eigenvalues: SM, LM, SR or LR. Default: “SR”"Block Size"
- aint
specifying the block size to be used by the underlying block Davidson solver. Default: problem->getNEV()"Num Blocks"
- aint
specifying the number of blocks allocated for the Krylov basis. Default: 2"Maximum Restarts"
- aint
specifying the maximum number of restarts the underlying solver is allowed to perform. Default: 20"Verbosity"
- a sum of MsgType specifying the verbosity. Default: Errors
-
Convergence parameters (if using default convergence test; see setGlobalStatusTest())
"Convergence Tolerance"
- aMagnitudeType
specifying the level that residual norms must reach to decide convergence. Default: machine precision."Relative Convergence Tolerance"
- abool
specifying whether residuals norms should be scaled by their eigenvalues for the purposing of deciding convergence. Default: true"Convergence Norm"
- astring
specifying the norm for convergence testing: “2” or “M”
-
Locking parameters (if using default locking test; see setLockingStatusTest())
"Use Locking"
- abool
specifying whether the algorithm should employ locking of converged eigenpairs. Default: false"Max Locked"
- aint
specifying the maximum number of eigenpairs to be locked. Default: problem->getNEV()"Locking Quorum"
- aint
specifying the number of eigenpairs that must meet the locking criteria before locking actually occurs. Default: 1"Locking Tolerance"
- aMagnitudeType
specifying the level that residual norms must reach to decide locking. Default: 0.1*convergence tolerance"Relative Locking Tolerance"
- abool
specifying whether residuals norms should be scaled by their eigenvalues for the purposing of deciding locking. Default: true"Locking Norm"
- astring
specifying the norm for locking testing: “2” or “M”
-
-
inline virtual ~BlockDavidsonSolMgr()#
-
Destructor.
Accessor methods
-
inline virtual const EigenProblem<ScalarType, MV, OP> &getProblem() const#
-
Return the eigenvalue problem.
-