NOX
Development
|
Arbitrary combination of status tests. More...
#include <NOX_StatusTest_Combo.H>
Public Types | |
enum | ComboType { AND, OR } |
The test can be either the AND of all the component tests, or the OR of all the component tests. More... | |
Public Member Functions | |
Combo (ComboType t, const NOX::Utils *u=NULL) | |
Constructor. Optional argument is the error stream for output. | |
Combo (ComboType t, const Teuchos::RCP< Generic > &a, const NOX::Utils *u=NULL) | |
Constructor with a single test. | |
Combo (ComboType t, const Teuchos::RCP< Generic > &a, const Teuchos::RCP< Generic > &b, const NOX::Utils *u=NULL) | |
Constructor with two tests. | |
virtual Combo & | addStatusTest (const Teuchos::RCP< Generic > &a) |
Add another test to this combination. More... | |
virtual | ~Combo () |
Destructor. | |
virtual StatusType | checkStatus (const NOX::Solver::Generic &problem, NOX::StatusTest::CheckType checkType) |
Tests stopping criterion. More... | |
virtual StatusType | getStatus () const |
Return the result of the most recent checkStatus call. | |
virtual std::ostream & | print (std::ostream &stream, int indent=0) const |
Output formatted description of stopping test to output stream. | |
Public Member Functions inherited from NOX::StatusTest::Generic | |
Generic () | |
Constructor. | |
virtual | ~Generic () |
Destructor. | |
Protected Member Functions | |
virtual void | orOp (const Solver::Generic &problem, NOX::StatusTest::CheckType checkType) |
Use this for checkStatus when this is an OR type combo. Updates NOX::StatusTest::Combo::status. More... | |
virtual void | andOp (const Solver::Generic &problem, NOX::StatusTest::CheckType checkType) |
Use this for checkStatus when this is an AND type combo. Updates NOX::StatusTest::Combo::status. More... | |
bool | isSafe (Generic &a) |
Check whether or not it is safe to add a to this list of tests. More... | |
Arbitrary combination of status tests.
In the AND
(see NOX::StatusTest::Combo::ComboType) combination, the result is Unconverged
(see NOX::StatusTest::StatusType) if any of the tests is Unconverged
. Otherwise, the result is equal to the result of the first test in the list that is either Converged
or Failed
. It is not recommended to mix Converged
and Failed
tests in an AND
combination.
In the OR
combination, the result is Unconverged
if all of the tests are Unconverged
. Otherwise, it is the result of the first test in the list that is either Converged
or Failed
. Therefore, it will generally make sense to put the Failed
-type tests at the end of the OR
list.
|
virtual |
Add another test to this combination.
Calls isSafe() to determine if it is safe to add a
to the combination.
References Teuchos::RCP< T >::get(), and NOX::StatusTest::Generic::print().
Referenced by Combo(), and NOX::Petsc::Options::setOptions().
|
protectedvirtual |
Use this for checkStatus when this is an AND type combo. Updates NOX::StatusTest::Combo::status.
If any tests are NOX::StatusTest::Unconverged, then the status of this test is NOX::StatusTest::Unconverged. If there is a combination of NOX::StatusTest::Failed and NOX::StatusTest::Converged in the tests that are AND'd together, the value of status for this test is set to the status of the first test it encounters. The tests are evaluated in the order that they were added to the combination.
References NOX::StatusTest::Minimal, NOX::StatusTest::None, NOX::StatusTest::Unconverged, and NOX::StatusTest::Unevaluated.
|
virtual |
|
protected |
|
protectedvirtual |
Use this for checkStatus when this is an OR type combo. Updates NOX::StatusTest::Combo::status.
If there is a combination of NOX::StatusTest::Failed and NOX::StatusTest::Converged in the tests that are OR'd together, the value of status for this test is set to the status of the first test it encounters which is not NOX::Status::Unconvered. The tests are evaluated in the order that they were added to the combination.
References NOX::StatusTest::Minimal, NOX::StatusTest::None, NOX::StatusTest::Unconverged, and NOX::StatusTest::Unevaluated.