Commit a1507467 authored by Sidafa Conde's avatar Sidafa Conde
Browse files

Merge branch 'master' of software.sandia.gov:/space/git/Trilinos

parents 63887c85 518fa092
......@@ -54,7 +54,7 @@
namespace MueLu {
std::string ML2MueLuParameterTranslator::GetSmootherFactory(const Teuchos::ParameterList& paramList, Teuchos::ParameterList& adaptingParamList, const std::string& pname, const std::string& value) {
TEUCHOS_TEST_FOR_EXCEPTION(pname != "coarse: type" && pname != "coarse: list" && pname != "smoother: type" && pname.find("smoother: list",0) != 0, Exceptions::RuntimeError, "MueLu::MLParameterListInterpreter::Setup(): Only \"coarse: type\", \"smoother: type\" or \"smoother: list\" (\"coarse: list\") are supported as ML parameters for transformation of smoother/solver parameters to MueLu");
......@@ -97,7 +97,7 @@ namespace MueLu {
mueluss << "<Parameter name=" << my_name << " type=\"string\" value=\"CHEBYSHEV\"/>" << std::endl;
} else if (valuestr.length() > strlen("amesos") && valuestr.substr(0, strlen("amesos")) == "amesos") { /* catch Amesos-* */
std::string solverType = valuestr.substr(strlen("amesos")+1); /* ("amesos-klu" -> "klu") */
bool valid = false;
const int validatorSize = 5;
std::string validator[validatorSize] = {"superlu", "superludist", "klu", "umfpack"};
......@@ -126,7 +126,7 @@ namespace MueLu {
} else {
mueluss << "<ParameterList name=\"" << mode << " params\">" << std::endl;
}
// relaxation based smoothers:
if ( valuestr == "jacobi" || valuestr == "gauss-seidel" || valuestr == "symmetric gauss-seidel" ) {
......@@ -162,11 +162,11 @@ namespace MueLu {
if ( paramList.isParameter("smoother: max size") ) {
mueluss << "<Parameter name=\"coarse: max size\" type=\"int\" value=\"" << paramList.get<int>("smoother: max size") << "\"/>" << std::endl; adaptingParamList.remove("smoother: max size",false);
}
return mueluss.str();
}
std::string ML2MueLuParameterTranslator::SetParameterList(const Teuchos::ParameterList & paramList_in, const std::string& defaultVals) {
Teuchos::ParameterList paramList = paramList_in;
......@@ -192,7 +192,7 @@ namespace MueLu {
*out << "Warning: MueLu_ENABLE_ML=OFF. No ML default values available." << std::endl;
}
#endif // HAVE_MUELU_ML
//
// Move smoothers/aggregation/coarse parameters to sublists
//
......@@ -245,26 +245,34 @@ namespace MueLu {
replaceAll(valuestr, "[unused]", "");
replaceAll(valuestr, "[default]", "");
valuestr = trim(valuestr);
// transform ML parameter to corresponding MueLu parameter and generate XML string
std::string valueInterpreterStr = "\"" + valuestr + "\"";
std::string ret = MasterList::interpretParameterName(MasterList::ML2MueLu(pname),valueInterpreterStr);
// add XML string
if (ret != "") {
mueluss << ret << std::endl;
// remove parameter from ML parameter list
adaptingParamList.remove(pname,false);
}
// special handling for energy minimization
// TAW: this is not optimal for symmetric problems but at least works.
// for symmetric problems the "energy minimization" parameter should not exist anyway...
if (pname == "energy minimization: enable") {
mueluss << "<Parameter name=\"problem: symmetric\" type=\"bool\" value=\"false\"/>" << std::endl;
mueluss << "<Parameter name=\"transpose: use implicit\" type=\"bool\" value=\"false\"/>" << std::endl;
}
// special handling for smoothers
if (pname == "smoother: type") {
mueluss << GetSmootherFactory(paramList, adaptingParamList, pname, valuestr);
}
// special handling for level-specific smoothers
if (pname.find("smoother: list (level",0) == 0) {
// Scan pname (ex: pname="smoother: type (level 2)")
......@@ -284,17 +292,17 @@ namespace MueLu {
<< "Error in creating level-specific sublists" << std::endl
<< "Offending parameter: " << pname << std::endl);
}
mueluss << "<ParameterList name=\"level " << levelID << "\">" << std::endl;
mueluss << GetSmootherFactory(paramList.sublist(pname),adaptingParamList.sublist(pname), "smoother: type", paramList.sublist(pname).get<std::string>("smoother: type"));
mueluss << "</ParameterList>" << std::endl;
}
}
// special handling for coarse level
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.");
if ( pname == "coarse: list" ) {
// interpret smoother/coarse solver data.
// Note, that we inspect the "coarse: list" sublist to define the "coarse" smoother/solver
// Be aware, that MueLu::CreateSublists renames the prefix of the parameters in the "coarse: list" from "coarse" to "smoother".
......@@ -306,7 +314,7 @@ namespace MueLu {
}
} // for
mueluss << "</ParameterList>" << std::endl;
......@@ -314,5 +322,5 @@ namespace MueLu {
return mueluss.str();
}
} // namespace MueLu
<ParameterList name="MueLu">
<Parameter name="multigrid algorithm" type="string" value="pg"/>
<Parameter name="problem: symmetric" type="bool" value="false"/>
</ParameterList>
......@@ -11,6 +11,10 @@
<Parameter name="factory" type="string" value="PgPFactory"/>
</ParameterList>
<ParameterList name="myRestrictorFact">
<Parameter name="factory" type="string" value="GenericRFactory"/>
</ParameterList>
</ParameterList>
<ParameterList name="Hierarchy">
......@@ -21,6 +25,7 @@
<Parameter name="DofsPerNode" type="string" value="myCoalesceDropFact"/>
<Parameter name="Graph" type="string" value="myCoalesceDropFact"/>
<Parameter name="P" type="string" value="myProlongatorFact"/>
<Parameter name="R" type="string" value="myRestrictorFact"/>
</ParameterList>
</ParameterList>
......
......@@ -44,11 +44,16 @@ Level 1
Minimization norm = 2 [default]
ReUseRowBasedOmegas = 0 [default]
Transpose P (MueLu::TransPFactory)
Call prolongator factory for calculating restrictor (MueLu::GenericRFactory)
Prolongator smoothing (PG-AMG) (MueLu::PgPFactory)
PgPFactory::ComputeRowBasedOmega (MueLu::PgPFactory)
Minimization norm = 2 [default]
ReUseRowBasedOmegas = 0 [default]
[empty list]
Computing Ac (MueLu::RAPFactory)
transpose: use implicit = 0 [default]
transpose: use implicit = 0
Keep AP Pattern = 0 [default]
Keep RAP Pattern = 0 [default]
CheckMainDiagonal = 0 [default]
......@@ -99,11 +104,16 @@ Level 2
Minimization norm = 2 [default]
ReUseRowBasedOmegas = 0 [default]
Transpose P (MueLu::TransPFactory)
Call prolongator factory for calculating restrictor (MueLu::GenericRFactory)
Prolongator smoothing (PG-AMG) (MueLu::PgPFactory)
PgPFactory::ComputeRowBasedOmega (MueLu::PgPFactory)
Minimization norm = 2 [default]
ReUseRowBasedOmegas = 0 [default]
[empty list]
Computing Ac (MueLu::RAPFactory)
transpose: use implicit = 0 [default]
transpose: use implicit = 0
Keep AP Pattern = 0 [default]
Keep RAP Pattern = 0 [default]
CheckMainDiagonal = 0 [default]
......@@ -154,11 +164,16 @@ Level 3
Minimization norm = 2 [default]
ReUseRowBasedOmegas = 0 [default]
Transpose P (MueLu::TransPFactory)
Call prolongator factory for calculating restrictor (MueLu::GenericRFactory)
Prolongator smoothing (PG-AMG) (MueLu::PgPFactory)
PgPFactory::ComputeRowBasedOmega (MueLu::PgPFactory)
Minimization norm = 2 [default]
ReUseRowBasedOmegas = 0 [default]
[empty list]
Computing Ac (MueLu::RAPFactory)
transpose: use implicit = 0 [default]
transpose: use implicit = 0
Keep AP Pattern = 0 [default]
Keep RAP Pattern = 0 [default]
CheckMainDiagonal = 0 [default]
......@@ -209,11 +224,16 @@ Level 4
Minimization norm = 2 [default]
ReUseRowBasedOmegas = 0 [default]
Transpose P (MueLu::TransPFactory)
Call prolongator factory for calculating restrictor (MueLu::GenericRFactory)
Prolongator smoothing (PG-AMG) (MueLu::PgPFactory)
PgPFactory::ComputeRowBasedOmega (MueLu::PgPFactory)
Minimization norm = 2 [default]
ReUseRowBasedOmegas = 0 [default]
[empty list]
Computing Ac (MueLu::RAPFactory)
transpose: use implicit = 0 [default]
transpose: use implicit = 0
Keep AP Pattern = 0 [default]
Keep RAP Pattern = 0 [default]
CheckMainDiagonal = 0 [default]
......
......@@ -49,11 +49,16 @@ Level 1
sa: calculate eigenvalue estimate = 0 [default]
sa: eigenvalue estimate num iterations = 10 [default]
Transpose P (MueLu::TransPFactory)
Call prolongator factory for calculating restrictor (MueLu::GenericRFactory)
Prolongator smoothing (MueLu::SaPFactory)
sa: damping factor = 1.333
sa: calculate eigenvalue estimate = 0 [default]
sa: eigenvalue estimate num iterations = 10 [default]
[empty list]
Computing Ac (MueLu::RAPFactory)
transpose: use implicit = 0 [default]
transpose: use implicit = 0
Keep AP Pattern = 0 [default]
Keep RAP Pattern = 0 [default]
CheckMainDiagonal = 0 [default]
......@@ -109,11 +114,16 @@ Level 2
sa: calculate eigenvalue estimate = 0 [default]
sa: eigenvalue estimate num iterations = 10 [default]
Transpose P (MueLu::TransPFactory)
Call prolongator factory for calculating restrictor (MueLu::GenericRFactory)
Prolongator smoothing (MueLu::SaPFactory)
sa: damping factor = 1.333
sa: calculate eigenvalue estimate = 0 [default]
sa: eigenvalue estimate num iterations = 10 [default]
[empty list]
Computing Ac (MueLu::RAPFactory)
transpose: use implicit = 0 [default]
transpose: use implicit = 0
Keep AP Pattern = 0 [default]
Keep RAP Pattern = 0 [default]
CheckMainDiagonal = 0 [default]
......@@ -169,11 +179,16 @@ Level 3
sa: calculate eigenvalue estimate = 0 [default]
sa: eigenvalue estimate num iterations = 10 [default]
Transpose P (MueLu::TransPFactory)
Call prolongator factory for calculating restrictor (MueLu::GenericRFactory)
Prolongator smoothing (MueLu::SaPFactory)
sa: damping factor = 1.333
sa: calculate eigenvalue estimate = 0 [default]
sa: eigenvalue estimate num iterations = 10 [default]
[empty list]
Computing Ac (MueLu::RAPFactory)
transpose: use implicit = 0 [default]
transpose: use implicit = 0
Keep AP Pattern = 0 [default]
Keep RAP Pattern = 0 [default]
CheckMainDiagonal = 0 [default]
......@@ -229,11 +244,16 @@ Level 4
sa: calculate eigenvalue estimate = 0 [default]
sa: eigenvalue estimate num iterations = 10 [default]
Transpose P (MueLu::TransPFactory)
Call prolongator factory for calculating restrictor (MueLu::GenericRFactory)
Prolongator smoothing (MueLu::SaPFactory)
sa: damping factor = 1.333
sa: calculate eigenvalue estimate = 0 [default]
sa: eigenvalue estimate num iterations = 10 [default]
[empty list]
Computing Ac (MueLu::RAPFactory)
transpose: use implicit = 0 [default]
transpose: use implicit = 0
Keep AP Pattern = 0 [default]
Keep RAP Pattern = 0 [default]
CheckMainDiagonal = 0 [default]
......
......@@ -44,7 +44,12 @@ Level 1
Minimization norm = 2 [default]
ReUseRowBasedOmegas = 0 [default]
Transpose P (MueLu::TransPFactory)
Call prolongator factory for calculating restrictor (MueLu::GenericRFactory)
Prolongator smoothing (PG-AMG) (MueLu::PgPFactory)
PgPFactory::ComputeRowBasedOmega (MueLu::PgPFactory)
Minimization norm = 2 [default]
ReUseRowBasedOmegas = 0 [default]
[empty list]
Computing Ac (MueLu::RAPFactory)
......@@ -99,7 +104,12 @@ Level 2
Minimization norm = 2 [default]
ReUseRowBasedOmegas = 0 [default]
Transpose P (MueLu::TransPFactory)
Call prolongator factory for calculating restrictor (MueLu::GenericRFactory)
Prolongator smoothing (PG-AMG) (MueLu::PgPFactory)
PgPFactory::ComputeRowBasedOmega (MueLu::PgPFactory)
Minimization norm = 2 [default]
ReUseRowBasedOmegas = 0 [default]
[empty list]
Computing Ac (MueLu::RAPFactory)
......
......@@ -52,7 +52,12 @@ Level 1
Minimization norm = 2 [default]
ReUseRowBasedOmegas = 0 [default]
Transpose P (MueLu::TransPFactory)
Call prolongator factory for calculating restrictor (MueLu::GenericRFactory)
Prolongator smoothing (PG-AMG) (MueLu::PgPFactory)
PgPFactory::ComputeRowBasedOmega (MueLu::PgPFactory)
Minimization norm = 2 [default]
ReUseRowBasedOmegas = 0 [default]
[empty list]
Computing Ac (MueLu::RAPFactory)
......@@ -115,7 +120,12 @@ Level 2
Minimization norm = 2 [default]
ReUseRowBasedOmegas = 0 [default]
Transpose P (MueLu::TransPFactory)
Call prolongator factory for calculating restrictor (MueLu::GenericRFactory)
Prolongator smoothing (PG-AMG) (MueLu::PgPFactory)
PgPFactory::ComputeRowBasedOmega (MueLu::PgPFactory)
Minimization norm = 2 [default]
ReUseRowBasedOmegas = 0 [default]
[empty list]
Computing Ac (MueLu::RAPFactory)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment