NOX Development
Loading...
Searching...
No Matches
NOX::StatusTest::NormUpdate Class Reference

Various convergence tests based on the norm of the change in the solution vector, $ x $, between outer iterations. More...

#include <NOX_StatusTest_NormUpdate.H>

Inheritance diagram for NOX::StatusTest::NormUpdate:
Collaboration diagram for NOX::StatusTest::NormUpdate:

Public Types

enum  ScaleType { Unscaled , Scaled }
 Type that determines whether to scale the norm by the problem size. More...

Public Member Functions

 NormUpdate (double tolerance, NOX::Abstract::Vector::NormType ntype, ScaleType stype=Scaled)
 Constructor for absolute norm.
 NormUpdate (double tolerance, ScaleType stype=Scaled)
 Constructor for absolute norm.
virtual ~NormUpdate ()
 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 double getNormUpdate () const
 Returns the value of the Update-norm computed in the last call to checkStatus.
virtual double getTolerance () const
 Returns the true tolerance.
Public Member Functions inherited from NOX::StatusTest::Generic
 Generic ()
 Constructor.
virtual ~Generic ()
 Destructor.

Detailed Description

Various convergence tests based on the norm of the change in the solution vector, $ x $, between outer iterations.

If checkStatusEfficiently is called with the type set to NOX::StatusTest::None, then the status is set to NOX::StatusTest::Unevaluated and returned. (Also #normUpdate is set to -1.0.)

If checkStatusEfficiently is called on the first iteration, then the status is set to NOX::StatusTest::Unconverged and returned. (Also #normUpdate is set to -1.0.)

If checkStatusEfficiently 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 #normUpdate is set to -1.0.)

Finally, we return NOX::StatusTest::Converged if $\alpha <
\beta$ and NOX::StatusTest::Uncoverged otherwise. Here $\alpha$ represents the norm of $ \Delta x $ and $\beta$ represents the tolerance. We define:

\‍[ \Delta x = x_k - x_{k-1} \‍]

where $ x_k $ is the solution vector of the $ k $-th nonlinear iterate.

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

  • $\gamma = \frac{1}{n}$ if sType in the constructor is NOX::NormF::Scaled, and
  • $\gamma = 1$ if sType in the constructor is NOX::NormF::Unscaled.

Then $\alpha$ is defined as follows:

  • If nType in the constructor is Abstract::Vector::TWO, then

    \‍[ \alpha = \sqrt{ \gamma \sum_{i=1}^n \Delta x_i^2 } \‍]

  • If nType in the constructor is Abstract::Vector::ONE, then

    \‍[ \alpha = \gamma \sum_{i=1}^n | \Delta x_i | \‍]

  • If nType in the constructor is Abstract::Vector::INF, then

    \‍[ \alpha = \gamma \max_{i} | \Delta x_i |  \‍]

Finally, $\beta$ is set to the tolerance in the constructor, i.e.,

\‍[  \beta  = \mbox{tolerance} \‍]

Member Enumeration Documentation

◆ ScaleType

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.

Constructor & Destructor Documentation

◆ NormUpdate() [1/2]

NormUpdate::NormUpdate ( double tolerance,
NOX::Abstract::Vector::NormType ntype,
ScaleType stype = Scaled )

Constructor for absolute norm.

This constructor defaults to the Absolute tolerance type.

References NOX::StatusTest::Unevaluated.

◆ NormUpdate() [2/2]

NormUpdate::NormUpdate ( double tolerance,
ScaleType stype = Scaled )

Constructor for absolute norm.

This constructor defaults to the Absolute ToleranceType and TWO NormType.

References NOX::StatusTest::Unevaluated.

Member Function Documentation

◆ checkStatus()

◆ getStatus()

StatusType NormUpdate::getStatus ( ) const
virtual

Return the result of the most recent checkStatus call.

Implements NOX::StatusTest::Generic.

◆ print()

std::ostream & NormUpdate::print ( std::ostream & stream,
int indent = 0 ) const
virtual

Output formatted description of stopping test to output stream.

Implements NOX::StatusTest::Generic.

References NOX::Utils::sciformat().


The documentation for this class was generated from the following files: