NOX::StatusTest::Stagnation Class Reference

Failure test based on the convergence rate between nonlinear iterations. More...

#include <NOX_StatusTest_Stagnation.H>

Inheritance diagram for NOX::StatusTest::Stagnation:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Stagnation (int n=50, double tol=1.0)
 Constructor.
virtual ~Stagnation ()
 Destructor.
virtual NOX::StatusTest::StatusType checkStatus (const NOX::Solver::Generic &problem, NOX::StatusTest::CheckType checkType)
 Tests the stopping criterion.
virtual NOX::StatusTest::StatusType getStatus () const
 Return the result of the most recent checkStatus call.
virtual ostream & print (ostream &stream, int indent=0) const
 Output formatted description of stopping test to output stream.
virtual int getMaxNumSteps () const
 Returns the used specified number of steps that can consecutively fail the tolerance test before the test returns a failed status.
virtual int getCurrentNumSteps () const
 Returns the current number of steps that have consecutively failed the tolerance test.
virtual double getTolerance () const
 Returns the user specified tolerance.
virtual double getConvRate () const
 Returns the current convergence rate.

Private Attributes

int maxSteps
 User supplied value of n.
int numSteps
 Current number of consecutive nonlinear iterations that have failed the specified tolerance.
int lastIteration
 The last nonlinear iteration index.
double tolerance
 User specified tolerance.
double convRate
 Currently computed convergence rate.
NOX::StatusTest::StatusType status
 Status


Detailed Description

Failure test based on the convergence rate between nonlinear iterations.

This status test returns NOX::StatusTest::Failed if we fail to reduce the norm of $F$ by a specified tolerance for n consecutive iterations. In other words, if

\[ \frac{\| F_k \|}{\| F_{k-1} \|} \geq {\rm tolerance}\]

for n consecutive iterations, the status is set to NOX::StatusTest::Failed and returned. Otherwise, the status is set to NOX::StatusTest::Uncoverged and returned. Both n and the tolerance are specified in the constructor, by n and tol, respectively.

Based on experience the following values are recommended:

Definition at line 81 of file NOX_StatusTest_Stagnation.H.


Constructor & Destructor Documentation

NOX::StatusTest::Stagnation::Stagnation ( int  n = 50,
double  tol = 1.0 
)

Constructor.

Parameters:
n - Number of consecutive nonlinear iterations
tol - Tolerance for stagnation test

Definition at line 47 of file NOX_StatusTest_Stagnation.C.

References NOX::StatusTest::Unevaluated.

NOX::StatusTest::Stagnation::~Stagnation (  )  [virtual]

Destructor.

Definition at line 58 of file NOX_StatusTest_Stagnation.C.


Member Function Documentation

NOX::StatusTest::StatusType NOX::StatusTest::Stagnation::checkStatus ( const NOX::Solver::Generic problem,
NOX::StatusTest::CheckType  checkType 
) [virtual]

Tests the stopping criterion.

Note:
The nature of this test is such that it must be executed at every nonlinear iteration, so we don't use the checkType argument.

Implements NOX::StatusTest::Generic.

Definition at line 64 of file NOX_StatusTest_Stagnation.C.

References convRate, NOX::StatusTest::Failed, NOX::Abstract::Group::getNormF(), NOX::Solver::Generic::getNumIterations(), NOX::Solver::Generic::getPreviousSolutionGroup(), NOX::Solver::Generic::getSolutionGroup(), lastIteration, maxSteps, numSteps, status, tolerance, and NOX::StatusTest::Unconverged.

NOX::StatusTest::StatusType NOX::StatusTest::Stagnation::getStatus (  )  const [virtual]

Return the result of the most recent checkStatus call.

Implements NOX::StatusTest::Generic.

Definition at line 110 of file NOX_StatusTest_Stagnation.C.

References status.

ostream & NOX::StatusTest::Stagnation::print ( ostream &  stream,
int  indent = 0 
) const [virtual]

Output formatted description of stopping test to output stream.

Implements NOX::StatusTest::Generic.

Definition at line 115 of file NOX_StatusTest_Stagnation.C.

References convRate, maxSteps, numSteps, and status.

int NOX::StatusTest::Stagnation::getMaxNumSteps (  )  const [virtual]

Returns the used specified number of steps that can consecutively fail the tolerance test before the test returns a failed status.

Definition at line 130 of file NOX_StatusTest_Stagnation.C.

References maxSteps.

int NOX::StatusTest::Stagnation::getCurrentNumSteps (  )  const [virtual]

Returns the current number of steps that have consecutively failed the tolerance test.

Definition at line 135 of file NOX_StatusTest_Stagnation.C.

References numSteps.

double NOX::StatusTest::Stagnation::getTolerance (  )  const [virtual]

Returns the user specified tolerance.

Definition at line 140 of file NOX_StatusTest_Stagnation.C.

References tolerance.

double NOX::StatusTest::Stagnation::getConvRate (  )  const [virtual]

Returns the current convergence rate.

Definition at line 145 of file NOX_StatusTest_Stagnation.C.

References convRate.


Member Data Documentation

User supplied value of n.

Definition at line 129 of file NOX_StatusTest_Stagnation.H.

Referenced by checkStatus(), getMaxNumSteps(), and print().

Current number of consecutive nonlinear iterations that have failed the specified tolerance.

Definition at line 132 of file NOX_StatusTest_Stagnation.H.

Referenced by checkStatus(), getCurrentNumSteps(), and print().

The last nonlinear iteration index.

This is used to prevent counting a step multiple times if by chance the status test is called multiple times between iterations.

Definition at line 138 of file NOX_StatusTest_Stagnation.H.

Referenced by checkStatus().

User specified tolerance.

Definition at line 141 of file NOX_StatusTest_Stagnation.H.

Referenced by checkStatus(), and getTolerance().

Currently computed convergence rate.

Definition at line 144 of file NOX_StatusTest_Stagnation.H.

Referenced by checkStatus(), getConvRate(), and print().

Status

Definition at line 147 of file NOX_StatusTest_Stagnation.H.

Referenced by checkStatus(), getStatus(), and print().


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

Generated on Wed Oct 21 14:28:49 2009 for Nonlinear Solver Project by  doxygen 1.5.9