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;
103 std::cout <<
"error in " << __FILE__ <<
":" << __LINE__ <<
" could not find valid smoother/solver: " << valuestr << std::endl;
108 if (paramList.
isParameter(
"smoother: pre or post") && mode ==
"smoother:") {
112 mueluss <<
"<Parameter name=\"smoother: pre or post\" type=\"string\" value=\"" << PreOrPost <<
"\"/>" << std::endl;
113 adaptingParamList.
remove(
"smoother: pre or post",
false);
117 if (PreOrPost !=
"both") {
118 mueluss <<
"<ParameterList name=\"smoother: " << PreOrPost <<
" params\">" << std::endl;
120 mueluss <<
"<ParameterList name=\"" << mode <<
" params\">" << std::endl;
125 if (valuestr ==
"jacobi" || valuestr ==
"gauss-seidel" || valuestr ==
"symmetric gauss-seidel") {
126 if (valuestr ==
"jacobi") {
127 mueluss <<
"<Parameter name=\"relaxation: type\" type=\"string\" value=\"Jacobi\"/>" << std::endl;
128 adaptingParamList.
remove(
"relaxation: type",
false);
130 if (valuestr ==
"gauss-seidel") {
131 mueluss <<
"<Parameter name=\"relaxation: type\" type=\"string\" value=\"Gauss-Seidel\"/>" << std::endl;
132 adaptingParamList.
remove(
"relaxation: type",
false);
134 if (valuestr ==
"symmetric gauss-seidel") {
135 mueluss <<
"<Parameter name=\"relaxation: type\" type=\"string\" value=\"Symmetric Gauss-Seidel\"/>" << std::endl;
136 adaptingParamList.
remove(
"relaxation: type",
false);
139 mueluss <<
"<Parameter name=\"relaxation: sweeps\" type=\"int\" value=\"" << paramList.
get<
int>(
"smoother: sweeps") <<
"\"/>" << std::endl;
140 adaptingParamList.
remove(
"smoother: sweeps",
false);
142 if (paramList.
isParameter(
"smoother: damping factor")) {
143 mueluss <<
"<Parameter name=\"relaxation: damping factor\" type=\"double\" value=\"" << paramList.
get<
double>(
"smoother: damping factor") <<
"\"/>" << std::endl;
144 adaptingParamList.
remove(
"smoother: damping factor",
false);
146 if (paramList.
isParameter(
"smoother: use l1 Gauss-Seidel")) {
147 mueluss <<
"<Parameter name=\"relaxation: use l1\" type=\"bool\" value=\"" << paramList.
get<
bool>(
"smoother: use l1 Gauss-Seidel") <<
"\"/>" << std::endl;
148 adaptingParamList.
remove(
"smoother: use l1 Gauss-Seidel",
false);
153 if (valuestr ==
"chebyshev") {
154 if (paramList.
isParameter(
"smoother: polynomial order")) {
155 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"" << paramList.
get<
int>(
"smoother: polynomial order") <<
"\"/>" << std::endl;
156 adaptingParamList.
remove(
"smoother: polynomial order",
false);
158 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"2\"/>" << std::endl;
160 if (paramList.
isParameter(
"smoother: Chebyshev alpha")) {
161 mueluss <<
"<Parameter name=\"chebyshev: ratio eigenvalue\" type=\"double\" value=\"" << paramList.
get<
double>(
"smoother: Chebyshev alpha") <<
"\"/>" << std::endl;
162 adaptingParamList.
remove(
"smoother: Chebyshev alpha",
false);
164 mueluss <<
"<Parameter name=\"chebyshev: ratio eigenvalue\" type=\"double\" value=\"20\"/>" << std::endl;
165 adaptingParamList.
remove(
"smoother: Chebyshev alpha",
false);
167 if (paramList.
isParameter(
"eigen-analysis: type")) {
168 mueluss <<
"<Parameter name=\"eigen-analysis: type\" type=\"string\" value=\"" << paramList.
get<std::string>(
"eigen-analysis: type") <<
"\"/>" << std::endl;
169 adaptingParamList.
remove(
"eigen-analysis: type",
false);
171 mueluss <<
"<Parameter name=\"eigen-analysis: type\" type=\"string\" value=\"cg\"/>" << std::endl;
176 if (valuestr ==
"mls") {
177 if (paramList.
isParameter(
"smoother: MLS polynomial order")) {
178 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"" << paramList.
get<
int>(
"smoother: MLS polynomial order") <<
"\"/>" << std::endl;
179 adaptingParamList.
remove(
"smoother: MLS polynomial order",
false);
180 }
else if (paramList.
isParameter(
"smoother: polynomial order")) {
181 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"" << paramList.
get<
int>(
"smoother: polynomial order") <<
"\"/>" << std::endl;
182 adaptingParamList.
remove(
"smoother: polynomial order",
false);
184 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"2\"/>" << std::endl;
186 if (paramList.
isParameter(
"smoother: MLS alpha")) {
187 mueluss <<
"<Parameter name=\"chebyshev: ratio eigenvalue\" type=\"double\" value=\"" << paramList.
get<
double>(
"smoother: MLS alpha") <<
"\"/>" << std::endl;
188 adaptingParamList.
remove(
"smoother: MLS alpha",
false);
189 }
else if (paramList.
isParameter(
"smoother: Chebyshev alpha")) {
190 mueluss <<
"<Parameter name=\"chebyshev: ratio eigenvalue\" type=\"double\" value=\"" << paramList.
get<
double>(
"smoother: Chebyshev alpha") <<
"\"/>" << std::endl;
191 adaptingParamList.
remove(
"smoother: Chebyshev alpha",
false);
193 mueluss <<
"<Parameter name=\"chebyshev: ratio eigenvalue\" type=\"double\" value=\"20\"/>" << std::endl;
195 if (paramList.
isParameter(
"eigen-analysis: type")) {
196 mueluss <<
"<Parameter name=\"eigen-analysis: type\" type=\"string\" value=\"" << paramList.
get<std::string>(
"eigen-analysis: type") <<
"\"/>" << std::endl;
197 adaptingParamList.
remove(
"eigen-analysis: type",
false);
199 mueluss <<
"<Parameter name=\"eigen-analysis: type\" type=\"string\" value=\"cg\"/>" << std::endl;
203 if (valuestr ==
"hiptmair") {
204 std::string subSmootherType =
"Chebyshev";
205 if (!is_coarse && paramList.
isParameter(
"subsmoother: type"))
206 subSmootherType = paramList.
get<std::string>(
"subsmoother: type");
207 if (is_coarse && paramList.
isParameter(
"smoother: subsmoother type"))
208 subSmootherType = paramList.
get<std::string>(
"smoother: subsmoother type");
210 std::string subSmootherIfpackType;
212 if (subSmootherType ==
"Chebyshev")
213 subSmootherIfpackType =
"CHEBYSHEV";
214 else if (subSmootherType ==
"Jacobi" || subSmootherType ==
"Gauss-Seidel" || subSmootherType ==
"symmetric Gauss-Seidel") {
215 if (subSmootherType ==
"symmetric Gauss-Seidel") subSmootherType =
"Symmetric Gauss-Seidel";
216 subSmootherIfpackType =
"RELAXATION";
220 mueluss <<
"<Parameter name=\"hiptmair: smoother type 1\" type=\"string\" value=\"" << subSmootherIfpackType <<
"\"/>" << std::endl;
221 mueluss <<
"<Parameter name=\"hiptmair: smoother type 2\" type=\"string\" value=\"" << subSmootherIfpackType <<
"\"/>" << std::endl;
223 mueluss <<
"<ParameterList name=\"hiptmair: smoother list 1\">" << std::endl;
224 if (subSmootherType ==
"Chebyshev") {
225 std::string edge_sweeps = is_coarse ?
"smoother: edge sweeps" :
"subsmoother: edge sweeps";
226 std::string cheby_alpha = is_coarse ?
"smoother: Chebyshev alpha" :
"subsmoother: Chebyshev_alpha";
229 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"" << paramList.
get<
int>(edge_sweeps) <<
"\"/>" << std::endl;
230 adaptingParamList.
remove(
"subsmoother: edge sweeps",
false);
233 mueluss <<
"<Parameter name=\"chebyshev: ratio eigenvalue\" type=\"double\" value=\"" << paramList.
get<
double>(cheby_alpha) <<
"\"/>" << std::endl;
236 std::string edge_sweeps = is_coarse ?
"smoother: edge sweeps" :
"subsmoother: edge sweeps";
237 std::string SGS_damping = is_coarse ?
"smoother: SGS damping factor" :
"subsmoother: SGS damping factor";
240 mueluss <<
"<Parameter name=\"relaxation: type\" type=\"string\" value=\"" << subSmootherType <<
"\"/>" << std::endl;
241 mueluss <<
"<Parameter name=\"relaxation: sweeps\" type=\"int\" value=\"" << paramList.
get<
int>(edge_sweeps) <<
"\"/>" << std::endl;
242 adaptingParamList.
remove(edge_sweeps,
false);
245 mueluss <<
"<Parameter name=\"relaxation: damping factor\" type=\"double\" value=\"" << paramList.
get<
double>(SGS_damping) <<
"\"/>" << std::endl;
248 mueluss <<
"</ParameterList>" << std::endl;
250 mueluss <<
"<ParameterList name=\"hiptmair: smoother list 2\">" << std::endl;
251 if (subSmootherType ==
"Chebyshev") {
252 std::string node_sweeps = is_coarse ?
"smoother: node sweeps" :
"subsmoother: node sweeps";
253 std::string cheby_alpha = is_coarse ?
"smoother: Chebyshev alpha" :
"subsmoother: Chebyshev_alpha";
255 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"" << paramList.
get<
int>(node_sweeps) <<
"\"/>" << std::endl;
256 adaptingParamList.
remove(
"subsmoother: node sweeps",
false);
259 mueluss <<
"<Parameter name=\"chebyshev: ratio eigenvalue\" type=\"double\" value=\"" << paramList.
get<
double>(cheby_alpha) <<
"\"/>" << std::endl;
260 adaptingParamList.
remove(
"subsmoother: Chebyshev alpha",
false);
263 std::string node_sweeps = is_coarse ?
"smoother: node sweeps" :
"subsmoother: node sweeps";
264 std::string SGS_damping = is_coarse ?
"smoother: SGS damping factor" :
"subsmoother: SGS damping factor";
267 mueluss <<
"<Parameter name=\"relaxation: type\" type=\"string\" value=\"" << subSmootherType <<
"\"/>" << std::endl;
268 mueluss <<
"<Parameter name=\"relaxation: sweeps\" type=\"int\" value=\"" << paramList.
get<
int>(node_sweeps) <<
"\"/>" << std::endl;
269 adaptingParamList.
remove(
"subsmoother: node sweeps",
false);
272 mueluss <<
"<Parameter name=\"relaxation: damping factor\" type=\"double\" value=\"" << paramList.
get<
double>(SGS_damping) <<
"\"/>" << std::endl;
273 adaptingParamList.
remove(
"subsmoother: SGS damping factor",
false);
276 mueluss <<
"</ParameterList>" << std::endl;
280 if (valuestr ==
"ifpack") {
282 if (paramList.
isParameter(
"smoother: ifpack overlap")) {
283 mueluss <<
"<Parameter name=\"partitioner: overlap\" type=\"int\" value=\"" << paramList.
get<
int>(
"smoother: ifpack overlap") <<
"\"/>" << std::endl;
284 adaptingParamList.
remove(
"smoother: ifpack overlap",
false);
286 if (paramList.
isParameter(
"smoother: ifpack level-of-fill")) {
287 mueluss <<
"<Parameter name=\"fact: level-of-fill\" type=\"int\" value=\"" << paramList.
get<
int>(
"smoother: ifpack level-of-fill") <<
"\"/>" << std::endl;
288 adaptingParamList.
remove(
"smoother: ifpack level-of-fill",
false);
290 if (paramList.
isParameter(
"smoother: ifpack absolute threshold")) {
291 mueluss <<
"<Parameter name=\"fact: absolute threshold\" type=\"int\" value=\"" << paramList.
get<
double>(
"smoother: ifpack absolute threshold") <<
"\"/>" << std::endl;
292 adaptingParamList.
remove(
"smoother: ifpack absolute threshold",
false);
294 if (paramList.
isParameter(
"smoother: ifpack relative threshold")) {
295 mueluss <<
"<Parameter name=\"fact: relative threshold\" type=\"int\" value=\"" << paramList.
get<
double>(
"smoother: ifpack relative threshold") <<
"\"/>" << std::endl;
296 adaptingParamList.
remove(
"smoother: ifpack relative threshold",
false);
300 mueluss <<
"</ParameterList>" << std::endl;
304 mueluss <<
"<Parameter name=\"coarse: max size\" type=\"int\" value=\"" << paramList.
get<
int>(
"smoother: max size") <<
"\"/>" << std::endl;
305 adaptingParamList.
remove(
"smoother: max size",
false);
308 return mueluss.str();
317 if (paramList.
isParameter(
"repartition: start level")) {
318 paramList.
set(
"repartition: start level", paramList.
get<
int>(
"repartition: start level") + 1);
320 paramList.
set(
"repartition: start level", 2);
324 if (!paramList.
isParameter(
"repartition: put on single proc")) {
325 paramList.
set(
"repartition: put on single proc", 5000);
329 if (defaultVals !=
"") {
331 "MueLu::ML2MueLuParameterTranslator: only \"SA\", \"NSSA\", \"refmaxwell\" and \"Maxwell\" allowed as options for ML default parameters.");
333 if (defaultVals ==
"refmaxwell")
340 paramList = ML_defaultlist;
351 paramList = paramListWithSubList;
363 if (paramListWithSubList.
isParameter(
"aggregation: aux: enable") && paramListWithSubList.
get<
bool>(
"aggregation: aux: enable")) {
364 if (paramListWithSubList.
isParameter(
"aggregation: aux: threshold")) {
365 paramListWithSubList.
set(
"aggregation: threshold", paramListWithSubList.
get<
double>(
"aggregation: aux: threshold"));
366 paramListWithSubList.
remove(
"aggregation: aux: threshold");
372 std::stringstream mueluss;
374 mueluss <<
"<ParameterList name=\"MueLu\">" << std::endl;
377 mueluss <<
"<Parameter name=\"aggregation: match ML phase1\" type=\"bool\" value=\"true\"/>" << std::endl;
380 mueluss <<
"<Parameter name=\"aggregation: match ML phase2a\" type=\"bool\" value=\"true\"/>" << std::endl;
383 mueluss <<
"<Parameter name=\"aggregation: match ML phase2b\" type=\"bool\" value=\"true\"/>" << std::endl;
386 mueluss <<
"<Parameter name=\"aggregation: use ml scaling of drop tol\" type=\"bool\" value=\"true\"/>" << std::endl;
391 const std::string &pname = paramListWithSubList.
name(param);
395 if (pname ==
"parameterlist: syntax") {
401 std::stringstream valuess;
402 valuess << paramList.
entry(param);
403 std::string valuestr = valuess.str();
406 valuestr =
trim(valuestr);
409 std::string valueInterpreterStr =
"\"" + valuestr +
"\"";
412 if ((pname ==
"aggregation: aux: enable") && (paramListWithSubList.
get<
bool>(
"aggregation: aux: enable"))) {
413 mueluss <<
"<Parameter name=\"aggregation: drop scheme\" type=\"string\" value=\""
414 <<
"distance laplacian"
415 <<
"\"/>" << std::endl;
419 if (pname ==
"ML output") {
421 int verbosityLevel = std::stoi(valuestr);
422 std::string eVerbLevel =
"none";
423 if (verbosityLevel == 0) eVerbLevel =
"none";
424 if (verbosityLevel >= 1) eVerbLevel =
"low";
425 if (verbosityLevel >= 5) eVerbLevel =
"medium";
426 if (verbosityLevel >= 10) eVerbLevel =
"high";
427 if (verbosityLevel >= 11) eVerbLevel =
"extreme";
428 if (verbosityLevel >= 42) eVerbLevel =
"test";
429 if (verbosityLevel >= 666) eVerbLevel =
"interfacetest";
430 mueluss <<
"<Parameter name=\"verbosity\" type=\"string\" value=\"" << eVerbLevel <<
"\"/>" << std::endl;
436 mueluss << ret << std::endl;
439 adaptingParamList.
remove(pname,
false);
445 if (pname ==
"energy minimization: enable") {
446 mueluss <<
"<Parameter name=\"problem: symmetric\" type=\"bool\" value=\"false\"/>" << std::endl;
447 mueluss <<
"<Parameter name=\"transpose: use implicit\" type=\"bool\" value=\"false\"/>" << std::endl;
451 if (pname ==
"smoother: type") {
456 if (pname.find(
"smoother: list (level", 0) == 0) {
458 std::string type, option;
465 int matched = sscanf(pname.c_str(),
"%s %[^(](level %d)", ctype.
getRawPtr(), coption.
getRawPtr(), &levelID);
467 option = std::string(coption.
getRawPtr());
468 option.resize(option.size() - 1);
470 if (matched != 3 || (type !=
"smoother:")) {
472 <<
"Error in creating level-specific sublists" << std::endl
473 <<
"Offending parameter: " << pname << std::endl);
476 mueluss <<
"<ParameterList name=\"level " << levelID <<
"\">" << std::endl;
478 mueluss <<
"</ParameterList>" << std::endl;
484 if (pname ==
"coarse: list") {
491 std::string coarse_smoother =
"Amesos-KLU";
493 coarse_smoother = paramList.
sublist(
"coarse: list").
get<std::string>(
"smoother: type");
498 mueluss <<
"</ParameterList>" << std::endl;
500 return mueluss.str();
507 coarseList = &(inList.
sublist(
"coarse: list"));
509 std::string pname = List.
name(param);
510 if (coarseList && pname.find(
"coarse: ", 0) != std::string::npos) {
513 }
else if (!inList.
isParameter(pname) || OverWrite) {
527 int *ioptions,
double *iparams,
const bool OverWrite) {
532 const int MUELU_AZ_OPTIONS_SIZE = 47;
533 const int MUELU_AZ_PARAMS_SIZE = 30;
539 if (ioptions == NULL)
540 options =
rcp(
new std::vector<int>(MUELU_AZ_OPTIONS_SIZE));
542 options =
rcp(
new std::vector<int>(ioptions, ioptions + MUELU_AZ_OPTIONS_SIZE));
544 params =
rcp(
new std::vector<double>(MUELU_AZ_PARAMS_SIZE));
546 params =
rcp(
new std::vector<double>(iparams, iparams + MUELU_AZ_PARAMS_SIZE));
551 if (ProblemType ==
"SA") {
553 }
else if (ProblemType ==
"DD") {
555 }
else if (ProblemType ==
"DD-ML") {
557 }
else if (ProblemType ==
"maxwell" || ProblemType ==
"Maxwell") {
559 }
else if (ProblemType ==
"NSSA") {
561 }
else if (ProblemType ==
"DD-ML-LU") {
563 }
else if (ProblemType ==
"DD-LU") {
565 }
else if (ProblemType ==
"Classical-AMG") {
568 std::cerr <<
"ERROR: Wrong input parameter in `SetDefaults' ("
569 << ProblemType <<
"). Should be: " << std::endl
570 <<
"ERROR: <SA> / <DD> / <DD-ML> / <maxwell>" << std::endl;
580 inList.
setName(
"SA default values");
581 List.
set(
"default values",
"SA");
582 List.
set(
"max levels", 10);
583 List.
set(
"prec type",
"MGV");
584 List.
set(
"increasing or decreasing",
"increasing");
586 List.
set(
"aggregation: type",
"Uncoupled-MIS");
587 List.
set(
"aggregation: damping factor", 1.333);
588 List.
set(
"eigen-analysis: type",
"cg");
589 List.
set(
"eigen-analysis: iterations", 10);
591 List.
set(
"smoother: sweeps", 2);
592 List.
set(
"smoother: damping factor", 1.0);
593 List.
set(
"smoother: pre or post",
"both");
594 List.
set(
"smoother: type",
"symmetric Gauss-Seidel");
596 List.
set(
"coarse: type",
"Amesos-KLU");
597 List.
set(
"coarse: max size", 128);
598 List.
set(
"coarse: pre or post",
"post");
599 List.
set(
"coarse: sweeps", 1);
600 List.
set(
"coarse: split communicator",
false);
603 List.
set(
"parameterlist: syntax",
"ml");
615 inList.
setName(
"DD default values");
616 List.
set(
"default values",
"DD");
617 List.
set(
"max levels", 2);
618 List.
set(
"prec type",
"MGV");
619 List.
set(
"increasing or decreasing",
"increasing");
621 List.
set(
"aggregation: type",
"METIS");
622 List.
set(
"aggregation: local aggregates", 1);
623 List.
set(
"aggregation: damping factor", 1.333);
624 List.
set(
"eigen-analysis: type",
"power-method");
625 List.
set(
"eigen-analysis: iterations", 20);
627 List.
set(
"smoother: sweeps", 1);
628 List.
set(
"smoother: pre or post",
"both");
638 List.
set(
"coarse: type",
"Amesos-KLU");
639 List.
set(
"coarse: max size", 128);
640 List.
set(
"coarse: pre or post",
"post");
641 List.
set(
"coarse: sweeps", 1);
644 List.
set(
"parameterlist: syntax",
"ml");
656 inList.
setName(
"DD-ML default values");
657 List.
set(
"default values",
"DD-ML");
659 List.
set(
"max levels", 3);
660 List.
set(
"prec type",
"MGV");
661 List.
set(
"increasing or decreasing",
"increasing");
663 List.
set(
"aggregation: type",
"METIS");
664 List.
set(
"aggregation: nodes per aggregate", 512);
665 List.
set(
"aggregation: next-level aggregates per process", 128);
666 List.
set(
"aggregation: damping factor", 1.333);
667 List.
set(
"eigen-analysis: type",
"power-method");
668 List.
set(
"eigen-analysis: iterations", 20);
670 List.
set(
"smoother: sweeps", 1);
671 List.
set(
"smoother: pre or post",
"both");
681 List.
set(
"coarse: type",
"Amesos-KLU");
682 List.
set(
"coarse: max size", 128);
683 List.
set(
"coarse: pre or post",
"post");
684 List.
set(
"coarse: sweeps", 1);
687 List.
set(
"parameterlist: syntax",
"ml");
699 inList.
setName(
"Maxwell default values");
700 List.
set(
"default values",
"maxwell");
701 List.
set(
"max levels", 10);
702 List.
set(
"prec type",
"MGV");
703 List.
set(
"increasing or decreasing",
"decreasing");
705 List.
set(
"aggregation: type",
"Uncoupled-MIS");
706 List.
set(
"aggregation: damping factor", 1.333);
707 List.
set(
"eigen-analysis: type",
"cg");
708 List.
set(
"eigen-analysis: iterations", 10);
710 List.
set(
"aggregation: edge prolongator drop threshold", 0.0);
712 List.
set(
"smoother: sweeps", 1);
713 List.
set(
"smoother: damping factor", 1.0);
714 List.
set(
"smoother: pre or post",
"both");
715 List.
set(
"smoother: type",
"Hiptmair");
716 List.
set(
"smoother: Hiptmair efficient symmetric",
true);
717 List.
set(
"subsmoother: type",
"Chebyshev");
718 List.
set(
"subsmoother: Chebyshev alpha", 20.0);
719 List.
set(
"subsmoother: node sweeps", 4);
720 List.
set(
"subsmoother: edge sweeps", 4);
723 List.
set(
"coarse: type",
"Amesos-KLU");
724 List.
set(
"coarse: max size", 128);
725 List.
set(
"coarse: pre or post",
"post");
726 List.
set(
"coarse: sweeps", 1);
729 List.
set(
"parameterlist: syntax",
"ml");
741 inList.
setName(
"NSSA default values");
742 List.
set(
"default values",
"NSSA");
743 List.
set(
"max levels", 10);
744 List.
set(
"prec type",
"MGW");
745 List.
set(
"increasing or decreasing",
"increasing");
747 List.
set(
"aggregation: type",
"Uncoupled-MIS");
748 List.
set(
"energy minimization: enable",
true);
749 List.
set(
"eigen-analysis: type",
"power-method");
750 List.
set(
"eigen-analysis: iterations", 20);
752 List.
set(
"smoother: sweeps", 4);
753 List.
set(
"smoother: damping factor", .67);
754 List.
set(
"smoother: pre or post",
"post");
755 List.
set(
"smoother: type",
"symmetric Gauss-Seidel");
757 List.
set(
"coarse: type",
"Amesos-KLU");
758 List.
set(
"coarse: max size", 256);
759 List.
set(
"coarse: pre or post",
"post");
760 List.
set(
"coarse: sweeps", 1);
763 List.
set(
"parameterlist: syntax",
"ml");
775 inList.
setName(
"DD-LU default values");
776 List.
set(
"default values",
"DD-LU");
777 List.
set(
"max levels", 2);
778 List.
set(
"prec type",
"MGV");
779 List.
set(
"increasing or decreasing",
"increasing");
781 List.
set(
"aggregation: type",
"METIS");
782 List.
set(
"aggregation: local aggregates", 1);
783 List.
set(
"aggregation: damping factor", 1.333);
784 List.
set(
"eigen-analysis: type",
"power-method");
785 List.
set(
"eigen-analysis: iterations", 20);
787 List.
set(
"smoother: sweeps", 1);
788 List.
set(
"smoother: pre or post",
"both");
799 List.
set(
"coarse: type",
"Amesos-KLU");
800 List.
set(
"coarse: max size", 128);
801 List.
set(
"coarse: pre or post",
"post");
802 List.
set(
"coarse: sweeps", 1);
805 List.
set(
"parameterlist: syntax",
"ml");
817 inList.
setName(
"DD-ML-LU default values");
818 List.
set(
"default values",
"DD-ML-LU");
819 List.
set(
"max levels", 3);
820 List.
set(
"prec type",
"MGV");
821 List.
set(
"increasing or decreasing",
"increasing");
823 List.
set(
"aggregation: type",
"METIS");
824 List.
set(
"aggregation: nodes per aggregate", 512);
825 List.
set(
"aggregation: next-level aggregates per process", 128);
826 List.
set(
"aggregation: damping factor", 1.333);
828 List.
set(
"smoother: sweeps", 1);
829 List.
set(
"smoother: pre or post",
"both");
838 List.
set(
"coarse: type",
"Amesos-KLU");
839 List.
set(
"coarse: max size", 128);
840 List.
set(
"coarse: pre or post",
"post");
841 List.
set(
"coarse: sweeps", 1);
853 inList.
setName(
"Classical-AMG default values");
854 List.
set(
"default values",
"Classical-AMG");
855 List.
set(
"max levels", 10);
856 List.
set(
"prec type",
"MGV");
857 List.
set(
"increasing or decreasing",
"increasing");
858 List.
set(
"smoother: sweeps", 2);
859 List.
set(
"smoother: damping factor", 1.0);
860 List.
set(
"smoother: pre or post",
"both");
861 List.
set(
"smoother: type",
"symmetric Gauss-Seidel");
863 List.
set(
"coarse: type",
"Amesos-KLU");
864 List.
set(
"coarse: max size", 128);
865 List.
set(
"coarse: pre or post",
"post");
866 List.
set(
"coarse: sweeps", 1);
869 List.
set(
"parameterlist: syntax",
"ml");
884 List11c.
remove(
"parameterlist: syntax");
885 List11c.
set(
"cycle applications", 1);
886 List11c.
set(
"smoother: type",
"Chebyshev");
887 List11c.
set(
"aggregation: threshold", .01);
888 List11c.
set(
"coarse: type",
"Amesos-KLU");
889 List11c.
set(
"ML label",
"coarse (1,1) block");
894 List11.
remove(
"parameterlist: syntax");
895 List11.
set(
"cycle applications", 1);
896 List11.
set(
"aggregation: type",
"Uncoupled");
897 List11.
set(
"smoother: sweeps", 0);
898 List11.
set(
"aggregation: damping factor", 0.0);
899 List11.
set(
"edge matrix free: coarse", List11c);
900 List11.
set(
"aggregation: threshold", .01);
905 List22.
remove(
"parameterlist: syntax");
906 List22.
set(
"cycle applications", 1);
907 List22.
set(
"smoother: type",
"Chebyshev");
908 List22.
set(
"aggregation: type",
"Uncoupled");
909 List22.
set(
"aggregation: threshold", .01);
910 List22.
set(
"coarse: type",
"Amesos-KLU");
911 List22.
set(
"ML label",
"(2,2) block");
919 ListRF.
set(
"smoother: type",
"Chebyshev");
920 ListRF.
set(
"smoother: sweeps", 2);
921 ListRF.
set(
"refmaxwell: 11solver",
"edge matrix free");
922 ListRF.
set(
"refmaxwell: 11list", List11);
923 ListRF.
set(
"refmaxwell: 22solver",
"multilevel");
924 ListRF.
set(
"refmaxwell: 22list", List22);
925 ListRF.
set(
"refmaxwell: mode",
"additive");
926 ListRF.
set(
"default values",
"RefMaxwell");
927 ListRF.
set(
"zero starting solution",
false);
930 ListRF.
set(
"parameterlist: syntax",
"ml");
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 ...
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
void CreateSublists(const Teuchos::ParameterList &List, Teuchos::ParameterList &newList)
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)