10 #ifndef ROL_KRYLOVFACTORY_H
11 #define ROL_KRYLOVFACTORY_H
13 #include "ROL_Ptr.hpp"
45 std::string retString;
47 case KRYLOV_CG: retString =
"Conjugate Gradients";
break;
48 case KRYLOV_CR: retString =
"Conjugate Residuals";
break;
53 case KRYLOV_LAST: retString =
"Last Type (Dummy)";
break;
54 default: retString =
"INVALID EKrylov";
74 return type =
static_cast<EKrylov>(type+1);
84 return type =
static_cast<EKrylov>(type-1);
105 Real em4(1e-4), em2(1e-2);
107 parlist.sublist(
"General").sublist(
"Krylov").get(
"Type",
"GMRES"));
108 Real absTol = parlist.sublist(
"General").sublist(
"Krylov").get(
"Absolute Tolerance", em4);
109 Real relTol = parlist.sublist(
"General").sublist(
"Krylov").get(
"Relative Tolerance", em2);
110 int maxit = parlist.sublist(
"General").sublist(
"Krylov").get(
"Iteration Limit", 20);
111 bool inexact = parlist.sublist(
"General").get(
"Inexact Hessian-Times-A-Vector",
false);
114 return makePtr<ConjugateResiduals<Real>>(absTol,relTol,maxit,inexact);
116 return makePtr<ConjugateGradients<Real>>(absTol,relTol,maxit,inexact);
118 return makePtr<GMRES<Real>>(parlist);
120 return makePtr<MINRES<Real>>(absTol,relTol,maxit,inexact);
122 return makePtr<BiCGSTAB<Real>>(absTol,relTol,maxit,inexact);
EPolyProjAlgo & operator++(EPolyProjAlgo &type)
Contains definitions of custom data types in ROL.
std::string removeStringFormat(std::string s)
EKrylov
Enumeration of Krylov methods.
EKrylov StringToEKrylov(std::string s)
EPolyProjAlgo & operator--(EPolyProjAlgo &type)
Ptr< Krylov< Real > > KrylovFactory(ParameterList &parlist)
std::string EKrylovToString(EKrylov type)
int isValidKrylov(EKrylov type)
Verifies validity of a Krylov enum.