18 TEUCHOS_TEST_FOR_EXCEPTION(pname !=
"coarse: type" && pname !=
"coarse: list" && pname !=
"smoother: type" && pname.find(
"smoother: list", 0) != 0,
20 "MueLu::MLParameterListInterpreter::Setup(): Only \"coarse: type\", \"smoother: type\" or \"smoother: list\" (\"coarse: list\") are "
21 "supported as ML parameters for transformation of smoother/solver parameters to MueLu");
24 std::stringstream mueluss;
27 std::string mode =
"smoother:";
28 bool is_coarse =
false;
29 if (pname.find(
"coarse:", 0) == 0) {
36 if (paramList.isParameter(mode +
" pre or post"))
37 PreOrPost = paramList.get<std::string>(mode +
" pre or post");
40 "MueLu::MLParameterListInterpreter::Setup(): The parameter \"coarse: pre or post\" is not supported by MueLu. "
41 "It does not make sense for direct solvers. For iterative solvers you obtain the same effect by increasing, "
42 "e.g., the number of sweeps for the coarse grid smoother. Please remove it from your parameters.");
45 std::string valuestr = value;
46 std::transform(valuestr.begin(), valuestr.end(), valuestr.begin(), ::tolower);
47 if (valuestr ==
"jacobi" || valuestr ==
"gauss-seidel" || valuestr ==
"symmetric gauss-seidel") {
50 my_name =
"\"" + pname +
"\"";
52 my_name =
"\"smoother: " +
PreOrPost +
" type\"";
53 mueluss <<
"<Parameter name=" << my_name <<
" type=\"string\" value=\"RELAXATION\"/>" << std::endl;
55 }
else if (valuestr ==
"hiptmair") {
58 my_name =
"\"" + pname +
"\"";
60 my_name =
"\"smoother: " +
PreOrPost +
" type\"";
61 mueluss <<
"<Parameter name=" << my_name <<
" type=\"string\" value=\"HIPTMAIR\"/>" << std::endl;
63 }
else if (valuestr ==
"ifpack") {
64 std::string my_name =
"\"" + pname +
"\"";
65 if (paramList.isParameter(
"smoother: ifpack type")) {
66 if (paramList.get<std::string>(
"smoother: ifpack type") ==
"ILU") {
67 mueluss <<
"<Parameter name=" << my_name <<
" type=\"string\" value=\"ILU\"/>" << std::endl;
68 adaptingParamList.remove(
"smoother: ifpack type",
false);
70 if (paramList.get<std::string>(
"smoother: ifpack type") ==
"ILUT") {
71 mueluss <<
"<Parameter name=" << my_name <<
" type\" type=\"string\" value=\"ILUT\"/>" << std::endl;
72 adaptingParamList.remove(
"smoother: ifpack type",
false);
76 }
else if ((valuestr ==
"chebyshev") || (valuestr ==
"mls")) {
77 std::string my_name =
"\"" + pname +
"\"";
78 mueluss <<
"<Parameter name=" << my_name <<
" type=\"string\" value=\"CHEBYSHEV\"/>" << std::endl;
80 }
else if (valuestr.length() > strlen(
"amesos") && valuestr.substr(0, strlen(
"amesos")) ==
"amesos") {
81 std::string solverType = valuestr.substr(strlen(
"amesos") + 1);
84 const int validatorSize = 5;
85 std::string validator[validatorSize] = {
"superlu",
"superludist",
"klu",
"umfpack",
"mumps"};
86 for (
int i = 0; i < validatorSize; i++)
87 if (validator[i] == solverType)
90 "MueLu::MLParameterListInterpreter: unknown smoother type. '" << solverType <<
"' not supported.");
92 mueluss <<
"<Parameter name=\"" << pname <<
"\" type=\"string\" value=\"" << solverType <<
"\"/>" << std::endl;
95 std::cout <<
"error in " << __FILE__ <<
":" << __LINE__ <<
" could not find valid smoother/solver: " << valuestr << std::endl;
100 if (paramList.isParameter(
"smoother: pre or post") && mode ==
"smoother:") {
104 mueluss <<
"<Parameter name=\"smoother: pre or post\" type=\"string\" value=\"" <<
PreOrPost <<
"\"/>" << std::endl;
105 adaptingParamList.remove(
"smoother: pre or post",
false);
110 mueluss <<
"<ParameterList name=\"smoother: " <<
PreOrPost <<
" params\">" << std::endl;
112 mueluss <<
"<ParameterList name=\"" << mode <<
" params\">" << std::endl;
117 if (valuestr ==
"jacobi" || valuestr ==
"gauss-seidel" || valuestr ==
"symmetric gauss-seidel") {
118 if (valuestr ==
"jacobi") {
119 mueluss <<
"<Parameter name=\"relaxation: type\" type=\"string\" value=\"Jacobi\"/>" << std::endl;
120 adaptingParamList.remove(
"relaxation: type",
false);
122 if (valuestr ==
"gauss-seidel") {
123 mueluss <<
"<Parameter name=\"relaxation: type\" type=\"string\" value=\"Gauss-Seidel\"/>" << std::endl;
124 adaptingParamList.remove(
"relaxation: type",
false);
126 if (valuestr ==
"symmetric gauss-seidel") {
127 mueluss <<
"<Parameter name=\"relaxation: type\" type=\"string\" value=\"Symmetric Gauss-Seidel\"/>" << std::endl;
128 adaptingParamList.remove(
"relaxation: type",
false);
130 if (paramList.isParameter(
"smoother: sweeps")) {
131 mueluss <<
"<Parameter name=\"relaxation: sweeps\" type=\"int\" value=\"" << paramList.get<
int>(
"smoother: sweeps") <<
"\"/>" << std::endl;
132 adaptingParamList.remove(
"smoother: sweeps",
false);
134 if (paramList.isParameter(
"smoother: damping factor")) {
135 mueluss <<
"<Parameter name=\"relaxation: damping factor\" type=\"double\" value=\"" << paramList.get<
double>(
"smoother: damping factor") <<
"\"/>" << std::endl;
136 adaptingParamList.remove(
"smoother: damping factor",
false);
138 if (paramList.isParameter(
"smoother: use l1 Gauss-Seidel")) {
139 mueluss <<
"<Parameter name=\"relaxation: use l1\" type=\"bool\" value=\"" << paramList.get<
bool>(
"smoother: use l1 Gauss-Seidel") <<
"\"/>" << std::endl;
140 adaptingParamList.remove(
"smoother: use l1 Gauss-Seidel",
false);
145 if (valuestr ==
"chebyshev") {
146 if (paramList.isParameter(
"smoother: polynomial order")) {
147 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"" << paramList.get<
int>(
"smoother: polynomial order") <<
"\"/>" << std::endl;
148 adaptingParamList.remove(
"smoother: polynomial order",
false);
150 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"2\"/>" << std::endl;
152 if (paramList.isParameter(
"smoother: Chebyshev alpha")) {
153 mueluss <<
"<Parameter name=\"chebyshev: ratio eigenvalue\" type=\"double\" value=\"" << paramList.get<
double>(
"smoother: Chebyshev alpha") <<
"\"/>" << std::endl;
154 adaptingParamList.remove(
"smoother: Chebyshev alpha",
false);
156 mueluss <<
"<Parameter name=\"chebyshev: ratio eigenvalue\" type=\"double\" value=\"20\"/>" << std::endl;
157 adaptingParamList.remove(
"smoother: Chebyshev alpha",
false);
159 if (paramList.isParameter(
"eigen-analysis: type")) {
160 mueluss <<
"<Parameter name=\"eigen-analysis: type\" type=\"string\" value=\"" << paramList.get<std::string>(
"eigen-analysis: type") <<
"\"/>" << std::endl;
161 adaptingParamList.remove(
"eigen-analysis: type",
false);
163 mueluss <<
"<Parameter name=\"eigen-analysis: type\" type=\"string\" value=\"cg\"/>" << std::endl;
168 if (valuestr ==
"mls") {
169 if (paramList.isParameter(
"smoother: MLS polynomial order")) {
170 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"" << paramList.get<
int>(
"smoother: MLS polynomial order") <<
"\"/>" << std::endl;
171 adaptingParamList.remove(
"smoother: MLS polynomial order",
false);
172 }
else if (paramList.isParameter(
"smoother: polynomial order")) {
173 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"" << paramList.get<
int>(
"smoother: polynomial order") <<
"\"/>" << std::endl;
174 adaptingParamList.remove(
"smoother: polynomial order",
false);
176 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"2\"/>" << std::endl;
178 if (paramList.isParameter(
"smoother: MLS alpha")) {
179 mueluss <<
"<Parameter name=\"chebyshev: ratio eigenvalue\" type=\"double\" value=\"" << paramList.get<
double>(
"smoother: MLS alpha") <<
"\"/>" << std::endl;
180 adaptingParamList.remove(
"smoother: MLS alpha",
false);
181 }
else if (paramList.isParameter(
"smoother: Chebyshev alpha")) {
182 mueluss <<
"<Parameter name=\"chebyshev: ratio eigenvalue\" type=\"double\" value=\"" << paramList.get<
double>(
"smoother: Chebyshev alpha") <<
"\"/>" << std::endl;
183 adaptingParamList.remove(
"smoother: Chebyshev alpha",
false);
185 mueluss <<
"<Parameter name=\"chebyshev: ratio eigenvalue\" type=\"double\" value=\"20\"/>" << std::endl;
187 if (paramList.isParameter(
"eigen-analysis: type")) {
188 mueluss <<
"<Parameter name=\"eigen-analysis: type\" type=\"string\" value=\"" << paramList.get<std::string>(
"eigen-analysis: type") <<
"\"/>" << std::endl;
189 adaptingParamList.remove(
"eigen-analysis: type",
false);
191 mueluss <<
"<Parameter name=\"eigen-analysis: type\" type=\"string\" value=\"cg\"/>" << std::endl;
195 if (valuestr ==
"hiptmair") {
196 std::string subSmootherType =
"Chebyshev";
197 if (!is_coarse && paramList.isParameter(
"subsmoother: type"))
198 subSmootherType = paramList.get<std::string>(
"subsmoother: type");
199 if (is_coarse && paramList.isParameter(
"smoother: subsmoother type"))
200 subSmootherType = paramList.get<std::string>(
"smoother: subsmoother type");
202 std::string subSmootherIfpackType;
204 if (subSmootherType ==
"Chebyshev")
205 subSmootherIfpackType =
"CHEBYSHEV";
206 else if (subSmootherType ==
"Jacobi" || subSmootherType ==
"Gauss-Seidel" || subSmootherType ==
"symmetric Gauss-Seidel") {
207 if (subSmootherType ==
"symmetric Gauss-Seidel") subSmootherType =
"Symmetric Gauss-Seidel";
208 subSmootherIfpackType =
"RELAXATION";
210 TEUCHOS_TEST_FOR_EXCEPTION(
true,
Exceptions::RuntimeError,
"MueLu::MLParameterListTranslator: unknown smoother type. '" << subSmootherType <<
"' not supported by MueLu.");
212 mueluss <<
"<Parameter name=\"hiptmair: smoother type 1\" type=\"string\" value=\"" << subSmootherIfpackType <<
"\"/>" << std::endl;
213 mueluss <<
"<Parameter name=\"hiptmair: smoother type 2\" type=\"string\" value=\"" << subSmootherIfpackType <<
"\"/>" << std::endl;
215 mueluss <<
"<ParameterList name=\"hiptmair: smoother list 1\">" << std::endl;
216 if (subSmootherType ==
"Chebyshev") {
217 std::string edge_sweeps = is_coarse ?
"smoother: edge sweeps" :
"subsmoother: edge sweeps";
218 std::string cheby_alpha = is_coarse ?
"smoother: Chebyshev alpha" :
"subsmoother: Chebyshev_alpha";
220 if (paramList.isParameter(edge_sweeps)) {
221 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"" << paramList.get<
int>(edge_sweeps) <<
"\"/>" << std::endl;
222 adaptingParamList.remove(
"subsmoother: edge sweeps",
false);
224 if (paramList.isParameter(cheby_alpha)) {
225 mueluss <<
"<Parameter name=\"chebyshev: ratio eigenvalue\" type=\"double\" value=\"" << paramList.get<
double>(cheby_alpha) <<
"\"/>" << std::endl;
228 std::string edge_sweeps = is_coarse ?
"smoother: edge sweeps" :
"subsmoother: edge sweeps";
229 std::string SGS_damping = is_coarse ?
"smoother: SGS damping factor" :
"subsmoother: SGS damping factor";
231 if (paramList.isParameter(edge_sweeps)) {
232 mueluss <<
"<Parameter name=\"relaxation: type\" type=\"string\" value=\"" << subSmootherType <<
"\"/>" << std::endl;
233 mueluss <<
"<Parameter name=\"relaxation: sweeps\" type=\"int\" value=\"" << paramList.get<
int>(edge_sweeps) <<
"\"/>" << std::endl;
234 adaptingParamList.remove(edge_sweeps,
false);
236 if (paramList.isParameter(SGS_damping)) {
237 mueluss <<
"<Parameter name=\"relaxation: damping factor\" type=\"double\" value=\"" << paramList.get<
double>(SGS_damping) <<
"\"/>" << std::endl;
240 mueluss <<
"</ParameterList>" << std::endl;
242 mueluss <<
"<ParameterList name=\"hiptmair: smoother list 2\">" << std::endl;
243 if (subSmootherType ==
"Chebyshev") {
244 std::string node_sweeps = is_coarse ?
"smoother: node sweeps" :
"subsmoother: node sweeps";
245 std::string cheby_alpha = is_coarse ?
"smoother: Chebyshev alpha" :
"subsmoother: Chebyshev_alpha";
246 if (paramList.isParameter(node_sweeps)) {
247 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"" << paramList.get<
int>(node_sweeps) <<
"\"/>" << std::endl;
248 adaptingParamList.remove(
"subsmoother: node sweeps",
false);
250 if (paramList.isParameter(cheby_alpha)) {
251 mueluss <<
"<Parameter name=\"chebyshev: ratio eigenvalue\" type=\"double\" value=\"" << paramList.get<
double>(cheby_alpha) <<
"\"/>" << std::endl;
252 adaptingParamList.remove(
"subsmoother: Chebyshev alpha",
false);
255 std::string node_sweeps = is_coarse ?
"smoother: node sweeps" :
"subsmoother: node sweeps";
256 std::string SGS_damping = is_coarse ?
"smoother: SGS damping factor" :
"subsmoother: SGS damping factor";
258 if (paramList.isParameter(node_sweeps)) {
259 mueluss <<
"<Parameter name=\"relaxation: type\" type=\"string\" value=\"" << subSmootherType <<
"\"/>" << std::endl;
260 mueluss <<
"<Parameter name=\"relaxation: sweeps\" type=\"int\" value=\"" << paramList.get<
int>(node_sweeps) <<
"\"/>" << std::endl;
261 adaptingParamList.remove(
"subsmoother: node sweeps",
false);
263 if (paramList.isParameter(SGS_damping)) {
264 mueluss <<
"<Parameter name=\"relaxation: damping factor\" type=\"double\" value=\"" << paramList.get<
double>(SGS_damping) <<
"\"/>" << std::endl;
265 adaptingParamList.remove(
"subsmoother: SGS damping factor",
false);
268 mueluss <<
"</ParameterList>" << std::endl;
272 if (valuestr ==
"ifpack") {
274 if (paramList.isParameter(
"smoother: ifpack overlap")) {
275 mueluss <<
"<Parameter name=\"partitioner: overlap\" type=\"int\" value=\"" << paramList.get<
int>(
"smoother: ifpack overlap") <<
"\"/>" << std::endl;
276 adaptingParamList.remove(
"smoother: ifpack overlap",
false);
278 if (paramList.isParameter(
"smoother: ifpack level-of-fill")) {
279 mueluss <<
"<Parameter name=\"fact: level-of-fill\" type=\"int\" value=\"" << paramList.get<
int>(
"smoother: ifpack level-of-fill") <<
"\"/>" << std::endl;
280 adaptingParamList.remove(
"smoother: ifpack level-of-fill",
false);
282 if (paramList.isParameter(
"smoother: ifpack absolute threshold")) {
283 mueluss <<
"<Parameter name=\"fact: absolute threshold\" type=\"int\" value=\"" << paramList.get<
double>(
"smoother: ifpack absolute threshold") <<
"\"/>" << std::endl;
284 adaptingParamList.remove(
"smoother: ifpack absolute threshold",
false);
286 if (paramList.isParameter(
"smoother: ifpack relative threshold")) {
287 mueluss <<
"<Parameter name=\"fact: relative threshold\" type=\"int\" value=\"" << paramList.get<
double>(
"smoother: ifpack relative threshold") <<
"\"/>" << std::endl;
288 adaptingParamList.remove(
"smoother: ifpack relative threshold",
false);
292 mueluss <<
"</ParameterList>" << std::endl;
295 if (paramList.isParameter(
"smoother: max size")) {
296 mueluss <<
"<Parameter name=\"coarse: max size\" type=\"int\" value=\"" << paramList.get<
int>(
"smoother: max size") <<
"\"/>" << std::endl;
297 adaptingParamList.remove(
"smoother: max size",
false);
300 return mueluss.str();
304 Teuchos::ParameterList paramList = paramList_in;
306 RCP<Teuchos::FancyOStream> out = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout));
309 if (paramList.isParameter(
"repartition: start level")) {
310 paramList.set(
"repartition: start level", paramList.get<
int>(
"repartition: start level") + 1);
312 paramList.set(
"repartition: start level", 2);
316 if (!paramList.isParameter(
"repartition: put on single proc")) {
317 paramList.set(
"repartition: put on single proc", 5000);
321 if (defaultVals !=
"") {
322 TEUCHOS_TEST_FOR_EXCEPTION(defaultVals !=
"SA" && defaultVals !=
"NSSA" && defaultVals !=
"refmaxwell" && defaultVals !=
"Maxwell",
Exceptions::RuntimeError,
323 "MueLu::ML2MueLuParameterTranslator: only \"SA\", \"NSSA\", \"refmaxwell\" and \"Maxwell\" allowed as options for ML default parameters.");
324 Teuchos::ParameterList ML_defaultlist;
325 if (defaultVals ==
"refmaxwell")
332 paramList = ML_defaultlist;
341 ParameterList paramListWithSubList;
343 paramList = paramListWithSubList;
344 Teuchos::ParameterList adaptingParamList = paramList;
355 if (paramListWithSubList.isParameter(
"aggregation: aux: enable") && paramListWithSubList.get<
bool>(
"aggregation: aux: enable")) {
356 if (paramListWithSubList.isParameter(
"aggregation: aux: threshold")) {
357 paramListWithSubList.set(
"aggregation: threshold", paramListWithSubList.get<
double>(
"aggregation: aux: threshold"));
358 paramListWithSubList.remove(
"aggregation: aux: threshold");
364 std::stringstream mueluss;
366 mueluss <<
"<ParameterList name=\"MueLu\">" << std::endl;
369 mueluss <<
"<Parameter name=\"aggregation: match ML phase1\" type=\"bool\" value=\"true\"/>" << std::endl;
372 mueluss <<
"<Parameter name=\"aggregation: match ML phase2a\" type=\"bool\" value=\"true\"/>" << std::endl;
375 mueluss <<
"<Parameter name=\"aggregation: match ML phase2b\" type=\"bool\" value=\"true\"/>" << std::endl;
378 mueluss <<
"<Parameter name=\"aggregation: use ml scaling of drop tol\" type=\"bool\" value=\"true\"/>" << std::endl;
381 for (ParameterList::ConstIterator param = paramListWithSubList.begin(); param != paramListWithSubList.end(); ++param) {
383 const std::string &pname = paramListWithSubList.name(param);
387 if (pname ==
"parameterlist: syntax") {
393 std::stringstream valuess;
394 valuess << paramList.entry(param);
395 std::string valuestr = valuess.str();
398 valuestr =
trim(valuestr);
401 std::string valueInterpreterStr =
"\"" + valuestr +
"\"";
404 if ((pname ==
"aggregation: aux: enable") && (paramListWithSubList.get<
bool>(
"aggregation: aux: enable"))) {
405 mueluss <<
"<Parameter name=\"aggregation: drop scheme\" type=\"string\" value=\""
406 <<
"distance laplacian"
407 <<
"\"/>" << std::endl;
411 if (pname ==
"ML output") {
413 int verbosityLevel = std::stoi(valuestr);
414 std::string eVerbLevel =
"none";
415 if (verbosityLevel == 0) eVerbLevel =
"none";
416 if (verbosityLevel >= 1) eVerbLevel =
"low";
417 if (verbosityLevel >= 5) eVerbLevel =
"medium";
418 if (verbosityLevel >= 10) eVerbLevel =
"high";
419 if (verbosityLevel >= 11) eVerbLevel =
"extreme";
420 if (verbosityLevel >= 42) eVerbLevel =
"test";
421 if (verbosityLevel >= 666) eVerbLevel =
"interfacetest";
422 mueluss <<
"<Parameter name=\"verbosity\" type=\"string\" value=\"" << eVerbLevel <<
"\"/>" << std::endl;
428 mueluss << ret << std::endl;
431 adaptingParamList.remove(pname,
false);
437 if (pname ==
"energy minimization: enable") {
438 mueluss <<
"<Parameter name=\"problem: symmetric\" type=\"bool\" value=\"false\"/>" << std::endl;
439 mueluss <<
"<Parameter name=\"transpose: use implicit\" type=\"bool\" value=\"false\"/>" << std::endl;
443 if (pname ==
"smoother: type") {
448 if (pname.find(
"smoother: list (level", 0) == 0) {
450 std::string type, option;
453 typedef Teuchos::ArrayRCP<char>::size_type size_type;
454 Teuchos::Array<char> ctype(size_type(pname.size() + 1));
455 Teuchos::Array<char> coption(size_type(pname.size() + 1));
457 int matched = sscanf(pname.c_str(),
"%s %[^(](level %d)", ctype.getRawPtr(), coption.getRawPtr(), &levelID);
458 type = std::string(ctype.getRawPtr());
459 option = std::string(coption.getRawPtr());
460 option.resize(option.size() - 1);
462 if (matched != 3 || (type !=
"smoother:")) {
464 <<
"Error in creating level-specific sublists" << std::endl
465 <<
"Offending parameter: " << pname << std::endl);
468 mueluss <<
"<ParameterList name=\"level " << levelID <<
"\">" << std::endl;
469 mueluss <<
GetSmootherFactory(paramList.sublist(pname), adaptingParamList.sublist(pname),
"smoother: type", paramList.sublist(pname).get<std::string>(
"smoother: type"));
470 mueluss <<
"</ParameterList>" << std::endl;
474 TEUCHOS_TEST_FOR_EXCEPTION(paramList.isParameter(
"coarse: type"),
Exceptions::RuntimeError,
"MueLu::MLParameterListInterpreter::Setup(): The parameter \"coarse: type\" should not exist but being stored in \"coarse: list\" instead.");
476 if (pname ==
"coarse: list") {
483 std::string coarse_smoother =
"Amesos-KLU";
484 if (paramList.sublist(
"coarse: list").isParameter(
"smoother: type"))
485 coarse_smoother = paramList.sublist(
"coarse: list").get<std::string>(
"smoother: type");
487 mueluss <<
GetSmootherFactory(paramList.sublist(
"coarse: list"), adaptingParamList.sublist(
"coarse: list"),
"coarse: type", coarse_smoother);
490 mueluss <<
"</ParameterList>" << std::endl;
492 return mueluss.str();
496 ParameterList *coarseList = 0;
498 if (inList.isSublist(
"coarse: list"))
499 coarseList = &(inList.sublist(
"coarse: list"));
500 for (ParameterList::ConstIterator param = List.begin(); param != List.end(); param++) {
501 std::string pname = List.name(param);
502 if (coarseList && pname.find(
"coarse: ", 0) != std::string::npos) {
503 if (!coarseList->isParameter(pname) || OverWrite)
504 coarseList->setEntry(pname, List.entry(param));
505 }
else if (!inList.isParameter(pname) || OverWrite) {
506 inList.setEntry(pname, List.entry(param));
519 int *ioptions,
double *iparams,
const bool OverWrite) {
520 Teuchos::RCP<std::vector<int> > options;
521 Teuchos::RCP<std::vector<double> > params;
524 const int MUELU_AZ_OPTIONS_SIZE = 47;
525 const int MUELU_AZ_PARAMS_SIZE = 30;
531 if (ioptions == NULL)
532 options = rcp(
new std::vector<int>(MUELU_AZ_OPTIONS_SIZE));
534 options = rcp(
new std::vector<int>(ioptions, ioptions + MUELU_AZ_OPTIONS_SIZE));
536 params = rcp(
new std::vector<double>(MUELU_AZ_PARAMS_SIZE));
538 params = rcp(
new std::vector<double>(iparams, iparams + MUELU_AZ_PARAMS_SIZE));
543 if (ProblemType ==
"SA") {
545 }
else if (ProblemType ==
"DD") {
547 }
else if (ProblemType ==
"DD-ML") {
549 }
else if (ProblemType ==
"maxwell" || ProblemType ==
"Maxwell") {
551 }
else if (ProblemType ==
"NSSA") {
553 }
else if (ProblemType ==
"DD-ML-LU") {
555 }
else if (ProblemType ==
"DD-LU") {
557 }
else if (ProblemType ==
"Classical-AMG") {
560 std::cerr <<
"ERROR: Wrong input parameter in `SetDefaults' ("
561 << ProblemType <<
"). Should be: " << std::endl
562 <<
"ERROR: <SA> / <DD> / <DD-ML> / <maxwell>" << std::endl;
869 Teuchos::ParameterList ListRF, List11, List11c, List22, dummy;
870 Teuchos::ParameterList &List11_ = inList.sublist(
"refmaxwell: 11list");
871 Teuchos::ParameterList &List22_ = inList.sublist(
"refmaxwell: 22list");
872 Teuchos::ParameterList &List11c_ = List11_.sublist(
"edge matrix free: coarse");
876 List11c.remove(
"parameterlist: syntax");
877 List11c.set(
"cycle applications", 1);
878 List11c.set(
"smoother: type",
"Chebyshev");
879 List11c.set(
"aggregation: threshold", .01);
880 List11c.set(
"coarse: type",
"Amesos-KLU");
881 List11c.set(
"ML label",
"coarse (1,1) block");
886 List11.remove(
"parameterlist: syntax");
887 List11.set(
"cycle applications", 1);
888 List11.set(
"aggregation: type",
"Uncoupled");
889 List11.set(
"smoother: sweeps", 0);
890 List11.set(
"aggregation: damping factor", 0.0);
891 List11.set(
"edge matrix free: coarse", List11c);
892 List11.set(
"aggregation: threshold", .01);
897 List22.remove(
"parameterlist: syntax");
898 List22.set(
"cycle applications", 1);
899 List22.set(
"smoother: type",
"Chebyshev");
900 List22.set(
"aggregation: type",
"Uncoupled");
901 List22.set(
"aggregation: threshold", .01);
902 List22.set(
"coarse: type",
"Amesos-KLU");
903 List22.set(
"ML label",
"(2,2) block");
911 ListRF.set(
"smoother: type",
"Chebyshev");
912 ListRF.set(
"smoother: sweeps", 2);
913 ListRF.set(
"refmaxwell: 11solver",
"edge matrix free");
914 ListRF.set(
"refmaxwell: 11list", List11);
915 ListRF.set(
"refmaxwell: 22solver",
"multilevel");
916 ListRF.set(
"refmaxwell: 22list", List22);
917 ListRF.set(
"refmaxwell: mode",
"additive");
918 ListRF.set(
"default values",
"RefMaxwell");
919 ListRF.set(
"zero starting solution",
false);
922 ListRF.set(
"parameterlist: syntax",
"ml");