#include <NOX_StatusTest_MaxIters.H>
Public Member Functions | |
MaxIters (int maxIterations, const NOX::Utils *u=NULL) | |
Constructor. Specify the maximum number of nonlinear solver iterations, ![]() | |
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. |
Let denote the current number of iterations (accessed via NOX::Solver::getNumIterations) and
denote the tolerance set in the constructor of this status test. This test returns NOX::StatusTest::Failed if
Otherwise, it returns NOX::StatusTest::Unconverged.
Definition at line 67 of file NOX_StatusTest_MaxIters.H.
NOX::StatusTest::MaxIters::MaxIters | ( | int | maxIterations, | |
const NOX::Utils * | u = NULL | |||
) |
Constructor. Specify the maximum number of nonlinear solver iterations, 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] |
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.
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.
int NOX::StatusTest::MaxIters::maxiters [private] |
Maximum number of iterations.
Definition at line 98 of file NOX_StatusTest_MaxIters.H.
Referenced by checkStatus(), getMaxIters(), MaxIters(), and print().
int NOX::StatusTest::MaxIters::niters [private] |
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().
NOX::Utils NOX::StatusTest::MaxIters::utils [private] |
Ostream used to print errors.
Definition at line 107 of file NOX_StatusTest_MaxIters.H.
Referenced by MaxIters().