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;
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);
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);
140 if (paramList.isParameter(
"smoother: sweeps")) {
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";
219 TEUCHOS_TEST_FOR_EXCEPTION(
true,
Exceptions::RuntimeError,
"MueLu::MLParameterListTranslator: unknown smoother type. '" << subSmootherType <<
"' not supported by MueLu.");
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";
229 if (paramList.isParameter(edge_sweeps)) {
230 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"" << paramList.get<
int>(edge_sweeps) <<
"\"/>" << std::endl;
231 adaptingParamList.remove(
"subsmoother: edge sweeps",
false);
233 if (paramList.isParameter(cheby_alpha)) {
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";
240 if (paramList.isParameter(edge_sweeps)) {
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);
245 if (paramList.isParameter(SGS_damping)) {
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";
255 if (paramList.isParameter(node_sweeps)) {
256 mueluss <<
"<Parameter name=\"chebyshev: degree\" type=\"int\" value=\"" << paramList.get<
int>(node_sweeps) <<
"\"/>" << std::endl;
257 adaptingParamList.remove(
"subsmoother: node sweeps",
false);
259 if (paramList.isParameter(cheby_alpha)) {
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";
267 if (paramList.isParameter(node_sweeps)) {
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);
272 if (paramList.isParameter(SGS_damping)) {
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;
304 if (paramList.isParameter(
"smoother: max size")) {
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();
313 Teuchos::ParameterList paramList = paramList_in;
315 RCP<Teuchos::FancyOStream> out = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout));
317#if defined(HAVE_MUELU_ML) && defined(HAVE_ML_EPETRA) && defined(HAVE_ML_TEUCHOS)
321 if (defaultVals !=
"") {
322 TEUCHOS_TEST_FOR_EXCEPTION(defaultVals !=
"SA" && defaultVals !=
"NSSA" && defaultVals !=
"refmaxwell" && defaultVals !=
"Maxwell",
Exceptions::RuntimeError,
323 "MueLu::MLParameterListInterpreter: only \"SA\", \"NSSA\", \"refmaxwell\" and \"Maxwell\" allowed as options for ML default parameters.");
324 Teuchos::ParameterList ML_defaultlist;
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;
347 ParameterList paramListWithSubList;
350 paramList = paramListWithSubList;
351 Teuchos::ParameterList adaptingParamList = paramList;
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);
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;
409 for (ParameterList::ConstIterator param = paramListWithSubList.begin(); param != paramListWithSubList.end(); ++param) {
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;
475 typedef Teuchos::ArrayRCP<char>::size_type size_type;
476 Teuchos::Array<char> ctype(size_type(pname.size() + 1));
477 Teuchos::Array<char> coption(size_type(pname.size() + 1));
479 int matched = sscanf(pname.c_str(),
"%s %[^(](level %d)", ctype.getRawPtr(), coption.getRawPtr(), &levelID);
480 type = std::string(ctype.getRawPtr());
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;
491 mueluss <<
GetSmootherFactory(paramList.sublist(pname), adaptingParamList.sublist(pname),
"smoother: type", paramList.sublist(pname).get<std::string>(
"smoother: type"));
492 mueluss <<
"</ParameterList>" << std::endl;
497 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.");
498 if (pname ==
"coarse: list") {
503 mueluss <<
GetSmootherFactory(paramList.sublist(
"coarse: list"), adaptingParamList.sublist(
"coarse: list"),
"coarse: type", paramList.sublist(
"coarse: list").get<std::string>(
"smoother: type"));
507 mueluss <<
"</ParameterList>" << std::endl;
509 return mueluss.str();
513 ParameterList *coarseList = 0;
515 if (inList.isSublist(
"coarse: list"))
516 coarseList = &(inList.sublist(
"coarse: list"));
517 for (ParameterList::ConstIterator param = List.begin(); param != List.end(); param++) {
518 std::string pname = List.name(param);
519 if (coarseList && pname.find(
"coarse: ", 0) != std::string::npos) {
520 if (!coarseList->isParameter(pname) || OverWrite)
521 coarseList->setEntry(pname, List.entry(param));
522 }
else if (!inList.isParameter(pname) || OverWrite) {
523 inList.setEntry(pname, List.entry(param));
536 int *ioptions,
double *iparams,
const bool OverWrite) {
537 Teuchos::RCP<std::vector<int> > options;
538 Teuchos::RCP<std::vector<double> > params;
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;
867 Teuchos::ParameterList ListRF, List11, List11c, List22, dummy;
868 Teuchos::ParameterList &List11_ = inList.sublist(
"refmaxwell: 11list");
869 Teuchos::ParameterList &List22_ = inList.sublist(
"refmaxwell: 22list");
870 Teuchos::ParameterList &List11c_ = List11_.sublist(
"edge matrix free: coarse");
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);