Belos Package Browser (Single Doxygen Collection)
Development
|
An implementation of StatusTestResNorm using a family of norms of subvectors of the residual vectors. More...
#include <BelosStatusTestGenResSubNorm.hpp>
Public Types | |
typedef Teuchos::ScalarTraits < ScalarType > | SCT |
typedef SCT::magnitudeType | MagnitudeType |
typedef MultiVecTraits < ScalarType, MV > | MVT |
Public Types inherited from Belos::StatusTestResNorm< ScalarType, MV, OP > | |
typedef Teuchos::ScalarTraits < ScalarType > | SCT |
typedef SCT::magnitudeType | MagnitudeType |
typedef MultiVecTraits < ScalarType, MV > | MVT |
Constructors/destructors. | |
StatusTestGenResSubNorm (MagnitudeType, size_t, int=-1, bool=false) | |
Constructor. More... | |
virtual | ~StatusTestGenResSubNorm () |
Destructor. More... | |
Form and parameter definition methods. | |
int | defineResForm (NormType) |
Define norm of the residual. More... | |
int | defineScaleForm (ScaleType, NormType, MagnitudeType=Teuchos::ScalarTraits< MagnitudeType >::one()) |
Define form of the scaling, its norm, its optional weighting std::vector, or, alternatively, define an explicit value. More... | |
int | setTolerance (MagnitudeType) |
Set the value of the tolerance. More... | |
int | setSubIdx (size_t subIdx) |
Set the block index of which we want to check the norm of the sub-residuals. More... | |
int | setQuorum (int) |
Sets the number of residuals that must pass the convergence test before Passed is returned. More... | |
int | setShowMaxResNormOnly (bool) |
Set whether the only maximum residual norm is displayed when the print() method is called. More... | |
Status methods | |
StatusType | checkStatus (Iteration< ScalarType, MV, OP > *) |
Check convergence status: Passed, Failed, or Undefined. More... | |
StatusType | getStatus () const |
Return the result of the most recent CheckStatus call. More... | |
Reset methods | |
void | reset () |
Resets the internal configuration to the initial state. More... | |
Print methods | |
void | print (std::ostream &, int=0) const |
Output formatted description of stopping test to output stream. More... | |
void | printStatus (std::ostream &, StatusType) const |
Print message for each status specific to this stopping test. More... | |
Methods to access data members. | |
Teuchos::RCP< MV > | getSolution () |
Returns the current solution estimate that was computed for the most recent residual test. More... | |
int | getQuorum () const |
Returns the number of residuals that must pass the convergence test before Passed is returned. More... | |
size_t | getSubIdx () const |
Returns the index of the block row the norms are calculated for. More... | |
bool | getShowMaxResNormOnly () |
Returns whether the only maximum residual norm is displayed when the print() method is called. More... | |
std::vector< int > | convIndices () |
Returns the std::vector containing the indices of the residuals that passed the test. More... | |
MagnitudeType | getTolerance () const |
Returns the value of the tolerance, , set in the constructor. More... | |
const std::vector < MagnitudeType > * | getTestValue () const |
Returns the test value, , computed in most recent call to CheckStatus. More... | |
const std::vector < MagnitudeType > * | getResNormValue () const |
Returns the residual norm value, , computed in most recent call to CheckStatus. More... | |
const std::vector < MagnitudeType > * | getScaledNormValue () const |
Returns the scaled norm value, . More... | |
bool | getLOADetected () const |
Returns a boolean indicating a loss of accuracy has been detected in computing the residual. More... | |
Misc. | |
StatusType | firstCallCheckStatusSetup (Iteration< ScalarType, MV, OP > *iSolver) |
Call to setup initial scaling std::vector. More... | |
Overridden from Teuchos::Describable | |
std::string | description () const |
Method to return description of the maximum iteration status test. More... | |
Additional Inherited Members | |
Public Member Functions inherited from Belos::StatusTestResNorm< ScalarType, MV, OP > | |
Public Member Functions inherited from Belos::StatusTest< ScalarType, MV, OP > | |
StatusTest () | |
Constructor. More... | |
virtual | ~StatusTest () |
Destructor. More... | |
Public Member Functions inherited from Teuchos::Describable | |
DescribableStreamManipulatorState | describe (const Describable &describable, const EVerbosityLevel verbLevel=Describable::verbLevel_default) |
std::ostream & | operator<< (std::ostream &os, const DescribableStreamManipulatorState &d) |
virtual void | describe (FancyOStream &out, const EVerbosityLevel verbLevel=verbLevel_default) const |
void | describe (std::ostream &out, const EVerbosityLevel verbLevel=verbLevel_default) const |
virtual | ~Describable () |
LabeledObject () | |
virtual | ~LabeledObject () |
virtual void | setObjectLabel (const std::string &objectLabel) |
virtual std::string | getObjectLabel () const |
Static Public Attributes inherited from Teuchos::Describable | |
static const EVerbosityLevel | verbLevel_default |
An implementation of StatusTestResNorm using a family of norms of subvectors of the residual vectors.
StatusTestGenResSubNorm is an implementation of StatusTestResNorm that allows a user to construct one of a family of residual tests for use as a status/convergence test for Belos.
Definition at line 40 of file BelosStatusTestGenResSubNorm.hpp.
typedef Teuchos::ScalarTraits<ScalarType> Belos::StatusTestGenResSubNorm< ScalarType, MV, OP >::SCT |
Definition at line 44 of file BelosStatusTestGenResSubNorm.hpp.
typedef SCT::magnitudeType Belos::StatusTestGenResSubNorm< ScalarType, MV, OP >::MagnitudeType |
Definition at line 45 of file BelosStatusTestGenResSubNorm.hpp.
typedef MultiVecTraits<ScalarType,MV> Belos::StatusTestGenResSubNorm< ScalarType, MV, OP >::MVT |
Definition at line 46 of file BelosStatusTestGenResSubNorm.hpp.
|
inline |
Constructor.
The constructor takes a single argument specifying the tolerance ( ). If none of the form definition methods are called, we use as the stopping criterion, where uses the least costly form of the 2-norm of residual available from the iterative method and is the corresponding norm of the initial residual. The least costly form of the 2-norm depends on the chosen iterative method.
Tolerance,: | Specifies tolerance |
subIdx,: | index of block row in the n x n block system we want to check the residual of |
quorum,: | Number of residual (sub-)vectors which are needed to be within the tolerance before check is considered to be passed |
showMaxResNormOnly,: | for output only |
Definition at line 64 of file BelosStatusTestGenResSubNorm.hpp.
|
inlinevirtual |
Destructor.
Definition at line 70 of file BelosStatusTestGenResSubNorm.hpp.
|
inline |
Define norm of the residual.
This method defines the form of . We specify:
Definition at line 83 of file BelosStatusTestGenResSubNorm.hpp.
|
inlinevirtual |
Define form of the scaling, its norm, its optional weighting std::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:
User-provided scaling value:
Implements Belos::StatusTestResNorm< ScalarType, MV, OP >.
Definition at line 110 of file BelosStatusTestGenResSubNorm.hpp.
|
inlinevirtual |
Set 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.
Implements Belos::StatusTestResNorm< ScalarType, MV, OP >.
Definition at line 120 of file BelosStatusTestGenResSubNorm.hpp.
|
inline |
Set the block index of which we want to check the norm of the sub-residuals.
It does not really make sense to change/reset the index during the solution process
Definition at line 125 of file BelosStatusTestGenResSubNorm.hpp.
|
inlinevirtual |
Sets the number of residuals that must pass the convergence test before Passed is returned.
quorum=-1
then all residuals must pass the convergence test before Passed is returned. Implements Belos::StatusTestResNorm< ScalarType, MV, OP >.
Definition at line 129 of file BelosStatusTestGenResSubNorm.hpp.
|
inlinevirtual |
Set whether the only maximum residual norm is displayed when the print() method is called.
Implements Belos::StatusTestResNorm< ScalarType, MV, OP >.
Definition at line 132 of file BelosStatusTestGenResSubNorm.hpp.
|
inlinevirtual |
Check convergence status: Passed, Failed, or Undefined.
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 145 of file BelosStatusTestGenResSubNorm.hpp.
|
inlinevirtual |
Return the result of the most recent CheckStatus call.
Implements Belos::StatusTest< ScalarType, MV, OP >.
Definition at line 148 of file BelosStatusTestGenResSubNorm.hpp.
|
inlinevirtual |
Resets the internal configuration to the initial state.
Implements Belos::StatusTest< ScalarType, MV, OP >.
Definition at line 155 of file BelosStatusTestGenResSubNorm.hpp.
|
inlinevirtual |
Output formatted description of stopping test to output stream.
Implements Belos::StatusTest< ScalarType, MV, OP >.
Definition at line 163 of file BelosStatusTestGenResSubNorm.hpp.
|
inlinevirtual |
Print message for each status specific to this stopping test.
Reimplemented from Belos::StatusTest< ScalarType, MV, OP >.
Definition at line 166 of file BelosStatusTestGenResSubNorm.hpp.
|
inlinevirtual |
Returns the current solution estimate that was computed for the most recent residual test.
Implements Belos::StatusTestResNorm< ScalarType, MV, OP >.
Definition at line 175 of file BelosStatusTestGenResSubNorm.hpp.
|
inlinevirtual |
Returns the number of residuals that must pass the convergence test before Passed is returned.
quorum=-1
then all residuals must pass the convergence test before Passed is returned. Implements Belos::StatusTestResNorm< ScalarType, MV, OP >.
Definition at line 179 of file BelosStatusTestGenResSubNorm.hpp.
|
inline |
Returns the index of the block row the norms are calculated for.
Definition at line 182 of file BelosStatusTestGenResSubNorm.hpp.
|
inlinevirtual |
Returns whether the only maximum residual norm is displayed when the print() method is called.
Implements Belos::StatusTestResNorm< ScalarType, MV, OP >.
Definition at line 185 of file BelosStatusTestGenResSubNorm.hpp.
|
inlinevirtual |
Returns the std::vector containing the indices of the residuals that passed the test.
Implements Belos::StatusTestResNorm< ScalarType, MV, OP >.
Definition at line 188 of file BelosStatusTestGenResSubNorm.hpp.
|
inlinevirtual |
Returns the value of the tolerance, , set in the constructor.
Implements Belos::StatusTestResNorm< ScalarType, MV, OP >.
Definition at line 191 of file BelosStatusTestGenResSubNorm.hpp.
|
inlinevirtual |
Returns the test value, , computed in most recent call to CheckStatus.
Implements Belos::StatusTestResNorm< ScalarType, MV, OP >.
Definition at line 194 of file BelosStatusTestGenResSubNorm.hpp.
|
inline |
Returns the residual norm value, , computed in most recent call to CheckStatus.
Definition at line 197 of file BelosStatusTestGenResSubNorm.hpp.
|
inline |
Returns the scaled norm value, .
Definition at line 200 of file BelosStatusTestGenResSubNorm.hpp.
|
inlinevirtual |
Returns a boolean indicating a loss of accuracy has been detected in computing the residual.
Implements Belos::StatusTestResNorm< ScalarType, MV, OP >.
Definition at line 204 of file BelosStatusTestGenResSubNorm.hpp.
|
inline |
Call to setup initial scaling std::vector.
After this function is called getScaledNormValue()
can be called to get the scaling std::vector.
Definition at line 217 of file BelosStatusTestGenResSubNorm.hpp.
|
inlinevirtual |
Method to return description of the maximum iteration status test.
Reimplemented from Teuchos::Describable.
Definition at line 226 of file BelosStatusTestGenResSubNorm.hpp.