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) {
44 if (paramList.isParameter(mode +
" pre or post"))
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") {
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") {
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);
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);
138 if (paramList.isParameter(
"smoother: sweeps")) {
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";
218 TEUCHOS_TEST_FOR_EXCEPTION(
true,
Exceptions::RuntimeError,
"MueLu::MLParameterListTranslator: unknown smoother type. '" << subSmootherType <<
"' not supported by MueLu.");
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";
228 if (paramList.isParameter(edge_sweeps)) {
229 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"" << paramList.get<
int>(edge_sweeps) <<
"\"/>" << std::endl;
230 adaptingParamList.remove(
"subsmoother: edge sweeps",
false);
232 if (paramList.isParameter(cheby_alpha)) {
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";
239 if (paramList.isParameter(edge_sweeps)) {
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);
244 if (paramList.isParameter(SGS_damping)) {
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";
254 if (paramList.isParameter(node_sweeps)) {
255 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"" << paramList.get<
int>(node_sweeps) <<
"\"/>" << std::endl;
256 adaptingParamList.remove(
"subsmoother: node sweeps",
false);
258 if (paramList.isParameter(cheby_alpha)) {
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";
266 if (paramList.isParameter(node_sweeps)) {
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);
271 if (paramList.isParameter(SGS_damping)) {
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;
303 if (paramList.isParameter(
"smoother: max size")) {
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();
312 Teuchos::ParameterList paramList = paramList_in;
314 RCP<Teuchos::FancyOStream> out = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout));
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 !=
"") {
330 TEUCHOS_TEST_FOR_EXCEPTION(defaultVals !=
"SA" && defaultVals !=
"NSSA" && defaultVals !=
"refmaxwell" && defaultVals !=
"Maxwell",
Exceptions::RuntimeError,
331 "MueLu::ML2MueLuParameterTranslator: only \"SA\", \"NSSA\", \"refmaxwell\" and \"Maxwell\" allowed as options for ML default parameters.");
332 Teuchos::ParameterList ML_defaultlist;
333 if (defaultVals ==
"refmaxwell")
340 paramList = ML_defaultlist;
349 ParameterList paramListWithSubList;
351 paramList = paramListWithSubList;
352 Teuchos::ParameterList adaptingParamList = paramList;
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;
389 for (ParameterList::ConstIterator param = paramListWithSubList.begin(); param != paramListWithSubList.end(); ++param) {
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;
461 typedef Teuchos::ArrayRCP<char>::size_type size_type;
462 Teuchos::Array<char> ctype(size_type(pname.size() + 1));
463 Teuchos::Array<char> coption(size_type(pname.size() + 1));
465 int matched = sscanf(pname.c_str(),
"%s %[^(](level %d)", ctype.getRawPtr(), coption.getRawPtr(), &levelID);
466 type = std::string(ctype.getRawPtr());
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;
477 mueluss <<
GetSmootherFactory(paramList.sublist(pname), adaptingParamList.sublist(pname),
"smoother: type", paramList.sublist(pname).get<std::string>(
"smoother: type"));
478 mueluss <<
"</ParameterList>" << std::endl;
482 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.");
484 if (pname ==
"coarse: list") {
491 std::string coarse_smoother =
"Amesos-KLU";
492 if (paramList.sublist(
"coarse: list").isParameter(
"smoother: type"))
493 coarse_smoother = paramList.sublist(
"coarse: list").get<std::string>(
"smoother: type");
495 mueluss <<
GetSmootherFactory(paramList.sublist(
"coarse: list"), adaptingParamList.sublist(
"coarse: list"),
"coarse: type", coarse_smoother);
498 mueluss <<
"</ParameterList>" << std::endl;
500 return mueluss.str();
504 ParameterList *coarseList = 0;
506 if (inList.isSublist(
"coarse: list"))
507 coarseList = &(inList.sublist(
"coarse: list"));
508 for (ParameterList::ConstIterator param = List.begin(); param != List.end(); param++) {
509 std::string pname = List.name(param);
510 if (coarseList && pname.find(
"coarse: ", 0) != std::string::npos) {
511 if (!coarseList->isParameter(pname) || OverWrite)
512 coarseList->setEntry(pname, List.entry(param));
513 }
else if (!inList.isParameter(pname) || OverWrite) {
514 inList.setEntry(pname, List.entry(param));
527 int *ioptions,
double *iparams,
const bool OverWrite) {
528 Teuchos::RCP<std::vector<int> > options;
529 Teuchos::RCP<std::vector<double> > params;
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;
877 Teuchos::ParameterList ListRF, List11, List11c, List22, dummy;
878 Teuchos::ParameterList &List11_ = inList.sublist(
"refmaxwell: 11list");
879 Teuchos::ParameterList &List22_ = inList.sublist(
"refmaxwell: 22list");
880 Teuchos::ParameterList &List11c_ = List11_.sublist(
"edge matrix free: coarse");
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");