43 #include "Teuchos_ParameterList.hpp" 55 if (canonicalName ==
"BLOCK GMRES") {
58 else if (canonicalName ==
"PSEUDOBLOCK GMRES") {
61 else if (canonicalName ==
"BLOCK CG") {
64 else if (canonicalName ==
"PSEUDOBLOCK CG") {
67 else if (canonicalName ==
"PSEUDOBLOCK STOCHASTIC CG") {
70 else if (canonicalName ==
"GCRODR") {
73 else if (canonicalName ==
"RCG") {
76 else if (canonicalName ==
"MINRES") {
79 else if (canonicalName ==
"LSQR") {
82 else if (canonicalName ==
"TFQMR") {
85 else if (canonicalName ==
"PSEUDOBLOCK TFQMR") {
88 else if (canonicalName ==
"HYBRID BLOCK GMRES") {
91 else if (canonicalName ==
"PCPG") {
94 else if (canonicalName ==
"FIXED POINT") {
97 else if (canonicalName ==
"BICGSTAB") {
106 std::pair<std::string, bool>
118 if (candidateAlias ==
"GMRES") {
119 return std::make_pair (std::string (
"PSEUDOBLOCK GMRES"),
true);
121 else if (candidateAlias ==
"BLOCK GMRES") {
122 return std::make_pair (std::string (
"BLOCK GMRES"),
true);
124 else if (candidateAlias ==
"FLEXIBLE GMRES") {
125 return std::make_pair (std::string (
"BLOCK GMRES"),
true);
127 else if (candidateAlias ==
"CG") {
128 return std::make_pair (std::string (
"PSEUDOBLOCK CG"),
true);
130 else if (candidateAlias ==
"PSEUDOBLOCKCG") {
131 return std::make_pair (std::string (
"PSEUDOBLOCK CG"),
true);
133 else if (candidateAlias ==
"STOCHASTIC CG") {
134 return std::make_pair (std::string (
"PSEUDOBLOCK STOCHASTIC CG"),
true);
136 else if (candidateAlias ==
"RECYCLING CG") {
137 return std::make_pair (std::string (
"RCG"),
true);
139 else if (candidateAlias ==
"RECYCLING GMRES") {
140 return std::make_pair (std::string (
"GCRODR"),
true);
143 else if (candidateAlias ==
"PSEUDO BLOCK GMRES") {
144 return std::make_pair (std::string (
"PSEUDOBLOCK GMRES"),
true);
146 else if (candidateAlias ==
"PSEUDOBLOCKGMRES") {
147 return std::make_pair (std::string (
"PSEUDOBLOCK GMRES"),
true);
149 else if (candidateAlias ==
"PSEUDO BLOCK CG") {
150 return std::make_pair (std::string (
"PSEUDOBLOCK CG"),
true);
152 else if (candidateAlias ==
"PSEUDOBLOCKCG") {
153 return std::make_pair (std::string (
"PSEUDOBLOCK CG"),
true);
155 else if (candidateAlias ==
"TRANSPOSE-FREE QMR") {
156 return std::make_pair (std::string (
"TFQMR"),
true);
158 else if (candidateAlias ==
"PSEUDO BLOCK TFQMR") {
159 return std::make_pair (std::string (
"PSEUDOBLOCK TFQMR"),
true);
161 else if (candidateAlias ==
"PSEUDO BLOCK TRANSPOSE-FREE QMR") {
162 return std::make_pair (std::string (
"PSEUDOBLOCK TFQMR"),
true);
164 else if (candidateAlias ==
"GMRESPOLY") {
165 return std::make_pair (std::string (
"HYBRID BLOCK GMRES"),
true);
167 else if (candidateAlias ==
"SEED GMRES") {
168 return std::make_pair (std::string (
"HYBRID BLOCK GMRES"),
true);
170 else if (candidateAlias ==
"CGPOLY") {
171 return std::make_pair (std::string (
"PCPG"),
true);
173 else if (candidateAlias ==
"SEED CG") {
174 return std::make_pair (std::string (
"PCPG"),
true);
176 else if (candidateAlias ==
"FIXED POINT") {
177 return std::make_pair (std::string (
"FIXED POINT"),
true);
179 else if (candidateAlias ==
"BICGSTAB") {
180 return std::make_pair (std::string (
"BICGSTAB"),
true);
183 return std::make_pair (candidateAlias,
false);
187 std::vector<std::string>
190 #ifdef HAVE_TEUCHOSCORE_CXX11 200 {
"PSEUDO BLOCK GMRES"},
201 {
"PSEUDOBLOCKGMRES"},
204 {
"TRANSPOSE-FREE QMR"},
205 {
"PSEUDO BLOCK TFQMR"},
206 {
"PSEUDO BLOCK TRANSPOSE-FREE QMR"},
214 #else // NOT HAVE_TEUCHOSCORE_CXX11 215 std::vector<std::string> names;
217 names.push_back (
"GMRES");
218 names.push_back (
"BLOCK GMRES");
219 names.push_back (
"FLEXIBLE GMRES");
220 names.push_back (
"CG");
221 names.push_back (
"PSEUDOBLOCKCG");
222 names.push_back (
"STOCHASTIC CG");
223 names.push_back (
"RECYCLING CG");
224 names.push_back (
"RECYCLING GMRES");
225 names.push_back (
"PSEUDO BLOCK GMRES");
226 names.push_back (
"PSEUDOBLOCKGMRES");
227 names.push_back (
"PSEUDO BLOCK CG");
228 names.push_back (
"PSEUDOBLOCKCG");
229 names.push_back (
"TRANSPOSE-FREE QMR");
230 names.push_back (
"PSEUDO BLOCK TFQMR");
231 names.push_back (
"PSEUDO BLOCK TRANSPOSE-FREE QMR");
232 names.push_back (
"GMRESPOLY");
233 names.push_back (
"SEED GMRES");
234 names.push_back (
"CGPOLY");
235 names.push_back (
"SEED CG");
236 names.push_back (
"FIXED POINT");
237 names.push_back (
"BICGSTAB");
240 #endif // HAVE_TEUCHOSCORE_CXX11 247 std::vector<std::string>
250 #ifdef HAVE_TEUCHOSCORE_CXX11 253 {
"PSEUDOBLOCK GMRES"},
256 {
"PSEUDOBLOCK STOCHASTIC CG"},
262 {
"PSEUDOBLOCK TFQMR"},
263 {
"HYBRID BLOCK GMRES"},
271 canonicalNames.push_back (
"BLOCK GMRES");
272 canonicalNames.push_back (
"PSEUDOBLOCK GMRES");
273 canonicalNames.push_back (
"BLOCK CG");
274 canonicalNames.push_back (
"PSEUDOBLOCK CG");
275 canonicalNames.push_back (
"PSEUDOBLOCK STOCHASTIC CG");
276 canonicalNames.push_back (
"GCRODR");
277 canonicalNames.push_back (
"RCG");
278 canonicalNames.push_back (
"MINRES");
279 canonicalNames.push_back (
"LSQR");
280 canonicalNames.push_back (
"TFQMR");
281 canonicalNames.push_back (
"PSEUDOBLOCK TFQMR");
282 canonicalNames.push_back (
"HYBRID BLOCK GMRES");
283 canonicalNames.push_back (
"PCPG");
284 canonicalNames.push_back (
"FIXED POINT");
285 canonicalNames.push_back (
"BICGSTAB");
287 return canonicalNames;
288 #endif // HAVE_TEUCHOSCORE_CXX11 293 Teuchos::ParameterList& solverParams)
295 if (aliasName ==
"FLEXIBLE GMRES") {
299 solverParams.set (
"Flexible Gmres",
true);
EBelosSolverType getEnumFromCanonicalName(const std::string &canonicalName)
Map from canonical solver name to solver enum value.
Declaration of Belos::Details::EBelosSolverType enum, and associated functions.
std::vector< std::string > solverNameAliases()
List of supported aliases (to canonical solver names).
EBelosSolverType
1-to-1 enumeration of all supported SolverManager subclasses.
int numSupportedSolvers()
Number of Belos solvers supported for any linear algebra implementation ("generically").
std::pair< std::string, bool > getCanonicalNameFromAlias(const std::string &candidateAlias)
Get the candidate canonical name for a given candidate alias.
void reviseParameterListForAlias(const std::string &aliasName, Teuchos::ParameterList &solverParams)
Modify the input ParameterList appropriately for the given solver alias.
std::vector< std::string > canonicalSolverNames()
List of canonical solver names.