10#ifndef MUELU_ML2MUELUPARAMETERTRANSLATOR_HPP
11#define MUELU_ML2MUELUPARAMETERTRANSLATOR_HPP
17#include <Teuchos_ParameterList.hpp>
18#include <Teuchos_XMLParameterListCoreHelpers.hpp>
19#include <Teuchos_RCP.hpp>
53 static std::string
translate(Teuchos::ParameterList& paramList,
const std::string& defaultVals =
"") {
61 static std::string
translate(
const std::string& xmlFileName,
const std::string& defaultVals =
"") {
62 Teuchos::RCP<Teuchos::ParameterList> paramList = Teuchos::getParametersFromXmlFile(xmlFileName);
93 static int SetDefaults(std::string ProblemType, Teuchos::ParameterList& List,
94 int* options = 0,
double* params = 0,
const bool OverWrite =
true);
98 Teuchos::RCP<std::vector<int> >& options,
99 Teuchos::RCP<std::vector<double> >& params,
100 bool Overwrite =
true);
104 Teuchos::RCP<std::vector<int> >& options,
105 Teuchos::RCP<std::vector<double> >& params,
106 bool Overwrite =
true);
110 Teuchos::RCP<std::vector<int> >& options,
111 Teuchos::RCP<std::vector<double> >& params,
112 bool Overwrite =
true);
116 Teuchos::RCP<std::vector<int> >& options,
117 Teuchos::RCP<std::vector<double> >& params,
118 bool Overwrite =
true);
122 Teuchos::RCP<std::vector<int> >& options,
123 Teuchos::RCP<std::vector<double> >& params,
124 bool Overwrite =
true);
128 Teuchos::RCP<std::vector<int> >& options,
129 Teuchos::RCP<std::vector<double> >& params,
130 bool Overwrite =
true);
134 Teuchos::RCP<std::vector<int> >& options,
135 Teuchos::RCP<std::vector<double> >& params,
136 bool Overwrite =
true);
140 Teuchos::RCP<std::vector<int> >& options,
141 Teuchos::RCP<std::vector<double> >& params,
142 bool Overwrite =
true);
156 static std::string
SetParameterList(
const Teuchos::ParameterList& paramList_in,
const std::string& defaultVals);
164 static std::string
GetSmootherFactory(
const Teuchos::ParameterList& paramList, Teuchos::ParameterList& adaptingParamList,
const std::string& pname,
const std::string& value);
173 static inline std::string&
ltrim(std::string& s) {
174 s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](
int c) { return !std::isspace(c); }));
179 static inline std::string&
rtrim(std::string& s) {
180 s.erase(std::find_if(s.rbegin(), s.rend(), [](
int c) { return !std::isspace(c); }).base(), s.end());
185 static inline std::string&
trim(std::string& s) {
Class that accepts ML-style parameters and builds a MueLu parameter list (easy input deck)
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.
ML2MueLuParameterTranslator()
Constructor.
static std::string & trim(std::string &s)
static std::string translate(const std::string &xmlFileName, const std::string &defaultVals="")
: Translate ML parameters to MueLu parameter XML string
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 std::string & ltrim(std::string &s)
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.
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.
static std::string SetParameterList(const Teuchos::ParameterList ¶mList_in, const std::string &defaultVals)
: Interpret parameter list
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 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.
static int SetDefaultsRefMaxwell(Teuchos::ParameterList &inList, bool OverWrite=true)
Sets defaults for RefMaxwell / Maxwell2.
static std::string translate(Teuchos::ParameterList ¶mList, const std::string &defaultVals="")
: Translate ML parameters to MueLu parameter XML string
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.
virtual ~ML2MueLuParameterTranslator()
Destructor.
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,...
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
static std::string & rtrim(std::string &s)
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.
Namespace for MueLu classes and methods.