NOX
Development
|
Arbitrary combination of status tests. More...
#include <LOCA_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 Teuchos::RCP< const LOCA::GlobalData > globalDataPtr=Teuchos::null) | |
Constructor. Optional argument is the error stream for output. | |
Combo (ComboType t, const Teuchos::RCP< Abstract > &a, const Teuchos::RCP< const LOCA::GlobalData > globalDataPtr=Teuchos::null) | |
Constructor with a single test. | |
Combo (ComboType t, const Teuchos::RCP< Abstract > &a, const Teuchos::RCP< Abstract > &b, const Teuchos::RCP< const LOCA::GlobalData > globalDataPtr=Teuchos::null) | |
Constructor with two tests. | |
virtual Combo & | addStatusTest (const Teuchos::RCP< Abstract > &a) |
Add another test to this combination. More... | |
virtual | ~Combo () |
Destructor. | |
virtual LOCA::StatusTest::StatusType | checkStatus (const LOCA::Abstract::Iterator &stepper, LOCA::StatusTest::CheckType checkType) |
Tests stopping criterion. More... | |
virtual LOCA::StatusTest::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 LOCA::StatusTest::Abstract | |
Abstract () | |
Constructor. | |
virtual | ~Abstract () |
Destructor. | |
Protected Member Functions | |
virtual void | orOp (const LOCA::Abstract::Iterator &stepper, LOCA::StatusTest::CheckType checkType) |
Use this for checkStatus when this is an OR type combo. Updates LOCA::StatusTest::Combo::status. More... | |
virtual void | andOp (const LOCA::Abstract::Iterator &stepper, LOCA::StatusTest::CheckType checkType) |
Use this for checkStatus when this is an AND type combo. Updates LOCA::StatusTest::Combo::status. More... | |
bool | isSafe (Abstract &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 LOCA::StatusTest::Combo::ComboType) combination, the result is Unconverged
(see LOCA::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 LOCA::StatusTest::Abstract::print().
Referenced by Combo().
|
protectedvirtual |
Use this for checkStatus when this is an AND type combo. Updates LOCA::StatusTest::Combo::status.
If any tests are LOCA::StatusTest::Unconverged, then the status of this test is LOCA::StatusTest::Unconverged. If there is a combination of LOCA::StatusTest::Failed and LOCA::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 LOCA::StatusTest::Minimal, LOCA::StatusTest::None, LOCA::StatusTest::NotFinished, and LOCA::StatusTest::Unevaluated.
|
virtual |
Tests stopping criterion.
See addOp() and orOp() for details.
Implements LOCA::StatusTest::Abstract.
|
protected |
|
protectedvirtual |
Use this for checkStatus when this is an OR type combo. Updates LOCA::StatusTest::Combo::status.
If there is a combination of LOCA::StatusTest::Failed and LOCA::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 LOCA::Status::Unconverged. The tests are evaluated in the order that they were added to the combination.
References LOCA::StatusTest::Minimal, LOCA::StatusTest::None, LOCA::StatusTest::NotFinished, and LOCA::StatusTest::Unevaluated.