NOX
Development
|
Various convergence tests based on the norm of the residual. More...
#include <NOX_StatusTest_NormF.H>
Public Types | |
enum | ScaleType { Unscaled, Scaled } |
Type that determines whether to scale the norm by the problem size. More... | |
enum | ToleranceType { Relative, Absolute } |
Type that determines whether the norm is absolute or relative to the intial guess. More... | |
Public Member Functions | |
NormF (double tolerance, NOX::Abstract::Vector::NormType ntype, ScaleType stype=Scaled, const NOX::Utils *u=NULL) | |
Constructor for absolute norm. More... | |
NormF (double tolerance, ScaleType stype=Scaled, const NOX::Utils *u=NULL) | |
Constructor for absolute norm. More... | |
NormF (NOX::Abstract::Group &initialGuess, double tolerance, NOX::Abstract::Vector::NormType ntype, ScaleType stype=Scaled, const NOX::Utils *u=NULL) | |
Constructor with initial guess (for relative norms) More... | |
NormF (NOX::Abstract::Group &initialGuess, double tolerance, ScaleType stype=Scaled, const NOX::Utils *u=NULL) | |
Constructor with initial guess (for relative norms) More... | |
virtual | ~NormF () |
Destructor. | |
virtual NOX::StatusTest::StatusType | checkStatus (const NOX::Solver::Generic &problem, NOX::StatusTest::CheckType checkType) |
Test the stopping criterion More... | |
virtual NOX::StatusTest::StatusType | getStatus () const |
Return the result of the most recent checkStatus call. | |
virtual std::ostream & | print (std::ostream &stream, int indent=0) const |
Output formatted description of stopping test to output stream. | |
virtual void | reset (double tolerance) |
Resets the user specified absolute or relative tolerance. | |
virtual void | reset (NOX::Abstract::Group &initialGuess, double tolerance) |
Resets the user specified relative tolerance. | |
virtual double | getNormF () const |
Returns the value of the F-norm computed in the last call to checkStatus. | |
virtual double | getTrueTolerance () const |
Returns the true tolerance. | |
virtual double | getSpecifiedTolerance () const |
Returns the specified tolerance set in the constructor. | |
virtual double | getInitialTolerance () const |
Returns the initial tolerance. | |
Public Member Functions inherited from NOX::StatusTest::Generic | |
Generic () | |
Constructor. | |
virtual | ~Generic () |
Destructor. | |
Various convergence tests based on the norm of the residual.
Use the constructor to define the test based on the type of scaling (see ScaleType) and the type of Tolerance (see Tolerance).
If checkStatus is called with the type set to NOX::StatusTest::None, then the status is set to NOX::StatusTest::Unevaluated and returned. (Also #normF is set to 0.0.)
If checkStatus is called on a problem where the solution group does not have F evaluated (i.e., problem.getSolutionGroup().isF() is false), then the status is set to NOX::StatusTest::Unconverged and returned. (Also #normF is set to -1.0.)
Finally, we return NOX::StatusTest::Converged if , and NOX::StatusTest::Unconverged otherwise. Here represents the norm of and represents the tolerance, as described below.
Let denote an optional scale factor defined as
sType
in the constructor is NOX::NormF::Scaled, andThen is defined as follows:
nType
in the constructor is Abstract::Vector::TWO, then
nType
in the constructor is Abstract::Vector::ONE, then
nType
in the constructor is Abstract::Vector::INF, then
We set as follows, based on the value of tolerance
in the constructor.
Here is the (as defined above) associated with the initial guess.
NOX::StatusTest::NormF::NormF | ( | double | tolerance, |
NOX::Abstract::Vector::NormType | ntype, | ||
ScaleType | stype = Scaled , |
||
const NOX::Utils * | u = NULL |
||
) |
Constructor for absolute norm.
This constructor defaults to the Absolute
tolerance type.
References NOX::StatusTest::Unevaluated.
NOX::StatusTest::NormF::NormF | ( | double | tolerance, |
ScaleType | stype = Scaled , |
||
const NOX::Utils * | u = NULL |
||
) |
Constructor for absolute norm.
This constructor defaults to the Absolute
ToleranceType and TWO
NormType.
NOX::StatusTest::NormF::NormF | ( | NOX::Abstract::Group & | initialGuess, |
double | tolerance, | ||
NOX::Abstract::Vector::NormType | ntype, | ||
ScaleType | stype = Scaled , |
||
const NOX::Utils * | u = NULL |
||
) |
Constructor with initial guess (for relative norms)
This constructor defaults to the Relative
tolerance type.
NOX::StatusTest::NormF::NormF | ( | NOX::Abstract::Group & | initialGuess, |
double | tolerance, | ||
ScaleType | stype = Scaled , |
||
const NOX::Utils * | u = NULL |
||
) |
Constructor with initial guess (for relative norms)
This constructor defaults to the Relative
ToleranceType and TWO
NormType.
|
virtual |
Test the stopping criterion
The test can (and should, if possible) be skipped if checkType is NOX::StatusType::None. If the test is skipped, then the status should be set to NOX::StatusTest::Unevaluated.
Implements NOX::StatusTest::Generic.
References NOX::StatusTest::Converged, NOX::Solver::Generic::getSolutionGroup(), NOX::StatusTest::None, NOX::StatusTest::Unconverged, and NOX::StatusTest::Unevaluated.