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;
84 documentation <<
"linear algebra library (";
87 #if defined(HAVE_XPETRA_EPETRA) 88 documentation <<
"Epetra";
92 optionNames[nOptions] =
"Epetra";
95 #if defined(HAVE_XPETRA_TPETRA) 96 # if defined(HAVE_XPETRA_EPETRA) 97 documentation <<
", ";
99 documentation <<
"Tpetra";
103 optionNames[nOptions] =
"Tpetra";
106 documentation <<
")";
108 clp.setOption<
Xpetra::UnderlyingLib>(
"linAlgebra", &
lib_, nOptions, optionValues, optionNames, documentation.str().c_str());
110 #if defined(HAVE_XPETRA_TPETRA) 112 const int maxInstOptions=5;
114 const char * instOptionNames [maxInstOptions];
119 # if defined(HAVE_MUELU_INST_DOUBLE_INT_INT) || defined(HAVE_TPETRA_INST_DOUBLE) && defined(HAVE_TPETRA_INST_INT_INT) 122 instOptionNames[nInstOptions] =
"DOUBLE_INT_INT";
125 # if defined(HAVE_MUELU_INST_DOUBLE_INT_LONGINT) || defined(HAVE_TPETRA_INST_DOUBLE) && defined(HAVE_TPETRA_INST_INT_LONG) 128 instOptionNames[nInstOptions] =
"DOUBLE_INT_LONGINT";
131 # if defined(HAVE_MUELU_INST_DOUBLE_INT_LONGLONGINT) || defined(HAVE_TPETRA_INST_DOUBLE) && defined(HAVE_TPETRA_INST_INT_LONG_LONG) 134 instOptionNames[nInstOptions] =
"DOUBLE_INT_LONGLONGINT";
137 # if defined(HAVE_MUELU_INST_COMPLEX_INT_INT) || defined(HAVE_TPETRA_INST_COMPLEX_DOUBLE) && defined(HAVE_TPETRA_INST_INT_INT) 140 instOptionNames[nInstOptions] =
"COMPLEX_INT_INT";
143 # if defined(HAVE_MUELU_INST_FLOAT_INT_INT) || defined(HAVE_TPETRA_INST_FLOAT) && defined(HAVE_TPETRA_INST_INT_INT) 146 instOptionNames[nInstOptions] =
"FLOAT_INT_INT";
149 std::stringstream instDocumentation;
150 instDocumentation <<
"choice of instantiation";
152 clp.setOption<
Xpetra::Instantiation>(
"instantiation", &
inst_, nInstOptions, instOptionValues, instOptionNames, instDocumentation.str().c_str());
176 std::ostringstream out;
177 out << Teuchos::Describable::description();
183 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = verbLevel_default)
const {
185 int vl = (verbLevel == Teuchos::VERB_DEFAULT) ? Teuchos::VERB_LOW : verbLevel;
186 if (vl == Teuchos::VERB_NONE)
return;
188 if (vl == Teuchos::VERB_LOW) { out <<
description() << endl; }
else { out << Teuchos::Describable::description() << endl; }
190 if (vl == Teuchos::VERB_MEDIUM || vl == Teuchos::VERB_HIGH || vl == Teuchos::VERB_EXTREME) {
191 Teuchos::OSTab tab1(out);
192 out <<
"Linear algebra library: " <<
toString(
lib_) << endl;
std::string toString(Xpetra::UnderlyingLib lib)
Convert a Xpetra::UnderlyingLib to a std::string.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
void setCLP(Teuchos::CommandLineProcessor &clp)
Xpetra::Instantiation GetInstantiation() const
std::string description() const
Return a simple one-line description of this object.
Xpetra::UnderlyingLib lib_
Xpetra::Instantiation inst_
Xpetra::UnderlyingLib GetLib() const
Parameters(Teuchos::CommandLineProcessor &clp)