Xyce
6.1
|
Failure test based on the convergence rate between nonlinear iterations. More...
#include <N_NLS_NOX_StagnationTest.h>
Public Member Functions | |
Stagnation (int n=5, double tolerance=1.0e-3) | |
Constructor. More... | |
virtual | ~Stagnation () |
Destructor. More... | |
virtual NOX::StatusTest::StatusType | checkStatus (const NOX::Solver::Generic &problem) |
virtual NOX::StatusTest::StatusType | getStatus () const |
virtual std::ostream & | print (std::ostream &stream, int indent=0) const |
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. More... | |
virtual int | getCurrentNumSteps () const |
Returns the current number of steps that have consecutively failed the tolerance test. More... | |
virtual double | getTolerance () const |
Returns the user specified tolerance. More... | |
virtual double | getConvRate () const |
Returns the current convergence rate. More... | |
Private Attributes | |
int | maxSteps |
User supplied value of n. More... | |
int | numSteps |
Current number of consecutive nonlinear iterations that have failed the specified tolerance. More... | |
int | lastIteration |
The last nonlinear iteration index. More... | |
double | tolerance |
User specified tolerance. More... | |
double | convRate |
Currently computed convergence rate. More... | |
double | minConvRate |
double | normFInit |
NOX::StatusTest::StatusType | status |
Status More... | |
Failure test based on the convergence rate between nonlinear iterations.
This status test returns a Failed status if the convergence rate is worse than a specified tolerance for consecutive iterations.
In many codes if the Jacobian is not accurate, the solver can stagnate. In this case, further nonlinear iterations make negligible progress in reducing the norm of F. To prevent unnecessary churning, this status test will identify when a code stagnates and ends the solve.
This status test returns a Failed status if nonlinear steps have consecutively failed the following test:
At nonlinear iteration , the convergence rate,
is computed by:
If is greater than or equal to the specified tolerance, then a counter is incremented. If the counter hits the user specified number of iterations, the status test returns a Failed status. NOTE: For the counter to increment, the steps have to fail CONSECUTIVELY. The counter is reset every time a convergence rate passes the requested tolerance.
Based on experience the following values are recomended:
Definition at line 84 of file N_NLS_NOX_StagnationTest.h.
N_NLS_NOX::Stagnation::Stagnation | ( | int | n = 5 , |
double | tolerance = 1.0e-3 |
||
) |
Constructor.
n is the number of consecutive nonlinear iterations with a convergence rate failure for this test to return a Failed status.
Definition at line 57 of file N_NLS_NOX_StagnationTest.C.
|
virtual |
Destructor.
Definition at line 70 of file N_NLS_NOX_StagnationTest.C.
|
virtual |
Definition at line 76 of file N_NLS_NOX_StagnationTest.C.
|
virtual |
Returns the current convergence rate.
Definition at line 174 of file N_NLS_NOX_StagnationTest.C.
|
virtual |
Returns the current number of steps that have consecutively failed the tolerance test.
Definition at line 164 of file N_NLS_NOX_StagnationTest.C.
|
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 159 of file N_NLS_NOX_StagnationTest.C.
|
virtual |
Definition at line 134 of file N_NLS_NOX_StagnationTest.C.
|
virtual |
Returns the user specified tolerance.
Definition at line 169 of file N_NLS_NOX_StagnationTest.C.
|
virtual |
Definition at line 139 of file N_NLS_NOX_StagnationTest.C.
|
private |
Currently computed convergence rate.
Definition at line 134 of file N_NLS_NOX_StagnationTest.h.
|
private |
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 128 of file N_NLS_NOX_StagnationTest.h.
|
private |
User supplied value of n.
Definition at line 119 of file N_NLS_NOX_StagnationTest.h.
|
private |
Definition at line 136 of file N_NLS_NOX_StagnationTest.h.
|
private |
Definition at line 138 of file N_NLS_NOX_StagnationTest.h.
|
private |
Current number of consecutive nonlinear iterations that have failed the specified tolerance.
Definition at line 122 of file N_NLS_NOX_StagnationTest.h.
|
private |
Status
Definition at line 141 of file N_NLS_NOX_StagnationTest.h.
|
private |
User specified tolerance.
Definition at line 131 of file N_NLS_NOX_StagnationTest.h.