46 #ifndef XPETRA_PARAMETERS_HPP
47 #define XPETRA_PARAMETERS_HPP
49 #include <Teuchos_Describable.hpp>
50 #include <Teuchos_VerboseObject.hpp>
51 #include <Teuchos_CommandLineProcessor.hpp>
53 #include <Xpetra_Map.hpp>
67 :
public Teuchos::VerboseObject<Parameters>,
public Teuchos::Describable
76 void setCLP(Teuchos::CommandLineProcessor& clp) {
78 const int maxOptions=2;
80 const char* optionNames [maxOptions];
82 std::stringstream documentation;
83 documentation <<
"linear algebra library (Epetra, Tpetra)";
86 #if defined(HAVE_XPETRA_EPETRA)
90 optionNames[nOptions] =
"Epetra";
93 #if defined(HAVE_XPETRA_TPETRA)
97 optionNames[nOptions] =
"Tpetra";
101 clp.setOption<
Xpetra::UnderlyingLib>(
"linAlgebra", &
lib_, nOptions, optionValues, optionNames, documentation.str().c_str());
103 #if defined(HAVE_XPETRA_TPETRA)
105 const int maxInstOptions=5;
107 const char * instOptionNames [maxInstOptions];
112 # if defined(HAVE_MUELU_INST_DOUBLE_INT_INT) || defined(HAVE_TPETRA_INST_DOUBLE) && defined(HAVE_TPETRA_INST_INT_INT)
115 instOptionNames[nInstOptions] =
"DOUBLE_INT_INT";
118 # if defined(HAVE_MUELU_INST_DOUBLE_INT_LONGINT) || defined(HAVE_TPETRA_INST_DOUBLE) && defined(HAVE_TPETRA_INST_INT_LONG)
121 instOptionNames[nInstOptions] =
"DOUBLE_INT_LONGINT";
124 # if defined(HAVE_MUELU_INST_DOUBLE_INT_LONGLONGINT) || defined(HAVE_TPETRA_INST_DOUBLE) && defined(HAVE_TPETRA_INST_INT_LONG_LONG)
127 instOptionNames[nInstOptions] =
"DOUBLE_INT_LONGLONGINT";
130 # if defined(HAVE_MUELU_INST_COMPLEX_INT_INT) || defined(HAVE_TPETRA_INST_COMPLEX_DOUBLE) && defined(HAVE_TPETRA_INST_INT_INT)
133 instOptionNames[nInstOptions] =
"COMPLEX_INT_INT";
136 # if defined(HAVE_MUELU_INST_FLOAT_INT_INT) || defined(HAVE_TPETRA_INST_FLOAT) && defined(HAVE_TPETRA_INST_INT_INT)
139 instOptionNames[nInstOptions] =
"FLOAT_INT_INT";
142 std::stringstream instDocumentation;
143 instDocumentation <<
"choice of instantiation";
145 clp.setOption<
Xpetra::Instantiation>(
"instantiation", &
inst_, nInstOptions, instOptionValues, instOptionNames, instDocumentation.str().c_str());
169 std::ostringstream out;
170 out << Teuchos::Describable::description();
176 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = verbLevel_default)
const {
178 int vl = (verbLevel == Teuchos::VERB_DEFAULT) ? Teuchos::VERB_LOW : verbLevel;
179 if (vl == Teuchos::VERB_NONE)
return;
181 if (vl == Teuchos::VERB_LOW) { out <<
description() << endl; }
else { out << Teuchos::Describable::description() << endl; }
183 if (vl == Teuchos::VERB_MEDIUM || vl == Teuchos::VERB_HIGH || vl == Teuchos::VERB_EXTREME) {
184 Teuchos::OSTab tab1(out);
185 out <<
"Linear algebra library: " <<
toString(
lib_) << endl;
std::string toString(Xpetra::UnderlyingLib lib)
Convert a Xpetra::UnderlyingLib to a std::string.
void setCLP(Teuchos::CommandLineProcessor &clp)
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
std::string description() const
Return a simple one-line description of this object.
Xpetra::Instantiation GetInstantiation() const
Xpetra::UnderlyingLib lib_
Xpetra::UnderlyingLib GetLib() const
Xpetra::Instantiation inst_
Parameters(Teuchos::CommandLineProcessor &clp)