NOX::StatusTest::MaxIters Class Reference

Failure test based on the maximum number of nonlinear solver iterations. More...

#include <NOX_StatusTest_MaxIters.H>

Inheritance diagram for NOX::StatusTest::MaxIters:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 MaxIters (int maxIterations, const NOX::Utils *u=NULL)
 Constructor. Specify the maximum number of nonlinear solver iterations, $k_{\max}$ ands optinally an error stream for printing errors.
virtual ~MaxIters ()
 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 ostream & print (ostream &stream, int indent=0) const
 Output formatted description of stopping test to output stream.
virtual int getMaxIters () const
 Returns the Maximum number of iterations set in the constructor.
virtual int getNumIters () const
 Returns the current number of iterations taken by the solver.

Private Attributes

int maxiters
 Maximum number of iterations.
int niters
 Current number of iterations (if known).
NOX::StatusTest::StatusType status
 Status
NOX::Utils utils
 Ostream used to print errors.


Detailed Description

Failure test based on the maximum number of nonlinear solver iterations.

Let $k$ denote the current number of iterations (accessed via NOX::Solver::getNumIterations) and $k_{\max}$ denote the tolerance set in the constructor of this status test. This test returns NOX::StatusTest::Failed if $ k \geq k_{\rm max}. $ Otherwise, it returns NOX::StatusTest::Unconverged.

Note:
If checkStatus is called with the type set to NOX::StatusTest::None, it then the status is set to to NOX::Status::Unevaluated and returned. (Also niters is set to -1.)

Definition at line 67 of file NOX_StatusTest_MaxIters.H.


Constructor & Destructor Documentation

NOX::StatusTest::MaxIters::MaxIters ( int  maxIterations,
const NOX::Utils u = NULL 
)

Constructor. Specify the maximum number of nonlinear solver iterations, $k_{\max}$ ands optinally an error stream for printing errors.

Definition at line 47 of file NOX_StatusTest_MaxIters.C.

References NOX::Utils::err(), maxiters, NOX::StatusTest::Unevaluated, and utils.

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

Destructor.

Definition at line 62 of file NOX_StatusTest_MaxIters.C.


Member Function Documentation

NOX::StatusTest::StatusType NOX::StatusTest::MaxIters::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.

Definition at line 67 of file NOX_StatusTest_MaxIters.C.

References NOX::StatusTest::Complete, NOX::StatusTest::Failed, NOX::Solver::Generic::getNumIterations(), maxiters, NOX::StatusTest::Minimal, niters, NOX::StatusTest::None, status, NOX::StatusTest::Unconverged, and NOX::StatusTest::Unevaluated.

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

Return the result of the most recent checkStatus call.

Implements NOX::StatusTest::Generic.

Definition at line 88 of file NOX_StatusTest_MaxIters.C.

References status.

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

Output formatted description of stopping test to output stream.

Implements NOX::StatusTest::Generic.

Definition at line 93 of file NOX_StatusTest_MaxIters.C.

References maxiters, niters, and status.

int NOX::StatusTest::MaxIters::getMaxIters (  )  const [virtual]

Returns the Maximum number of iterations set in the constructor.

Definition at line 103 of file NOX_StatusTest_MaxIters.C.

References maxiters.

int NOX::StatusTest::MaxIters::getNumIters (  )  const [virtual]

Returns the current number of iterations taken by the solver.

Returns -1 if the status of this test is NOX::StatusTest::Unevaluated.

Definition at line 108 of file NOX_StatusTest_MaxIters.C.

References niters.


Member Data Documentation

Maximum number of iterations.

Definition at line 98 of file NOX_StatusTest_MaxIters.H.

Referenced by checkStatus(), getMaxIters(), MaxIters(), and print().

Current number of iterations (if known).

Definition at line 101 of file NOX_StatusTest_MaxIters.H.

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

Status

Definition at line 104 of file NOX_StatusTest_MaxIters.H.

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

Ostream used to print errors.

Definition at line 107 of file NOX_StatusTest_MaxIters.H.

Referenced by MaxIters().


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

Generated on Thu Dec 17 11:03:09 2009 for Nonlinear Solver Project by  doxygen 1.5.9