NOX  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | List of all members
LOCA::StatusTest::Factory Class Reference

Factory to build a set of status tests from a parameter list. More...

#include <LOCA_StatusTest_Factory.H>

Public Member Functions

 Factory ()
 Constructor.
 
virtual ~Factory ()
 Destructor.
 
Teuchos::RCP
< LOCA::StatusTest::Abstract
buildStatusTests (const std::string &file_name, const Teuchos::RCP< const LOCA::GlobalData > &globalData, std::map< std::string, Teuchos::RCP< LOCA::StatusTest::Abstract > > *tagged_tests=0) const
 Returns a status test set from a parameter list xml file.
 
Teuchos::RCP
< LOCA::StatusTest::Abstract
buildStatusTests (Teuchos::ParameterList &p, const Teuchos::RCP< const LOCA::GlobalData > &globalData, std::map< std::string, Teuchos::RCP< LOCA::StatusTest::Abstract > > *tagged_tests=0) const
 Returns a status test set from a parameter list.
 

Detailed Description

Factory to build a set of status tests from a parameter list.

This object takes either an XML file name or a Teuchos::ParameterList and generates an entire set (a tree) of status tests for use in a LOCA::Stepper derived object.

The tagged_tests field in the constructors allows users to store tests from the tree in a flat list in case they want to change the tolerance values during a run. The tagged_tests flag is optional.

Please use the related nonmember functions instead of calling the factory directly (See example below).

Valid parameters are as follows:

Additional parameters valid for a Combo test (LOCA::StatusTest::Combo):

Additional parameters valid for a Maximum Iterations test (NOX::StatusTest::MaxIters):

Additional parameters valid for a "User Defined" test:

Example usage:

stl.set("Test Type", "Combo");
stl.set("Combo Type", "OR");
stl.set("Number of Tests", 5);
Teuchos::ParameterList& conv = stl.sublist("Test 0");
Teuchos::ParameterList& fv = stl.sublist("Test 1");
Teuchos::ParameterList& divergence = stl.sublist("Test 2");
Teuchos::ParameterList& stagnation = stl.sublist("Test 3");
Teuchos::ParameterList& maxiters = stl.sublist("Test 4");
conv.set("Test Type", "Combo");
conv.set("Combo Type", "AND");
conv.set("Number of Tests", 4);
Teuchos::ParameterList& normF = conv.sublist("Test 0");
Teuchos::ParameterList& normWRMS = conv.sublist("Test 1");
Teuchos::ParameterList& normUpdate = conv.sublist("Test 2");
Teuchos::ParameterList& userDefined = conv.sublist("Test 3");
normF.set("Test Type", "NormF");
normF.set("Tolerance", 1.0e-12);
normF.set("Norm Type", "Two Norm");
normF.set("Scale Type", "Unscaled");
normWRMS.set("Test Type", "NormWRMS");
normWRMS.set("Absolute Tolerance", 1.0e-8);
normWRMS.set("Relative Tolerance", 1.0e-5);
normWRMS.set("Tolerance", 1.0);
normWRMS.set("BDF Multiplier", 1.0);
normWRMS.set("Alpha", 1.0);
normWRMS.set("Beta", 0.5);
normUpdate.set("Test Type", "NormUpdate");
normUpdate.set("Norm Type", "One Norm");
normUpdate.set("Scale Type", "Scaled");
userDefined.set("Test Type", "User Defined");
Teuchos::rcp(new MyTest(1.0e-3));
userDefined.set("User Status Test", myTest);
fv.set("Test Type", "FiniteValue");
fv.set("Vector Type", "F Vector");
fv.set("Norm Type", "Two Norm");
divergence.set("Test Type", "Divergence");
divergence.set("Tolerance", 1.0e+20);
divergence.set("Consecutive Iterations", 3);
stagnation.set("Test Type", "Stagnation");
stagnation.set("Tolerance", 1.0);
stagnation.set("Consecutive Iterations", 5);
maxiters.set("Test Type", "MaxIters");
maxiters.set("Maximum Iterations", 20);
NOX::StatusTest::buildStatusTests(stl, utils);
Author
Nico Schloemer

The documentation for this class was generated from the following files: