|
Belos Version of the Day
|
Solver manager for CA-GMRES and standard GMRES. More...
#include <BelosGmresSolMgr.hpp>

Public Types | |
| typedef Scalar | scalar_type |
| typedef Teuchos::ScalarTraits < Scalar >::magnitudeType | magnitude_type |
| typedef MV | multivector_type |
| typedef OP | operator_type |
Public Member Functions | |
Constructors and destructor | |
| GmresSolMgr (const Teuchos::RCP< LinearProblem< Scalar, MV, OP > > &problem, const Teuchos::RCP< Teuchos::ParameterList > ¶ms, const bool debug=false) | |
| Preferred constructor. | |
| GmresSolMgr () | |
| Default constructor; defers setting parameters. | |
| virtual | ~GmresSolMgr () |
| Destructor, defined virtual for safe inheritance. | |
"Set" methods | |
| void | setProblem (const Teuchos::RCP< LinearProblem< Scalar, MV, OP > > &problem) |
| Set the linear problem to solve. | |
| void | setParameters (const Teuchos::RCP< Teuchos::ParameterList > ¶ms) |
| Set parameters for solving the linear problem. | |
| void | setUserConvStatusTest (const Teuchos::RCP< StatusTest< Scalar, MV, OP > > &userConvTest) |
| Set a user-defined convergence stopping criterion. | |
"Reset" methods | |
| void | reset (const ResetType type) |
| Reset the solver manager. | |
Solver application methods | |
| ReturnType | solve () |
Attempt to solve the linear system . | |
| void | setRHS (const Teuchos::RCP< const MV > &B) |
| Change the right-hand side of the linear system to solve. | |
| void | setLHS (const Teuchos::RCP< MV > &X) |
| Change the initial guess of the linear system to solve. | |
| void | changeStoppingCriteria (const magnitude_type convTol, const int maxItersPerRestart, const int maxNumRestarts) |
| Change stopping criteria for next invocation of solve(). | |
"Get" methods | |
| const LinearProblem< Scalar, MV, OP > & | getProblem () const |
| Const reference to the linear problem being solved. | |
| Teuchos::RCP< const Teuchos::ParameterList > | getValidParameters () const |
| Valid default parameters for this solver manager. | |
| Teuchos::RCP< const Teuchos::ParameterList > | getCurrentParameters () const |
| Current parameters for this solver manager instance. | |
| int | getNumIters () const |
Iteration count for the most recent call to solve(). | |
| bool | isLOADetected () const |
| Was a loss of accuracy detected? | |
| std::vector< std::pair< int, int > > | totalNumIters () const |
| Last solve's number of restarts and total iterations. | |
| static Teuchos::RCP< const Teuchos::ParameterList > | getDefaultParameters () |
| Valid default parameters for this solver manager. | |
Solver manager for CA-GMRES and standard GMRES.
PseudoBlockGmresSolMgr. If you want Flexible GMRES, use BlockGmresSolMgr with the appropriate option set.Definition at line 73 of file BelosGmresSolMgr.hpp.
| typedef Scalar Belos::GmresSolMgr< Scalar, MV, OP >::scalar_type |
Definition at line 75 of file BelosGmresSolMgr.hpp.
| typedef Teuchos::ScalarTraits<Scalar>::magnitudeType Belos::GmresSolMgr< Scalar, MV, OP >::magnitude_type |
Definition at line 76 of file BelosGmresSolMgr.hpp.
| typedef MV Belos::GmresSolMgr< Scalar, MV, OP >::multivector_type |
Definition at line 77 of file BelosGmresSolMgr.hpp.
| typedef OP Belos::GmresSolMgr< Scalar, MV, OP >::operator_type |
Definition at line 78 of file BelosGmresSolMgr.hpp.
| Belos::GmresSolMgr< Scalar, MV, OP >::GmresSolMgr | ( | const Teuchos::RCP< LinearProblem< Scalar, MV, OP > > & | problem, |
| const Teuchos::RCP< Teuchos::ParameterList > & | params, | ||
| const bool | debug = false |
||
| ) | [inline] |
Preferred constructor.
| problem | [in/out] The linear problem to solve. |
| params | [in/out] Parameters for the solve. If null, we use defaults, else we modify in place. |
Definition at line 96 of file BelosGmresSolMgr.hpp.
| Belos::GmresSolMgr< Scalar, MV, OP >::GmresSolMgr | ( | ) | [inline] |
Default constructor; defers setting parameters.
Definition at line 106 of file BelosGmresSolMgr.hpp.
| virtual Belos::GmresSolMgr< Scalar, MV, OP >::~GmresSolMgr | ( | ) | [inline, virtual] |
Destructor, defined virtual for safe inheritance.
Definition at line 112 of file BelosGmresSolMgr.hpp.
| const LinearProblem<Scalar,MV,OP>& Belos::GmresSolMgr< Scalar, MV, OP >::getProblem | ( | ) | const [inline, virtual] |
Const reference to the linear problem being solved.
Implements Belos::SolverManager< Scalar, MV, OP >.
Definition at line 120 of file BelosGmresSolMgr.hpp.
| Teuchos::RCP< const Teuchos::ParameterList > Belos::GmresSolMgr< Scalar, MV, OP >::getDefaultParameters | ( | ) | [static] |
Valid default parameters for this solver manager.
This class method is preferred to the instance method, because you can call it before you've instantiated the solver manager, and pass the parameters into the solver manager's constructor.
Definition at line 763 of file BelosGmresSolMgr.hpp.
| Teuchos::RCP<const Teuchos::ParameterList> Belos::GmresSolMgr< Scalar, MV, OP >::getValidParameters | ( | ) | const [inline, virtual] |
Valid default parameters for this solver manager.
The class method getDefaultParameters() is preferred, since it may be called before the solver manager has been instantiated.
Implements Belos::SolverManager< Scalar, MV, OP >.
Definition at line 139 of file BelosGmresSolMgr.hpp.
| Teuchos::RCP<const Teuchos::ParameterList> Belos::GmresSolMgr< Scalar, MV, OP >::getCurrentParameters | ( | ) | const [inline, virtual] |
Current parameters for this solver manager instance.
Implements Belos::SolverManager< Scalar, MV, OP >.
Definition at line 144 of file BelosGmresSolMgr.hpp.
| int Belos::GmresSolMgr< Scalar, MV, OP >::getNumIters | ( | ) | const [inline, virtual] |
Iteration count for the most recent call to solve().
It's not entirely clear what the SolutionManager interface expects this to mean. We've interpreted it to mean the maximum (over all right-hand side(s)) of the total number of iterations over all restart cycle(s).
Implements Belos::SolverManager< Scalar, MV, OP >.
Definition at line 154 of file BelosGmresSolMgr.hpp.
| bool Belos::GmresSolMgr< Scalar, MV, OP >::isLOADetected | ( | ) | const [inline, virtual] |
Was a loss of accuracy detected?
Some GMRES-type solvers have the capability to detect loss of accuracy. If this solver does not, this method always returns false. If the solver does have this capability, this flag starts out false, and will be (re)set the next time solve() is called.
Implements Belos::SolverManager< Scalar, MV, OP >.
Definition at line 168 of file BelosGmresSolMgr.hpp.
| std::vector<std::pair<int, int> > Belos::GmresSolMgr< Scalar, MV, OP >::totalNumIters | ( | ) | const [inline] |
Last solve's number of restarts and total iterations.
After calling solve(), you may call this method. For each right-hand side solved, it returns (total number of restart cycles, total number of iterations over all restart cycles). Before calling solve(), the result of calling this method is undefined.
Definition at line 180 of file BelosGmresSolMgr.hpp.
| void Belos::GmresSolMgr< Scalar, MV, OP >::setProblem | ( | const Teuchos::RCP< LinearProblem< Scalar, MV, OP > > & | problem | ) | [inline, virtual] |
Set the linear problem to solve.
This method restarts the current solve that might be in progress.
Implements Belos::SolverManager< Scalar, MV, OP >.
Definition at line 193 of file BelosGmresSolMgr.hpp.
| void Belos::GmresSolMgr< Scalar, MV, OP >::setParameters | ( | const Teuchos::RCP< Teuchos::ParameterList > & | params | ) | [virtual] |
Set parameters for solving the linear problem.
If necessary, this method restarts (by calling reset(Belos::Problem)) the current solve that might be in progress. Currently, it does so only if the parameters have not yet been set, or if the maximum number of iterations has changed (which affects GMRES storage).
| params | [in] New parameters for the linear solve. This may be modified in place on output in order to fill in missing parameters with default values. |
Implements Belos::SolverManager< Scalar, MV, OP >.
Definition at line 887 of file BelosGmresSolMgr.hpp.
| void Belos::GmresSolMgr< Scalar, MV, OP >::setUserConvStatusTest | ( | const Teuchos::RCP< StatusTest< Scalar, MV, OP > > & | userConvTest | ) | [virtual] |
Set a user-defined convergence stopping criterion.
This test will be applied in short-circuiting Boolean AND sequence after the other convergence tests. All convergence tests are invoked (in short-circuiting Boolean OR fashion) after testing whether the maximum number of iterations has been exceeded.
| userConvTest | [in] The user-defined convergence stopping criterion. |
Reimplemented from Belos::SolverManager< Scalar, MV, OP >.
Definition at line 1067 of file BelosGmresSolMgr.hpp.
| void Belos::GmresSolMgr< Scalar, MV, OP >::reset | ( | const ResetType | type | ) | [virtual] |
Reset the solver manager.
"Reset" with type = Belos::Problem means the following:
This method does not currently support values of type for which (type & Belos::RecycleSubspace) != 0.
| type | [in] The type of reset to perform. Only type = Belos::Problem is currently supported. |
Implements Belos::SolverManager< Scalar, MV, OP >.
Definition at line 1266 of file BelosGmresSolMgr.hpp.
| ReturnType Belos::GmresSolMgr< Scalar, MV, OP >::solve | ( | ) | [virtual] |
Attempt to solve the linear system
.
Do so by calling the underlying linear solver's iterate() routine zero or more times, until the problem has been solved (as decided by the solver manager) or the solver manager decides to quit.
Implements Belos::SolverManager< Scalar, MV, OP >.
Definition at line 1316 of file BelosGmresSolMgr.hpp.
| void Belos::GmresSolMgr< Scalar, MV, OP >::setRHS | ( | const Teuchos::RCP< const MV > & | B | ) | [inline] |
Change the right-hand side of the linear system to solve.
This works like a special case of setProblem(), when the only part of the problem that has changed is the right-hand side, and the new right-hand side is in the same vector space as the previous right-hand side. This avoids possibly expensive reinitialization of things like the orthogonalization manager. The initial guess will be left the same; in fact, if solve() has been called before, the initial guess will be the approximate solution from the last invocation of solve().
Definition at line 285 of file BelosGmresSolMgr.hpp.
| void Belos::GmresSolMgr< Scalar, MV, OP >::setLHS | ( | const Teuchos::RCP< MV > & | X | ) | [inline] |
Change the initial guess of the linear system to solve.
This works like a special case of setProblem(), when the only part of the problem that has changed is the initial guess, and the new initial guess is in the same vector space as the previous initial guess. This avoids possibly expensive reinitialization of things like the orthogonalization manager.
Definition at line 313 of file BelosGmresSolMgr.hpp.
| void Belos::GmresSolMgr< Scalar, MV, OP >::changeStoppingCriteria | ( | const magnitude_type | convTol, |
| const int | maxItersPerRestart, | ||
| const int | maxNumRestarts | ||
| ) | [inline] |
Change stopping criteria for next invocation of solve().
| convTol | [in] The new convergence tolerance. Interpretation of this depends on how the residual norm test(s) were initially set up. |
| maxItersPerRestart | [in] Maximum number of iterations per restart cycle. |
| maxNumRestarts | [in] Maximum number of restart cycle(s). |
Definition at line 334 of file BelosGmresSolMgr.hpp.
1.7.4