#include <BelosStatusTestResNorm.hpp>
Inheritance diagram for Belos::StatusTestResNorm< ScalarType, MV, OP >:

Public Types | |
| typedef Teuchos::ScalarTraits< ScalarType > | SCT |
| typedef SCT::magnitudeType | MagnitudeType |
| typedef MultiVecTraits< ScalarType, MV > | MVT |
Enums. | |
| enum | ResType { Implicit, Explicit } |
| Select how the residual vector is produced. More... | |
| enum | ScaleType { NormOfRHS, NormOfInitRes, NormOfPrecInitRes, None, UserProvided } |
| Select the scale type. More... | |
Public Member Functions | |
Constructors/destructors. | |
| StatusTestResNorm (MagnitudeType Tolerance, bool showMaxResNormOnly=false) | |
| Constructor. | |
| virtual | ~StatusTestResNorm () |
| Destructor. | |
Form and parameter definition methods. | |
| int | DefineResForm (ResType TypeOfResidual, NormType TypeOfNorm) |
| Define form of the residual, its norm and optional weighting vector. | |
| int | DefineScaleForm (ScaleType TypeOfScaling, NormType TypeOfNorm, MagnitudeType ScaleValue=Teuchos::ScalarTraits< MagnitudeType >::one()) |
| Define form of the scaling, its norm, its optional weighting vector, or, alternatively, define an explicit value. | |
| int | ResetTolerance (MagnitudeType Tolerance) |
| Reset the value of the tolerance. | |
Status methods | |
| StatusType | CheckStatus (IterativeSolver< ScalarType, MV, OP > *iSolver) |
| Check convergence status: Unconverged, Converged, Failed. | |
| StatusType | GetStatus () const |
| Return the result of the most recent CheckStatus call. | |
Reset methods | |
| void | Reset () |
| Resets the internal configuration to the initial state. | |
Attribute methods | |
| bool | ResidualVectorRequired () const |
| Indicates if residual vector is required by this convergence test. | |
Print methods | |
| ostream & | Print (ostream &os, int indent=0) const |
| Output formatted description of stopping test to output stream. | |
Methods to access data members. | |
| MagnitudeType | GetTolerance () const |
Returns the value of the tolerance, , set in the constructor. | |
| const std::vector< MagnitudeType > * | GetTestValue () const |
Returns the test value, , computed in most recent call to CheckStatus. | |
| const std::vector< MagnitudeType > * | GetResNormValue () const |
Returns the residual norm value, , computed in most recent call to CheckStatus. | |
| const std::vector< MagnitudeType > * | GetScaledNormValue () const |
Returns the scaled norm value, . | |
Misc. | |
| StatusType | FirstcallCheckStatusSetup (IterativeSolver< ScalarType, MV, OP > *iSolver) |
| Call to setup initial scaling vector. | |
StatusTestResNorm is an implementation of StatusTest that allows a user to construct one of a family of residual tests for use as a status/convergence test for Belos. The form of the test is
where
is the i-th residual vector, implicitly or explicitly computed (determined by enum ResType),
is the i-th residual norm determined by the enum NormType (1-norm, 2-norm or inf-norm),
is the i-th scale factor that can be passed in as a precomputed number of the templated type, or can be selected from by the enum ScaleType (norm of RHS, norm of initial residual).
is the tolerance that is passed in as a number of the templated type to the constructor. The value of
can be reset using the ResetTolerance() method.
Definition at line 66 of file BelosStatusTestResNorm.hpp.
|
|||||
|
Definition at line 71 of file BelosStatusTestResNorm.hpp. |
|
|||||
|
Definition at line 72 of file BelosStatusTestResNorm.hpp. |
|
|||||
|
Definition at line 73 of file BelosStatusTestResNorm.hpp. |
|
|||||
|
Select how the residual vector is produced.
Definition at line 80 of file BelosStatusTestResNorm.hpp. |
|
|||||
|
Select the scale type.
Definition at line 88 of file BelosStatusTestResNorm.hpp. |
|
||||||||||||||||
|
Constructor.
The constructor takes a single argument specifying the tolerance ( Definition at line 303 of file BelosStatusTestResNorm.hpp. |
|
|||||||||
|
Destructor.
Definition at line 325 of file BelosStatusTestResNorm.hpp. |
|
||||||||||||||||
|
Define form of the residual, its norm and optional weighting vector.
This method defines the form of
Definition at line 339 of file BelosStatusTestResNorm.hpp. |
|
||||||||||||||||||||
|
Define form of the scaling, its norm, its optional weighting vector, or, alternatively, define an explicit value. This method defines the form of how the residual is scaled (if at all). It operates in two modes:
Definition at line 355 of file BelosStatusTestResNorm.hpp. |
|
||||||||||
|
Reset the value of the tolerance. We allow the tolerance to be reset for cases where, in the process of testing the residual, we find that the initial tolerance was too tight or too lax. Definition at line 156 of file BelosStatusTestResNorm.hpp. |
|
||||||||||
|
Check convergence status: Unconverged, Converged, Failed. This method checks to see if the convergence criteria are met. Depending on how the residual test is constructed this method will return the appropriate status type.
Implements Belos::StatusTest< ScalarType, MV, OP >. Definition at line 370 of file BelosStatusTestResNorm.hpp. |
|
|||||||||
|
Return the result of the most recent CheckStatus call.
Implements Belos::StatusTest< ScalarType, MV, OP >. Definition at line 172 of file BelosStatusTestResNorm.hpp. |
|
|||||||||
|
Resets the internal configuration to the initial state.
Implements Belos::StatusTest< ScalarType, MV, OP >. Definition at line 329 of file BelosStatusTestResNorm.hpp. |
|
|||||||||
|
Indicates if residual vector is required by this convergence test. The value returned by this method will depend on several factors. Once an StatusTestResNorm object is constructed and the DefineResForm and DefineScaleForm methods are optionally called, this method can tested. For most Krylov solvers, there is no extra cost to providing the residual vector. However, GMRES and Transpose-free QMR will need to explicitly compute this vector if ResidualVectorRequired() returns true, so this is an extra cost for these two iterative methods. Implements Belos::StatusTest< ScalarType, MV, OP >. Definition at line 195 of file BelosStatusTestResNorm.hpp. |
|
||||||||||||||||
|
Output formatted description of stopping test to output stream.
Implements Belos::StatusTest< ScalarType, MV, OP >. Definition at line 481 of file BelosStatusTestResNorm.hpp. |
|
|||||||||
|
Returns the value of the tolerance,
Definition at line 210 of file BelosStatusTestResNorm.hpp. |
|
|||||||||
|
Returns the test value,
Definition at line 213 of file BelosStatusTestResNorm.hpp. |
|
|||||||||
|
Returns the residual norm value,
Definition at line 216 of file BelosStatusTestResNorm.hpp. |
|
|||||||||
|
Returns the scaled norm value,
Definition at line 219 of file BelosStatusTestResNorm.hpp. |
|
||||||||||
|
Call to setup initial scaling vector.
After this function is called Definition at line 532 of file BelosStatusTestResNorm.hpp. |
1.3.9.1