50 int main(
int argc,
char* argv[])
65 myPL.set(
"Max Iters", 1550,
"Determines the maximum number of iterations in the solver");
66 myPL.set(
"Tolerance", 1e-10,
"The tolerance used for the convergence check");
70 RCP<Teuchos::StringToIntegralParameterEntryValidator<int> >
73 Teuchos::tuple<std::string>(
"GMRES",
"CG",
"TFQMR" )
80 ,
"The type of solver to use" 88 myPL.set(
"Tolerance", as<float>(1e-10),
"The tolerance used for the convergence check");
96 myPL.set<Array<double> >(
"Initial Guess", tuple<double>( 10, 0.0 ),
97 "The initial guess as a RCP to an array object.");
103 ParameterList& Prec_List = myPL.sublist(
"Preconditioner",
false,
104 "Sublist that defines the preconditioner.");
107 Prec_List.set(
"Type",
"ILU",
"The tpye of preconditioner to use");
108 Prec_List.set(
"Drop Tolerance", 1e-3,
109 "The tolerance below which entries from the\n""factorization are left out of the factors.");
113 bool solver_defined =
false, prec_defined =
false, dtol_double =
false;
114 solver_defined = myPL.isParameter(
"Solver");
117 prec_defined = myPL.isSublist(
"Preconditioner");
120 bool tol_double =
false;
121 tol_double = myPL.INVALID_TEMPLATE_QUALIFIER isType<double>(
"Tolerance");
124 dtol_double = Teuchos::isParameterType<double>(Prec_List,
"Drop Tolerance");
130 its = myPL.get(
"Max Iters", 1200);
134 tol = myPL.get<
float>(
"Tolerance");
138 solver = solverValidator->validateString(
139 Teuchos::getParameter<std::string>(myPL,
"Solver")
143 Array<double> init_guess = myPL.get<Array<double> >(
"Initial Guess");
145 std::cout <<
"\n# Printing this parameter list using opeator<<(...) ...\n\n";
146 std::cout << myPL << std::endl;
148 std::cout <<
"\n# Printing the parameter list only showing documentation fields ...\n\n";
149 myPL.print(std::cout,
150 ParameterList::PrintOptions().showDoc(
true).indent(2).showTypes(
true));
157 std::cout <<
"\n# Showing unused parameters ...\n\n";
158 myPL.unused( std::cout );
int main(int argc, char *argv[])
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.
Templated Parameter List class.
std::string Teuchos_Version()
A list of parameters of arbitrary type.
TypeTo as(const TypeFrom &t)
Convert from one value type to another.
Templated array class derived from the STL std::vector.
Smart reference counting pointer class for automatic garbage collection.
#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 ...
Definition of Teuchos::as, for conversions between types.
Memory-safe templated array class that encapsulates std::vector.