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>,
68 public Teuchos::Describable {
74 void setCLP(Teuchos::CommandLineProcessor& clp) {
76 const int maxOptions = 2;
78 const char* optionNames[maxOptions];
80 std::stringstream documentation;
82 documentation <<
"linear algebra library (";
85 #if defined(HAVE_XPETRA_EPETRA)
86 documentation <<
"Epetra";
90 optionNames[nOptions] =
"Epetra";
93 #if defined(HAVE_XPETRA_TPETRA)
94 #if defined(HAVE_XPETRA_EPETRA)
95 documentation <<
", ";
97 documentation <<
"Tpetra";
101 optionNames[nOptions] =
"Tpetra";
104 documentation <<
")";
106 clp.setOption<
Xpetra::UnderlyingLib>(
"linAlgebra", &
lib_, nOptions, optionValues, optionNames, documentation.str().c_str());
108 #if defined(HAVE_XPETRA_TPETRA)
109 int nInstOptions = 0;
110 const int maxInstOptions = 5;
112 const char* instOptionNames[maxInstOptions];
117 #if defined(HAVE_MUELU_INST_DOUBLE_INT_INT) || defined(HAVE_TPETRA_INST_DOUBLE) && defined(HAVE_TPETRA_INST_INT_INT)
120 instOptionNames[nInstOptions] =
"DOUBLE_INT_INT";
123 #if defined(HAVE_MUELU_INST_DOUBLE_INT_LONGINT) || defined(HAVE_TPETRA_INST_DOUBLE) && defined(HAVE_TPETRA_INST_INT_LONG)
126 instOptionNames[nInstOptions] =
"DOUBLE_INT_LONGINT";
129 #if defined(HAVE_MUELU_INST_DOUBLE_INT_LONGLONGINT) || defined(HAVE_TPETRA_INST_DOUBLE) && defined(HAVE_TPETRA_INST_INT_LONG_LONG)
132 instOptionNames[nInstOptions] =
"DOUBLE_INT_LONGLONGINT";
135 #if defined(HAVE_MUELU_INST_COMPLEX_INT_INT) || defined(HAVE_TPETRA_INST_COMPLEX_DOUBLE) && defined(HAVE_TPETRA_INST_INT_INT)
138 instOptionNames[nInstOptions] =
"COMPLEX_INT_INT";
141 #if defined(HAVE_MUELU_INST_FLOAT_INT_INT) || defined(HAVE_TPETRA_INST_FLOAT) && defined(HAVE_TPETRA_INST_INT_INT)
144 instOptionNames[nInstOptions] =
"FLOAT_INT_INT";
147 std::stringstream instDocumentation;
148 instDocumentation <<
"choice of instantiation";
150 clp.setOption<
Xpetra::Instantiation>(
"instantiation", &
inst_, nInstOptions, instOptionValues, instOptionNames, instDocumentation.str().c_str());
173 std::ostringstream out;
174 out << Teuchos::Describable::description();
180 void describe(Teuchos::FancyOStream& out,
const Teuchos::EVerbosityLevel verbLevel = verbLevel_default)
const {
182 int vl = (verbLevel == Teuchos::VERB_DEFAULT) ? Teuchos::VERB_LOW : verbLevel;
183 if (vl == Teuchos::VERB_NONE)
return;
185 if (vl == Teuchos::VERB_LOW) {
188 out << Teuchos::Describable::description() << endl;
191 if (vl == Teuchos::VERB_MEDIUM || vl == Teuchos::VERB_HIGH || vl == Teuchos::VERB_EXTREME) {
192 Teuchos::OSTab tab1(out);
193 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)