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

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

#include <NOX_StatusTest_Factory.H>

Public Member Functions

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

Related Functions

(Note that these are not member functions.)

Teuchos::RCP
< NOX::StatusTest::Generic
buildStatusTests (const std::string &file_name, const NOX::Utils &utils, std::map< std::string, Teuchos::RCP< NOX::StatusTest::Generic > > *tagged_tests=0)
 Nonmember helper function for the NOX::StatusTest::Factory.
 
Teuchos::RCP
< NOX::StatusTest::Generic
buildStatusTests (Teuchos::ParameterList &p, const NOX::Utils &utils, std::map< std::string, Teuchos::RCP< NOX::StatusTest::Generic > > *tagged_tests=0)
 Nonmember helper function for the NOX::StatusTest::Factory.
 
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)
 Nonmember helper function for the NOX::StatusTest::Factory.
 
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)
 Nonmember helper function for the NOX::StatusTest::Factory.
 

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 NOX::Solver 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 (NOX::StatusTest::Combo):

Additional parameters valid for a Norm F test (NOX::StatusTest::NormF):

Additional parameters valid for a Norm Update test (NOX::StatusTest::NormUpdate):

Additional parameters valid for a Norm WRMS test (NOX::StatusTest::NormWRMS):

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

Additional parameters valid for a Finite Value test (NOX::StatusTest::FiniteValue):

Additional parameters valid for a Divergence test (NOX::StatusTest::Divergence):

Additional parameters valid for a Stagnation test (NOX::StatusTest::Stagnation):

Additional parameters valid for a RelativeNormF test (NOX::StatusTest::RelativeNormF):

Additional parameters valid for a NStep test (NOX::StatusTest::NStep):

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
Roger Pawlowski (SNL 1416)

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