11 #if defined(HAVE_MUELU_ML)
12 #include <ml_config.h>
13 #if defined(HAVE_ML_EPETRA) && defined(HAVE_ML_TEUCHOS)
14 #include <ml_ValidateParameters.h>
15 #include <ml_MultiLevelPreconditioner.h>
16 #include <ml_RefMaxwell.h>
26 TEUCHOS_TEST_FOR_EXCEPTION(pname !=
"coarse: type" && pname !=
"coarse: list" && pname !=
"smoother: type" && pname.find(
"smoother: list", 0) != 0,
28 "MueLu::MLParameterListInterpreter::Setup(): Only \"coarse: type\", \"smoother: type\" or \"smoother: list\" (\"coarse: list\") are "
29 "supported as ML parameters for transformation of smoother/solver parameters to MueLu");
32 std::stringstream mueluss;
35 std::string mode =
"smoother:";
36 bool is_coarse =
false;
37 if (pname.find(
"coarse:", 0) == 0) {
45 PreOrPost = paramList.
get<std::string>(mode +
" pre or post");
48 "MueLu::MLParameterListInterpreter::Setup(): The parameter \"coarse: pre or post\" is not supported by MueLu. "
49 "It does not make sense for direct solvers. For iterative solvers you obtain the same effect by increasing, "
50 "e.g., the number of sweeps for the coarse grid smoother. Please remove it from your parameters.");
53 std::string valuestr = value;
54 std::transform(valuestr.begin(), valuestr.end(), valuestr.begin(),
::tolower);
55 if (valuestr ==
"jacobi" || valuestr ==
"gauss-seidel" || valuestr ==
"symmetric gauss-seidel") {
57 if (PreOrPost ==
"both")
58 my_name =
"\"" + pname +
"\"";
60 my_name =
"\"smoother: " + PreOrPost +
" type\"";
61 mueluss <<
"<Parameter name=" << my_name <<
" type=\"string\" value=\"RELAXATION\"/>" << std::endl;
63 }
else if (valuestr ==
"hiptmair") {
65 if (PreOrPost ==
"both")
66 my_name =
"\"" + pname +
"\"";
68 my_name =
"\"smoother: " + PreOrPost +
" type\"";
69 mueluss <<
"<Parameter name=" << my_name <<
" type=\"string\" value=\"HIPTMAIR\"/>" << std::endl;
71 }
else if (valuestr ==
"ifpack") {
72 std::string my_name =
"\"" + pname +
"\"";
73 if (paramList.
isParameter(
"smoother: ifpack type")) {
74 if (paramList.
get<std::string>(
"smoother: ifpack type") ==
"ILU") {
75 mueluss <<
"<Parameter name=" << my_name <<
" type=\"string\" value=\"ILU\"/>" << std::endl;
76 adaptingParamList.
remove(
"smoother: ifpack type",
false);
78 if (paramList.
get<std::string>(
"smoother: ifpack type") ==
"ILUT") {
79 mueluss <<
"<Parameter name=" << my_name <<
" type\" type=\"string\" value=\"ILUT\"/>" << std::endl;
80 adaptingParamList.
remove(
"smoother: ifpack type",
false);
84 }
else if ((valuestr ==
"chebyshev") || (valuestr ==
"mls")) {
85 std::string my_name =
"\"" + pname +
"\"";
86 mueluss <<
"<Parameter name=" << my_name <<
" type=\"string\" value=\"CHEBYSHEV\"/>" << std::endl;
88 }
else if (valuestr.length() > strlen(
"amesos") && valuestr.substr(0, strlen(
"amesos")) ==
"amesos") {
89 std::string solverType = valuestr.substr(strlen(
"amesos") + 1);
92 const int validatorSize = 5;
93 std::string validator[validatorSize] = {
"superlu",
"superludist",
"klu",
"umfpack",
"mumps"};
94 for (
int i = 0; i < validatorSize; i++)
95 if (validator[i] == solverType)
98 "MueLu::MLParameterListInterpreter: unknown smoother type. '" << solverType <<
"' not supported.");
100 mueluss <<
"<Parameter name=\"" << pname <<
"\" type=\"string\" value=\"" << solverType <<
"\"/>" << std::endl;
104 std::cout <<
"error in " << __FILE__ <<
":" << __LINE__ <<
" could not find valid smoother/solver" << std::endl;
109 if (paramList.
isParameter(
"smoother: pre or post") && mode ==
"smoother:") {
113 mueluss <<
"<Parameter name=\"smoother: pre or post\" type=\"string\" value=\"" << PreOrPost <<
"\"/>" << std::endl;
114 adaptingParamList.
remove(
"smoother: pre or post",
false);
118 if (PreOrPost !=
"both") {
119 mueluss <<
"<ParameterList name=\"smoother: " << PreOrPost <<
" params\">" << std::endl;
121 mueluss <<
"<ParameterList name=\"" << mode <<
" params\">" << std::endl;
126 if (valuestr ==
"jacobi" || valuestr ==
"gauss-seidel" || valuestr ==
"symmetric gauss-seidel") {
127 if (valuestr ==
"jacobi") {
128 mueluss <<
"<Parameter name=\"relaxation: type\" type=\"string\" value=\"Jacobi\"/>" << std::endl;
129 adaptingParamList.
remove(
"relaxation: type",
false);
131 if (valuestr ==
"gauss-seidel") {
132 mueluss <<
"<Parameter name=\"relaxation: type\" type=\"string\" value=\"Gauss-Seidel\"/>" << std::endl;
133 adaptingParamList.
remove(
"relaxation: type",
false);
135 if (valuestr ==
"symmetric gauss-seidel") {
136 mueluss <<
"<Parameter name=\"relaxation: type\" type=\"string\" value=\"Symmetric Gauss-Seidel\"/>" << std::endl;
137 adaptingParamList.
remove(
"relaxation: type",
false);
141 mueluss <<
"<Parameter name=\"relaxation: sweeps\" type=\"int\" value=\"" << paramList.
get<
int>(
"smoother: sweeps") <<
"\"/>" << std::endl;
142 adaptingParamList.
remove(
"smoother: sweeps",
false);
144 if (paramList.
isParameter(
"smoother: damping factor")) {
145 mueluss <<
"<Parameter name=\"relaxation: damping factor\" type=\"double\" value=\"" << paramList.
get<
double>(
"smoother: damping factor") <<
"\"/>" << std::endl;
146 adaptingParamList.
remove(
"smoother: damping factor",
false);
148 if (paramList.
isParameter(
"smoother: use l1 Gauss-Seidel")) {
149 mueluss <<
"<Parameter name=\"relaxation: use l1\" type=\"bool\" value=\"" << paramList.
get<
bool>(
"smoother: use l1 Gauss-Seidel") <<
"\"/>" << std::endl;
150 adaptingParamList.
remove(
"smoother: use l1 Gauss-Seidel",
false);
155 if (valuestr ==
"chebyshev") {
156 if (paramList.
isParameter(
"smoother: polynomial order")) {
157 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"" << paramList.
get<
int>(
"smoother: polynomial order") <<
"\"/>" << std::endl;
158 adaptingParamList.
remove(
"smoother: polynomial order",
false);
160 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"2\"/>" << std::endl;
162 if (paramList.
isParameter(
"smoother: Chebyshev alpha")) {
163 mueluss <<
"<Parameter name=\"chebyshev: ratio eigenvalue\" type=\"double\" value=\"" << paramList.
get<
double>(
"smoother: Chebyshev alpha") <<
"\"/>" << std::endl;
164 adaptingParamList.
remove(
"smoother: Chebyshev alpha",
false);
166 mueluss <<
"<Parameter name=\"chebyshev: ratio eigenvalue\" type=\"double\" value=\"20\"/>" << std::endl;
167 adaptingParamList.
remove(
"smoother: Chebyshev alpha",
false);
169 if (paramList.
isParameter(
"eigen-analysis: type")) {
170 mueluss <<
"<Parameter name=\"eigen-analysis: type\" type=\"string\" value=\"" << paramList.
get<std::string>(
"eigen-analysis: type") <<
"\"/>" << std::endl;
171 adaptingParamList.
remove(
"eigen-analysis: type",
false);
173 mueluss <<
"<Parameter name=\"eigen-analysis: type\" type=\"string\" value=\"cg\"/>" << std::endl;
178 if (valuestr ==
"mls") {
179 if (paramList.
isParameter(
"smoother: MLS polynomial order")) {
180 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"" << paramList.
get<
int>(
"smoother: MLS polynomial order") <<
"\"/>" << std::endl;
181 adaptingParamList.
remove(
"smoother: MLS polynomial order",
false);
182 }
else if (paramList.
isParameter(
"smoother: polynomial order")) {
183 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"" << paramList.
get<
int>(
"smoother: polynomial order") <<
"\"/>" << std::endl;
184 adaptingParamList.
remove(
"smoother: polynomial order",
false);
186 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"2\"/>" << std::endl;
188 if (paramList.
isParameter(
"smoother: MLS alpha")) {
189 mueluss <<
"<Parameter name=\"chebyshev: ratio eigenvalue\" type=\"double\" value=\"" << paramList.
get<
double>(
"smoother: MLS alpha") <<
"\"/>" << std::endl;
190 adaptingParamList.
remove(
"smoother: MLS alpha",
false);
191 }
else if (paramList.
isParameter(
"smoother: Chebyshev alpha")) {
192 mueluss <<
"<Parameter name=\"chebyshev: ratio eigenvalue\" type=\"double\" value=\"" << paramList.
get<
double>(
"smoother: Chebyshev alpha") <<
"\"/>" << std::endl;
193 adaptingParamList.
remove(
"smoother: Chebyshev alpha",
false);
195 mueluss <<
"<Parameter name=\"chebyshev: ratio eigenvalue\" type=\"double\" value=\"20\"/>" << std::endl;
197 if (paramList.
isParameter(
"eigen-analysis: type")) {
198 mueluss <<
"<Parameter name=\"eigen-analysis: type\" type=\"string\" value=\"" << paramList.
get<std::string>(
"eigen-analysis: type") <<
"\"/>" << std::endl;
199 adaptingParamList.
remove(
"eigen-analysis: type",
false);
201 mueluss <<
"<Parameter name=\"eigen-analysis: type\" type=\"string\" value=\"cg\"/>" << std::endl;
205 if (valuestr ==
"hiptmair") {
206 std::string subSmootherType =
"Chebyshev";
207 if (!is_coarse && paramList.
isParameter(
"subsmoother: type"))
208 subSmootherType = paramList.
get<std::string>(
"subsmoother: type");
209 if (is_coarse && paramList.
isParameter(
"smoother: subsmoother type"))
210 subSmootherType = paramList.
get<std::string>(
"smoother: subsmoother type");
212 std::string subSmootherIfpackType;
213 if (subSmootherType ==
"Chebyshev")
214 subSmootherIfpackType =
"CHEBYSHEV";
215 else if (subSmootherType ==
"Jacobi" || subSmootherType ==
"Gauss-Seidel" || subSmootherType ==
"symmetric Gauss-Seidel") {
216 if (subSmootherType ==
"symmetric Gauss-Seidel") subSmootherType =
"Symmetric Gauss-Seidel";
217 subSmootherIfpackType =
"RELAXATION";
221 mueluss <<
"<Parameter name=\"hiptmair: smoother type 1\" type=\"string\" value=\"" << subSmootherIfpackType <<
"\"/>" << std::endl;
222 mueluss <<
"<Parameter name=\"hiptmair: smoother type 2\" type=\"string\" value=\"" << subSmootherIfpackType <<
"\"/>" << std::endl;
224 mueluss <<
"<ParameterList name=\"hiptmair: smoother list 1\">" << std::endl;
225 if (subSmootherType ==
"Chebyshev") {
226 std::string edge_sweeps = is_coarse ?
"smoother: edge sweeps" :
"subsmoother: edge sweeps";
227 std::string cheby_alpha = is_coarse ?
"smoother: Chebyshev alpha" :
"subsmoother: Chebyshev_alpha";
230 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"" << paramList.
get<
int>(edge_sweeps) <<
"\"/>" << std::endl;
231 adaptingParamList.
remove(
"subsmoother: edge sweeps",
false);
234 mueluss <<
"<Parameter name=\"chebyshev: ratio eigenvalue\" type=\"double\" value=\"" << paramList.
get<
double>(cheby_alpha) <<
"\"/>" << std::endl;
237 std::string edge_sweeps = is_coarse ?
"smoother: edge sweeps" :
"subsmoother: edge sweeps";
238 std::string SGS_damping = is_coarse ?
"smoother: SGS damping factor" :
"subsmoother: SGS damping factor";
241 mueluss <<
"<Parameter name=\"relaxation: type\" type=\"string\" value=\"" << subSmootherType <<
"\"/>" << std::endl;
242 mueluss <<
"<Parameter name=\"relaxation: sweeps\" type=\"int\" value=\"" << paramList.
get<
int>(edge_sweeps) <<
"\"/>" << std::endl;
243 adaptingParamList.
remove(edge_sweeps,
false);
246 mueluss <<
"<Parameter name=\"relaxation: damping factor\" type=\"double\" value=\"" << paramList.
get<
double>(SGS_damping) <<
"\"/>" << std::endl;
249 mueluss <<
"</ParameterList>" << std::endl;
251 mueluss <<
"<ParameterList name=\"hiptmair: smoother list 2\">" << std::endl;
252 if (subSmootherType ==
"Chebyshev") {
253 std::string node_sweeps = is_coarse ?
"smoother: node sweeps" :
"subsmoother: node sweeps";
254 std::string cheby_alpha = is_coarse ?
"smoother: Chebyshev alpha" :
"subsmoother: Chebyshev_alpha";
256 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"" << paramList.
get<
int>(node_sweeps) <<
"\"/>" << std::endl;
257 adaptingParamList.
remove(
"subsmoother: node sweeps",
false);
260 mueluss <<
"<Parameter name=\"chebyshev: ratio eigenvalue\" type=\"double\" value=\"" << paramList.
get<
double>(cheby_alpha) <<
"\"/>" << std::endl;
261 adaptingParamList.
remove(
"subsmoother: Chebyshev alpha",
false);
264 std::string node_sweeps = is_coarse ?
"smoother: node sweeps" :
"subsmoother: node sweeps";
265 std::string SGS_damping = is_coarse ?
"smoother: SGS damping factor" :
"subsmoother: SGS damping factor";
268 mueluss <<
"<Parameter name=\"relaxation: type\" type=\"string\" value=\"" << subSmootherType <<
"\"/>" << std::endl;
269 mueluss <<
"<Parameter name=\"relaxation: sweeps\" type=\"int\" value=\"" << paramList.
get<
int>(node_sweeps) <<
"\"/>" << std::endl;
270 adaptingParamList.
remove(
"subsmoother: node sweeps",
false);
273 mueluss <<
"<Parameter name=\"relaxation: damping factor\" type=\"double\" value=\"" << paramList.
get<
double>(SGS_damping) <<
"\"/>" << std::endl;
274 adaptingParamList.
remove(
"subsmoother: SGS damping factor",
false);
277 mueluss <<
"</ParameterList>" << std::endl;
281 if (valuestr ==
"ifpack") {
283 if (paramList.
isParameter(
"smoother: ifpack overlap")) {
284 mueluss <<
"<Parameter name=\"partitioner: overlap\" type=\"int\" value=\"" << paramList.
get<
int>(
"smoother: ifpack overlap") <<
"\"/>" << std::endl;
285 adaptingParamList.
remove(
"smoother: ifpack overlap",
false);
287 if (paramList.
isParameter(
"smoother: ifpack level-of-fill")) {
288 mueluss <<
"<Parameter name=\"fact: level-of-fill\" type=\"int\" value=\"" << paramList.
get<
int>(
"smoother: ifpack level-of-fill") <<
"\"/>" << std::endl;
289 adaptingParamList.
remove(
"smoother: ifpack level-of-fill",
false);
291 if (paramList.
isParameter(
"smoother: ifpack absolute threshold")) {
292 mueluss <<
"<Parameter name=\"fact: absolute threshold\" type=\"int\" value=\"" << paramList.
get<
double>(
"smoother: ifpack absolute threshold") <<
"\"/>" << std::endl;
293 adaptingParamList.
remove(
"smoother: ifpack absolute threshold",
false);
295 if (paramList.
isParameter(
"smoother: ifpack relative threshold")) {
296 mueluss <<
"<Parameter name=\"fact: relative threshold\" type=\"int\" value=\"" << paramList.
get<
double>(
"smoother: ifpack relative threshold") <<
"\"/>" << std::endl;
297 adaptingParamList.
remove(
"smoother: ifpack relative threshold",
false);
301 mueluss <<
"</ParameterList>" << std::endl;
305 mueluss <<
"<Parameter name=\"coarse: max size\" type=\"int\" value=\"" << paramList.
get<
int>(
"smoother: max size") <<
"\"/>" << std::endl;
306 adaptingParamList.
remove(
"smoother: max size",
false);
309 return mueluss.str();
317 #if defined(HAVE_MUELU_ML) && defined(HAVE_ML_EPETRA) && defined(HAVE_ML_TEUCHOS)
321 if (defaultVals !=
"") {
323 "MueLu::MLParameterListInterpreter: only \"SA\", \"NSSA\", \"refmaxwell\" and \"Maxwell\" allowed as options for ML default parameters.");
325 if (defaultVals ==
"refmaxwell")
326 ML_Epetra::SetDefaultsRefMaxwell(ML_defaultlist);
328 ML_Epetra::SetDefaults(defaultVals, ML_defaultlist);
332 paramList = ML_defaultlist;
335 if (defaultVals !=
"") {
337 *out <<
"Warning: MueLu_ENABLE_ML=OFF, ML_ENABLE_Epetra=OFF or ML_ENABLE_TEUCHOS=OFF. No ML default values available." << std::endl;
339 #endif // HAVE_MUELU_ML && HAVE_ML_EPETRA && HAVE_ML_TEUCHOS
350 paramList = paramListWithSubList;
357 bool validate = paramList.
get(
"ML validate parameter list",
true);
358 if (validate && defaultVals !=
"refmaxwell") {
359 #if defined(HAVE_MUELU_ML) && defined(HAVE_ML_EPETRA) && defined(HAVE_ML_TEUCHOS)
361 int depth = paramList.
get(
"ML validate depth", 5);
363 "ERROR: ML's Teuchos::ParameterList contains incorrect parameter!");
366 *out <<
"Warning: MueLu_ENABLE_ML=OFF, ML_ENABLE_Epetra=OFF or ML_ENABLE_TEUCHOS=OFF. The parameter list cannot be validated." << std::endl;
367 paramList.
set(
"ML validate parameter list",
false);
369 #endif // HAVE_MUELU_ML && HAVE_ML_EPETRA && HAVE_ML_TEUCHOS
382 if (paramListWithSubList.
isParameter(
"aggregation: aux: enable") && paramListWithSubList.
get<
bool>(
"aggregation: aux: enable")) {
383 if (paramListWithSubList.
isParameter(
"aggregation: aux: threshold")) {
384 paramListWithSubList.
set(
"aggregation: threshold", paramListWithSubList.
get<
double>(
"aggregation: aux: threshold"));
385 paramListWithSubList.
remove(
"aggregation: aux: threshold");
391 std::stringstream mueluss;
394 mueluss <<
"<ParameterList name=\"MueLu\">" << std::endl;
397 mueluss <<
"<Parameter name=\"aggregation: match ML phase1\" type=\"bool\" value=\"true\"/>" << std::endl;
400 mueluss <<
"<Parameter name=\"aggregation: match ML phase2a\" type=\"bool\" value=\"true\"/>" << std::endl;
403 mueluss <<
"<Parameter name=\"aggregation: match ML phase2b\" type=\"bool\" value=\"true\"/>" << std::endl;
406 mueluss <<
"<Parameter name=\"aggregation: use ml scaling of drop tol\" type=\"bool\" value=\"true\"/>" << std::endl;
411 const std::string &pname = paramListWithSubList.
name(param);
415 std::stringstream valuess;
416 valuess << paramList.
entry(param);
417 std::string valuestr = valuess.str();
420 valuestr =
trim(valuestr);
423 std::string valueInterpreterStr =
"\"" + valuestr +
"\"";
426 if ((pname ==
"aggregation: aux: enable") && (paramListWithSubList.
get<
bool>(
"aggregation: aux: enable"))) {
427 mueluss <<
"<Parameter name=\"aggregation: drop scheme\" type=\"string\" value=\""
428 <<
"distance laplacian"
429 <<
"\"/>" << std::endl;
433 if (pname ==
"ML output") {
435 int verbosityLevel = std::stoi(valuestr);
436 std::string eVerbLevel =
"none";
437 if (verbosityLevel == 0) eVerbLevel =
"none";
438 if (verbosityLevel >= 1) eVerbLevel =
"low";
439 if (verbosityLevel >= 5) eVerbLevel =
"medium";
440 if (verbosityLevel >= 10) eVerbLevel =
"high";
441 if (verbosityLevel >= 11) eVerbLevel =
"extreme";
442 if (verbosityLevel >= 42) eVerbLevel =
"test";
443 if (verbosityLevel >= 666) eVerbLevel =
"interfacetest";
444 mueluss <<
"<Parameter name=\"verbosity\" type=\"string\" value=\"" << eVerbLevel <<
"\"/>" << std::endl;
450 mueluss << ret << std::endl;
453 adaptingParamList.
remove(pname,
false);
459 if (pname ==
"energy minimization: enable") {
460 mueluss <<
"<Parameter name=\"problem: symmetric\" type=\"bool\" value=\"false\"/>" << std::endl;
461 mueluss <<
"<Parameter name=\"transpose: use implicit\" type=\"bool\" value=\"false\"/>" << std::endl;
465 if (pname ==
"smoother: type") {
470 if (pname.find(
"smoother: list (level", 0) == 0) {
472 std::string type, option;
479 int matched = sscanf(pname.c_str(),
"%s %[^(](level %d)", ctype.
getRawPtr(), coption.
getRawPtr(), &levelID);
481 option = std::string(coption.
getRawPtr());
482 option.resize(option.size() - 1);
484 if (matched != 3 || (type !=
"smoother:")) {
486 <<
"Error in creating level-specific sublists" << std::endl
487 <<
"Offending parameter: " << pname << std::endl);
490 mueluss <<
"<ParameterList name=\"level " << levelID <<
"\">" << std::endl;
492 mueluss <<
"</ParameterList>" << std::endl;
498 if (pname ==
"coarse: list") {
507 mueluss <<
"</ParameterList>" << std::endl;
509 return mueluss.str();
516 coarseList = &(inList.
sublist(
"coarse: list"));
518 std::string pname = List.
name(param);
519 if (coarseList && pname.find(
"coarse: ", 0) != std::string::npos) {
522 }
else if (!inList.
isParameter(pname) || OverWrite) {
536 int *ioptions,
double *iparams,
const bool OverWrite) {
541 const int MUELU_AZ_OPTIONS_SIZE = 47;
542 const int MUELU_AZ_PARAMS_SIZE = 30;
548 if (ioptions == NULL)
549 options =
rcp(
new std::vector<int>(MUELU_AZ_OPTIONS_SIZE));
551 options =
rcp(
new std::vector<int>(ioptions, ioptions + MUELU_AZ_OPTIONS_SIZE));
553 params =
rcp(
new std::vector<double>(MUELU_AZ_PARAMS_SIZE));
555 params =
rcp(
new std::vector<double>(iparams, iparams + MUELU_AZ_PARAMS_SIZE));
560 if (ProblemType ==
"SA") {
562 }
else if (ProblemType ==
"DD") {
564 }
else if (ProblemType ==
"DD-ML") {
566 }
else if (ProblemType ==
"maxwell" || ProblemType ==
"Maxwell") {
568 }
else if (ProblemType ==
"NSSA") {
570 }
else if (ProblemType ==
"DD-ML-LU") {
572 }
else if (ProblemType ==
"DD-LU") {
574 }
else if (ProblemType ==
"Classical-AMG") {
577 std::cerr <<
"ERROR: Wrong input parameter in `SetDefaults' ("
578 << ProblemType <<
"). Should be: " << std::endl
579 <<
"ERROR: <SA> / <DD> / <DD-ML> / <maxwell>" << std::endl;
591 inList.
setName(
"SA default values");
592 List.
set(
"default values",
"SA");
593 List.
set(
"max levels", 10);
594 List.
set(
"prec type",
"MGV");
595 List.
set(
"increasing or decreasing",
"increasing");
597 List.
set(
"aggregation: type",
"Uncoupled-MIS");
598 List.
set(
"aggregation: damping factor", 1.333);
599 List.
set(
"eigen-analysis: type",
"cg");
600 List.
set(
"eigen-analysis: iterations", 10);
602 List.
set(
"smoother: sweeps", 2);
603 List.
set(
"smoother: damping factor", 1.0);
604 List.
set(
"smoother: pre or post",
"both");
605 List.
set(
"smoother: type",
"symmetric Gauss-Seidel");
607 List.
set(
"coarse: type",
"Amesos-KLU");
608 List.
set(
"coarse: max size", 128);
609 List.
set(
"coarse: pre or post",
"post");
610 List.
set(
"coarse: sweeps", 1);
611 List.
set(
"coarse: split communicator",
false);
623 inList.
setName(
"DD default values");
624 List.
set(
"default values",
"DD");
625 List.
set(
"max levels", 2);
626 List.
set(
"prec type",
"MGV");
627 List.
set(
"increasing or decreasing",
"increasing");
629 List.
set(
"aggregation: type",
"METIS");
630 List.
set(
"aggregation: local aggregates", 1);
631 List.
set(
"aggregation: damping factor", 1.333);
632 List.
set(
"eigen-analysis: type",
"power-method");
633 List.
set(
"eigen-analysis: iterations", 20);
635 List.
set(
"smoother: sweeps", 1);
636 List.
set(
"smoother: pre or post",
"both");
646 List.
set(
"coarse: type",
"Amesos-KLU");
647 List.
set(
"coarse: max size", 128);
648 List.
set(
"coarse: pre or post",
"post");
649 List.
set(
"coarse: sweeps", 1);
661 inList.
setName(
"DD-ML default values");
662 List.
set(
"default values",
"DD-ML");
664 List.
set(
"max levels", 3);
665 List.
set(
"prec type",
"MGV");
666 List.
set(
"increasing or decreasing",
"increasing");
668 List.
set(
"aggregation: type",
"METIS");
669 List.
set(
"aggregation: nodes per aggregate", 512);
670 List.
set(
"aggregation: next-level aggregates per process", 128);
671 List.
set(
"aggregation: damping factor", 1.333);
672 List.
set(
"eigen-analysis: type",
"power-method");
673 List.
set(
"eigen-analysis: iterations", 20);
675 List.
set(
"smoother: sweeps", 1);
676 List.
set(
"smoother: pre or post",
"both");
686 List.
set(
"coarse: type",
"Amesos-KLU");
687 List.
set(
"coarse: max size", 128);
688 List.
set(
"coarse: pre or post",
"post");
689 List.
set(
"coarse: sweeps", 1);
701 inList.
setName(
"Maxwell default values");
702 List.
set(
"default values",
"maxwell");
703 List.
set(
"max levels", 10);
704 List.
set(
"prec type",
"MGV");
705 List.
set(
"increasing or decreasing",
"decreasing");
707 List.
set(
"aggregation: type",
"Uncoupled-MIS");
708 List.
set(
"aggregation: damping factor", 1.333);
709 List.
set(
"eigen-analysis: type",
"cg");
710 List.
set(
"eigen-analysis: iterations", 10);
712 List.
set(
"aggregation: edge prolongator drop threshold", 0.0);
714 List.
set(
"smoother: sweeps", 1);
715 List.
set(
"smoother: damping factor", 1.0);
716 List.
set(
"smoother: pre or post",
"both");
717 List.
set(
"smoother: type",
"Hiptmair");
718 List.
set(
"smoother: Hiptmair efficient symmetric",
true);
719 List.
set(
"subsmoother: type",
"Chebyshev");
720 List.
set(
"subsmoother: Chebyshev alpha", 20.0);
721 List.
set(
"subsmoother: node sweeps", 4);
722 List.
set(
"subsmoother: edge sweeps", 4);
725 List.
set(
"coarse: type",
"Amesos-KLU");
726 List.
set(
"coarse: max size", 128);
727 List.
set(
"coarse: pre or post",
"post");
728 List.
set(
"coarse: sweeps", 1);
740 inList.
setName(
"NSSA default values");
741 List.
set(
"default values",
"NSSA");
742 List.
set(
"max levels", 10);
743 List.
set(
"prec type",
"MGW");
744 List.
set(
"increasing or decreasing",
"increasing");
746 List.
set(
"aggregation: type",
"Uncoupled-MIS");
747 List.
set(
"energy minimization: enable",
true);
748 List.
set(
"eigen-analysis: type",
"power-method");
749 List.
set(
"eigen-analysis: iterations", 20);
751 List.
set(
"smoother: sweeps", 4);
752 List.
set(
"smoother: damping factor", .67);
753 List.
set(
"smoother: pre or post",
"post");
754 List.
set(
"smoother: type",
"symmetric Gauss-Seidel");
756 List.
set(
"coarse: type",
"Amesos-KLU");
757 List.
set(
"coarse: max size", 256);
758 List.
set(
"coarse: pre or post",
"post");
759 List.
set(
"coarse: sweeps", 1);
771 inList.
setName(
"DD-LU default values");
772 List.
set(
"default values",
"DD-LU");
773 List.
set(
"max levels", 2);
774 List.
set(
"prec type",
"MGV");
775 List.
set(
"increasing or decreasing",
"increasing");
777 List.
set(
"aggregation: type",
"METIS");
778 List.
set(
"aggregation: local aggregates", 1);
779 List.
set(
"aggregation: damping factor", 1.333);
780 List.
set(
"eigen-analysis: type",
"power-method");
781 List.
set(
"eigen-analysis: iterations", 20);
783 List.
set(
"smoother: sweeps", 1);
784 List.
set(
"smoother: pre or post",
"both");
795 List.
set(
"coarse: type",
"Amesos-KLU");
796 List.
set(
"coarse: max size", 128);
797 List.
set(
"coarse: pre or post",
"post");
798 List.
set(
"coarse: sweeps", 1);
810 inList.
setName(
"DD-ML-LU default values");
811 List.
set(
"default values",
"DD-ML-LU");
812 List.
set(
"max levels", 3);
813 List.
set(
"prec type",
"MGV");
814 List.
set(
"increasing or decreasing",
"increasing");
816 List.
set(
"aggregation: type",
"METIS");
817 List.
set(
"aggregation: nodes per aggregate", 512);
818 List.
set(
"aggregation: next-level aggregates per process", 128);
819 List.
set(
"aggregation: damping factor", 1.333);
821 List.
set(
"smoother: sweeps", 1);
822 List.
set(
"smoother: pre or post",
"both");
831 List.
set(
"coarse: type",
"Amesos-KLU");
832 List.
set(
"coarse: max size", 128);
833 List.
set(
"coarse: pre or post",
"post");
834 List.
set(
"coarse: sweeps", 1);
846 inList.
setName(
"Classical-AMG default values");
847 List.
set(
"default values",
"Classical-AMG");
848 List.
set(
"max levels", 10);
849 List.
set(
"prec type",
"MGV");
850 List.
set(
"increasing or decreasing",
"increasing");
851 List.
set(
"smoother: sweeps", 2);
852 List.
set(
"smoother: damping factor", 1.0);
853 List.
set(
"smoother: pre or post",
"both");
854 List.
set(
"smoother: type",
"symmetric Gauss-Seidel");
856 List.
set(
"coarse: type",
"Amesos-KLU");
857 List.
set(
"coarse: max size", 128);
858 List.
set(
"coarse: pre or post",
"post");
859 List.
set(
"coarse: sweeps", 1);
874 List11c.
set(
"cycle applications", 1);
875 List11c.
set(
"smoother: type",
"Chebyshev");
876 List11c.
set(
"aggregation: threshold", .01);
877 List11c.
set(
"coarse: type",
"Amesos-KLU");
878 List11c.
set(
"ML label",
"coarse (1,1) block");
883 List11.
set(
"cycle applications", 1);
884 List11.
set(
"aggregation: type",
"Uncoupled");
885 List11.
set(
"smoother: sweeps", 0);
886 List11.
set(
"aggregation: damping factor", 0.0);
887 List11.
set(
"edge matrix free: coarse", List11c);
888 List11.
set(
"aggregation: threshold", .01);
893 List22.
set(
"cycle applications", 1);
894 List22.
set(
"smoother: type",
"Chebyshev");
895 List22.
set(
"aggregation: type",
"Uncoupled");
896 List22.
set(
"aggregation: threshold", .01);
897 List22.
set(
"coarse: type",
"Amesos-KLU");
898 List22.
set(
"ML label",
"(2,2) block");
906 ListRF.
set(
"smoother: type",
"Chebyshev");
907 ListRF.
set(
"smoother: sweeps", 2);
908 ListRF.
set(
"refmaxwell: 11solver",
"edge matrix free");
909 ListRF.
set(
"refmaxwell: 11list", List11);
910 ListRF.
set(
"refmaxwell: 22solver",
"multilevel");
911 ListRF.
set(
"refmaxwell: 22list", List22);
912 ListRF.
set(
"refmaxwell: mode",
"additive");
913 ListRF.
set(
"default values",
"RefMaxwell");
914 ListRF.
set(
"zero starting solution",
false);
static std::string SetParameterList(const Teuchos::ParameterList ¶mList_in, const std::string &defaultVals)
: Interpret parameter list
const std::string & name() const
void MergeParameterList(const Teuchos::ParameterList &source, Teuchos::ParameterList &dest, bool overWrite)
: merge two parameter lists
ParameterList & setEntry(const std::string &name, U &&entry)
ConstIterator end() const
static int SetDefaultsMaxwell(Teuchos::ParameterList &List, Teuchos::RCP< std::vector< int > > &options, Teuchos::RCP< std::vector< double > > ¶ms, bool Overwrite=true)
Sets default parameters for the eddy current equations equations.
static int SetDefaultsClassicalAMG(Teuchos::ParameterList &List, Teuchos::RCP< std::vector< int > > &options, Teuchos::RCP< std::vector< double > > ¶ms, bool Overwrite=true)
Sets defaults for classical amg.
T & get(const std::string &name, T def_value)
static std::string interpretParameterName(const std::string &name, const std::string &value)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
static int SetDefaultsNSSA(Teuchos::ParameterList &List, Teuchos::RCP< std::vector< int > > &options, Teuchos::RCP< std::vector< double > > ¶ms, bool Overwrite=true)
Sets defaults for energy minimization preconditioning for nonsymmetric problems.
static int SetDefaultsSA(Teuchos::ParameterList &List, Teuchos::RCP< std::vector< int > > &options, Teuchos::RCP< std::vector< double > > ¶ms, bool Overwrite=true)
Sets default parameters for classical smoothed aggregation.
std::string tolower(const std::string &str)
static int UpdateList(Teuchos::ParameterList &source, Teuchos::ParameterList &dest, bool OverWrite)
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
static int SetDefaultsDD_3Levels(Teuchos::ParameterList &List, Teuchos::RCP< std::vector< int > > &options, Teuchos::RCP< std::vector< double > > ¶ms, bool Overwrite=true)
Sets default parameters for aggregation-based 3-level domain decomposition preconditioners.
bool isParameter(const std::string &name) const
static std::string GetSmootherFactory(const Teuchos::ParameterList ¶mList, Teuchos::ParameterList &adaptingParamList, const std::string &pname, const std::string &value)
: Helper function which translates ML smoother/solver paramters to MueLu XML string ...
void CreateSublists(const ParameterList &List, ParameterList &newList)
bool remove(std::string const &name, bool throwIfNotExists=true)
static int SetDefaults(std::string ProblemType, Teuchos::ParameterList &List, int *options=0, double *params=0, const bool OverWrite=true)
Sets ML's (not MueLu's) default parameters for aggregation-based preconditioners. ...
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
static void ML_OverwriteDefaults(ParameterList &inList, ParameterList &List, bool OverWrite)
bool isSublist(const std::string &name) const
static int SetDefaultsDD_LU(Teuchos::ParameterList &List, Teuchos::RCP< std::vector< int > > &options, Teuchos::RCP< std::vector< double > > ¶ms, bool Overwrite=true)
Sets default parameters for aggregation-based 2-level domain decomposition preconditioners, using LU on each subdomain.
params_t::ConstIterator ConstIterator
static int SetDefaultsDD(Teuchos::ParameterList &List, Teuchos::RCP< std::vector< int > > &options, Teuchos::RCP< std::vector< double > > ¶ms, bool Overwrite=true)
Sets default parameters for aggregation-based 2-level domain decomposition preconditioners.
ConstIterator begin() const
const ParameterEntry & entry(ConstIterator i) const
static std::string ML2MueLu(const std::string &name)
Translate ML parameter to corresponding MueLu parameter.
static int SetDefaultsDD_3Levels_LU(Teuchos::ParameterList &List, Teuchos::RCP< std::vector< int > > &options, Teuchos::RCP< std::vector< double > > ¶ms, bool Overwrite=true)
Sets default parameters for aggregation-based 3-level domain decomposition preconditioners with LU...
ParameterList & sublist(const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
ParameterList & setName(const std::string &name)
Exception throws to report errors in the internal logical of the program.
static int SetDefaultsRefMaxwell(Teuchos::ParameterList &inList, bool OverWrite=true)
Sets defaults for RefMaxwell / Maxwell2.
static std::string & trim(std::string &s)
void replaceAll(std::string &str, const std::string &from, const std::string &to)