51int main(
int argc,
char* argv[])
69 myPL.
set(
"Max Iters", 1550,
"Determines the maximum number of iterations in the solver");
70 myPL.
set(
"Tolerance", 1e-10,
"The tolerance used for the convergence check");
84 ,
"The type of solver to use"
92 myPL.
set(
"Tolerance",
as<float>(1e-10),
"The tolerance used for the convergence check");
101 "The initial guess as a RCP to an array object.");
108 "Sublist that defines the preconditioner.");
111 Prec_List.set(
"Type",
"ILU",
"The tpye of preconditioner to use");
112 Prec_List.set(
"Drop Tolerance", 1e-3,
113 "The tolerance below which entries from the\n""factorization are left out of the factors.");
117 bool solver_defined =
false, prec_defined =
false, dtol_double =
false;
121 prec_defined = myPL.
isSublist(
"Preconditioner");
124 bool tol_double =
false;
125 tol_double = myPL.INVALID_TEMPLATE_QUALIFIER isType<double>(
"Tolerance");
134 its = myPL.
get(
"Max Iters", 1200);
138 tol = myPL.
get<
float>(
"Tolerance");
142 solver = solverValidator->validateString(
149 std::cout <<
"\n# Printing this parameter list using opeator<<(...) ...\n\n";
150 std::cout << myPL << std::endl;
152 std::cout <<
"\n# Printing the parameter list only showing documentation fields ...\n\n";
153 myPL.
print(std::cout,
161 std::cout <<
"\n# Showing unused parameters ...\n\n";
167 return ( success ? EXIT_SUCCESS : EXIT_FAILURE );
Templated array class derived from the STL std::vector.
Templated Parameter List class.
#define TEUCHOS_STANDARD_CATCH_STATEMENTS(VERBOSE, ERR_STREAM, SUCCESS_FLAG)
Simple macro that catches and reports standard exceptions and other exceptions.
Definition of Teuchos::as, for conversions between types.
Replacement for std::vector that is compatible with the Teuchos Memory Management classes.
Utility class for setting and passing in print options.
A list of parameters of arbitrary type.
void unused(std::ostream &os) const
Print out unused parameters in the ParameterList.
ParameterList & sublist(const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
Creates an empty sublist and returns a reference to the sublist name. If the list already exists,...
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
Set a parameter whose value has type T.
void print() const
Print function to use in debugging in a debugger.
bool isSublist(const std::string &name) const
Whether the given sublist exists in this list.
bool isParameter(const std::string &name) const
Whether the given parameter exists in this list.
T & get(const std::string &name, T def_value)
Return the parameter's value, or the default value if it is not there.
Smart reference counting pointer class for automatic garbage collection.
Replacement for std::vector that is compatible with the Teuchos Memory Management classes.
A list of parameters of arbitrary type.
bool isParameterType(ParameterList &l, const std::string &name)
A templated helper function for determining the type of a parameter entry for a non-const list....
T & getParameter(ParameterList &l, const std::string &name)
A templated helper function for getting a parameter from a non-const list. This helper function preve...
Smart reference counting pointer class for automatic garbage collection.
Standard implementation of a ParameterEntryValidator that maps from a list of strings to an enum or i...
Tuple< T, 1 > tuple(const T &a)
Create a Tuple<T,1>.
TypeTo as(const TypeFrom &t)
Convert from one value type to another.
#define TEUCHOS_ASSERT_EQUALITY(val1, val2)
This macro is checks that to numbers are equal and if not then throws an exception with a good error ...
TypeTo as(const TypeFrom &t)
Convert from one value type to another.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.
std::string Teuchos_Version()