NOX Development
Public Types | Public Member Functions
NOX::StatusTest::NormF Class Reference

Various convergence tests based on the norm of the residual. More...

#include <NOX_StatusTest_NormF.H>

Inheritance diagram for NOX::StatusTest::NormF:
Inheritance graph
[legend]
Collaboration diagram for NOX::StatusTest::NormF:
Collaboration graph
[legend]

List of all members.

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.
 NormF (double tolerance, ScaleType stype=Scaled, const NOX::Utils *u=NULL)
 Constructor for absolute norm.
 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)
 NormF (NOX::Abstract::Group &initialGuess, double tolerance, ScaleType stype=Scaled, const NOX::Utils *u=NULL)
 Constructor with initial guess (for relative norms)
virtual ~NormF ()
 Destructor.
virtual NOX::StatusTest::StatusType checkStatus (const NOX::Solver::Generic &problem, NOX::StatusTest::CheckType checkType)
 Test the stopping criterion
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.

Detailed Description

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 $\alpha < \beta$, and NOX::StatusTest::Unconverged otherwise. Here $\alpha$ represents the norm of $F(x)$ and $\beta$ represents the tolerance, as described below.

Let $\gamma$ denote an optional scale factor defined as

Then $\alpha$ is defined as follows:

We set $\beta$ as follows, based on the value of tolerance in the constructor.


Member Enumeration Documentation

Type that determines whether to scale the norm by the problem size.

Enumerator:
Unscaled 

No norm scaling.

Scaled 

Scale the norm by the length of the vector.

Type that determines whether the norm is absolute or relative to the intial guess.

Enumerator:
Relative 

Relative to starting guess.

Absolute 

Absolute.


Constructor & Destructor Documentation

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.


Member Function Documentation

NOX::StatusTest::StatusType NOX::StatusTest::NormF::checkStatus ( const NOX::Solver::Generic problem,
NOX::StatusTest::CheckType  checkType 
) [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.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends