#include <NOX_StatusTest_NormWRMS.H>
Public Member Functions | |
NormWRMS (double rtol, double atol, double BDFMultiplier=1.0, double tolerance=1.0, double alpha=1.0, double beta=0.5) | |
Constructor where ATOL is a scalar. | |
NormWRMS (double rtol, const Teuchos::RCP< const NOX::Abstract::Vector > &atol, double BDFMultiplier=1.0, double tolerance=1.0, double alpha=1.0, double beta=0.5) | |
Constructor where ATOL is a vector. | |
virtual | ~NormWRMS () |
Destructor. | |
virtual StatusType | checkStatus (const NOX::Solver::Generic &problem, NOX::StatusTest::CheckType checkType) |
Test the stopping criterion | |
virtual 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 double | getNormWRMS () const |
Returns the value of WRMS norm. | |
virtual double | getTolerance () const |
Returns the requested tolerance set in the constructor. | |
virtual double | getRTOL () const |
Returns the realative tolerance set in the constructor. | |
virtual double | getATOL () const |
Returns the absolute tolerance set in the constructor. If ATOL is a vector, this will return a value of -1.0. | |
virtual double | getBDFMultiplier () const |
Returns the value of the BDFMultiplier set in the constructor. | |
virtual double | getAlpha () const |
Returns the value of 'alpha' set in the constructor. | |
virtual double | getBeta () const |
Returns the value of 'beta' set in the constructor. | |
Private Attributes | |
double | value |
Current value of the WRMS norm (Must be less than 'tolerance' for convergence). | |
double | rtol |
Relative tolerance for convergence. | |
bool | atolIsScalar |
flag to tell whether atol is a scalar or a vector. | |
double | atol |
Absolute tolerance for convergence (scalar). | |
Teuchos::RCP< const NOX::Abstract::Vector > | atolVec |
Absolute tolerance for convergence (vector). | |
double | factor |
Time integration method multiplier (BDF Multiplier). | |
double | tolerance |
Required tolerance for the NormWRMS to be declared converged. | |
double | alpha |
Minimum step size allowed during a line search for WRMS norm to be flagged as converged. | |
double | computedStepSize |
Actual step size used during line search. | |
double | beta |
Maximum linear solve tolerance allowed for WRMS norm to be flagged as converged. | |
double | achievedTol |
Actual tolerance achieved by the linear solver during the last linear solve. | |
StatusType | status |
Status | |
Teuchos::RCP < NOX::Abstract::Vector > | u |
Temporary vector used in computation. | |
Teuchos::RCP < NOX::Abstract::Vector > | v |
Temporary vector used in computation. | |
bool | printCriteria2Info |
Flag that tells the print method whether to print the criteria 2 information. | |
bool | printCriteria3Info |
Flag that tells the print method whether to print the criteria 3 information. |
` If the number of iterations is zero, then the status is set to NOX::StatusTest::Unconverged and returned. (Also, value is set to 1.0e+12.)
Otherwise, returns NOX::StatusTest::Converged if the three criteria listed below are satisfied. Note that use of Criteria #2 and #3 depend on the options set in the solver.
where
Here:
rtol
in the constructoratol
in the constructor. This can be a vector or a scalar.BDFMultiplier
in the constructor.
The motivation for this test is to avoid detecting stagnation when in fact the true problem is that the step size is just small.
The value of is set in the constructor via the argument
alpha
. Setting to zero effectively eliminates this part of the test.
The motivation for this test is to avoid detecting stagnation when in fact the true problem is that the linear solve tolerance was not accurate enough.
The value of is set in the constructor via the argument
beta
. Setting to 1.0 effectively eliminates this part of the test.
References:
Definition at line 145 of file NOX_StatusTest_NormWRMS.H.
NormWRMS::NormWRMS | ( | double | rtol, | |
double | atol, | |||
double | BDFMultiplier = 1.0 , |
|||
double | tolerance = 1.0 , |
|||
double | alpha = 1.0 , |
|||
double | beta = 0.5 | |||
) |
Constructor where ATOL is a scalar.
Definition at line 55 of file NOX_StatusTest_NormWRMS.C.
References NOX::StatusTest::Unconverged.
NormWRMS::NormWRMS | ( | double | rtol, | |
const Teuchos::RCP< const NOX::Abstract::Vector > & | atol, | |||
double | BDFMultiplier = 1.0 , |
|||
double | tolerance = 1.0 , |
|||
double | alpha = 1.0 , |
|||
double | beta = 0.5 | |||
) |
NormWRMS::~NormWRMS | ( | ) | [virtual] |
StatusType NormWRMS::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 101 of file NOX_StatusTest_NormWRMS.C.
References achievedTol, alpha, atol, atolIsScalar, atolVec, beta, NOX::Abstract::Vector::clone(), computedStepSize, NOX::StatusTest::Converged, factor, NOX::Solver::Generic::getList(), NOX::Solver::Generic::getNumIterations(), NOX::Solver::Generic::getPreviousSolutionGroup(), NOX::Solver::Generic::getSolutionGroup(), NOX::Abstract::Group::getX(), NOX::StatusTest::None, printCriteria2Info, printCriteria3Info, rtol, NOX::ShapeCopy, status, tolerance, u, NOX::StatusTest::Unconverged, NOX::StatusTest::Unevaluated, v, and value.
StatusType NormWRMS::getStatus | ( | ) | const [virtual] |
Return the result of the most recent checkStatus call.
Implements NOX::StatusTest::Generic.
Definition at line 232 of file NOX_StatusTest_NormWRMS.C.
References status.
ostream & NormWRMS::print | ( | ostream & | stream, | |
int | indent = 0 | |||
) | const [virtual] |
Output formatted description of stopping test to output stream.
Implements NOX::StatusTest::Generic.
Definition at line 238 of file NOX_StatusTest_NormWRMS.C.
References achievedTol, alpha, beta, computedStepSize, printCriteria2Info, printCriteria3Info, NOX::Utils::sciformat(), status, tolerance, and value.
double NormWRMS::getNormWRMS | ( | ) | const [virtual] |
Returns the value of WRMS norm.
Definition at line 261 of file NOX_StatusTest_NormWRMS.C.
References value.
double NormWRMS::getTolerance | ( | ) | const [virtual] |
Returns the requested tolerance set in the constructor.
Definition at line 266 of file NOX_StatusTest_NormWRMS.C.
References tolerance.
double NormWRMS::getRTOL | ( | ) | const [virtual] |
Returns the realative tolerance set in the constructor.
Definition at line 271 of file NOX_StatusTest_NormWRMS.C.
References rtol.
double NormWRMS::getATOL | ( | ) | const [virtual] |
Returns the absolute tolerance set in the constructor. If ATOL is a vector, this will return a value of -1.0.
Definition at line 276 of file NOX_StatusTest_NormWRMS.C.
References atol, and atolIsScalar.
double NormWRMS::getBDFMultiplier | ( | ) | const [virtual] |
Returns the value of the BDFMultiplier set in the constructor.
Definition at line 284 of file NOX_StatusTest_NormWRMS.C.
References factor.
double NormWRMS::getAlpha | ( | ) | const [virtual] |
Returns the value of 'alpha' set in the constructor.
Definition at line 289 of file NOX_StatusTest_NormWRMS.C.
References alpha.
double NormWRMS::getBeta | ( | ) | const [virtual] |
Returns the value of 'beta' set in the constructor.
Definition at line 294 of file NOX_StatusTest_NormWRMS.C.
References beta.
double NOX::StatusTest::NormWRMS::value [private] |
Current value of the WRMS norm (Must be less than 'tolerance' for convergence).
Definition at line 209 of file NOX_StatusTest_NormWRMS.H.
Referenced by checkStatus(), getNormWRMS(), and print().
double NOX::StatusTest::NormWRMS::rtol [private] |
Relative tolerance for convergence.
Definition at line 212 of file NOX_StatusTest_NormWRMS.H.
Referenced by checkStatus(), and getRTOL().
bool NOX::StatusTest::NormWRMS::atolIsScalar [private] |
flag to tell whether atol is a scalar or a vector.
Definition at line 215 of file NOX_StatusTest_NormWRMS.H.
Referenced by checkStatus(), and getATOL().
double NOX::StatusTest::NormWRMS::atol [private] |
Absolute tolerance for convergence (scalar).
Definition at line 218 of file NOX_StatusTest_NormWRMS.H.
Referenced by checkStatus(), and getATOL().
Teuchos::RCP<const NOX::Abstract::Vector> NOX::StatusTest::NormWRMS::atolVec [private] |
Absolute tolerance for convergence (vector).
Definition at line 221 of file NOX_StatusTest_NormWRMS.H.
Referenced by checkStatus().
double NOX::StatusTest::NormWRMS::factor [private] |
Time integration method multiplier (BDF Multiplier).
Definition at line 224 of file NOX_StatusTest_NormWRMS.H.
Referenced by checkStatus(), and getBDFMultiplier().
double NOX::StatusTest::NormWRMS::tolerance [private] |
Required tolerance for the NormWRMS to be declared converged.
Definition at line 227 of file NOX_StatusTest_NormWRMS.H.
Referenced by checkStatus(), getTolerance(), and print().
double NOX::StatusTest::NormWRMS::alpha [private] |
Minimum step size allowed during a line search for WRMS norm to be flagged as converged.
Definition at line 230 of file NOX_StatusTest_NormWRMS.H.
Referenced by checkStatus(), getAlpha(), and print().
double NOX::StatusTest::NormWRMS::computedStepSize [private] |
Actual step size used during line search.
Definition at line 233 of file NOX_StatusTest_NormWRMS.H.
Referenced by checkStatus(), and print().
double NOX::StatusTest::NormWRMS::beta [private] |
Maximum linear solve tolerance allowed for WRMS norm to be flagged as converged.
Definition at line 236 of file NOX_StatusTest_NormWRMS.H.
Referenced by checkStatus(), getBeta(), and print().
double NOX::StatusTest::NormWRMS::achievedTol [private] |
Actual tolerance achieved by the linear solver during the last linear solve.
Definition at line 239 of file NOX_StatusTest_NormWRMS.H.
Referenced by checkStatus(), and print().
StatusType NOX::StatusTest::NormWRMS::status [private] |
Status
Definition at line 242 of file NOX_StatusTest_NormWRMS.H.
Referenced by checkStatus(), getStatus(), and print().
Teuchos::RCP<NOX::Abstract::Vector> NOX::StatusTest::NormWRMS::u [private] |
Temporary vector used in computation.
Definition at line 245 of file NOX_StatusTest_NormWRMS.H.
Referenced by checkStatus().
Teuchos::RCP<NOX::Abstract::Vector> NOX::StatusTest::NormWRMS::v [private] |
Temporary vector used in computation.
Definition at line 248 of file NOX_StatusTest_NormWRMS.H.
Referenced by checkStatus().
bool NOX::StatusTest::NormWRMS::printCriteria2Info [private] |
Flag that tells the print method whether to print the criteria 2 information.
Definition at line 251 of file NOX_StatusTest_NormWRMS.H.
Referenced by checkStatus(), and print().
bool NOX::StatusTest::NormWRMS::printCriteria3Info [private] |
Flag that tells the print method whether to print the criteria 3 information.
Definition at line 254 of file NOX_StatusTest_NormWRMS.H.
Referenced by checkStatus(), and print().