10 #ifndef XPETRA_PARAMETERS_HPP
11 #define XPETRA_PARAMETERS_HPP
13 #include <Teuchos_Describable.hpp>
14 #include <Teuchos_VerboseObject.hpp>
15 #include <Teuchos_CommandLineProcessor.hpp>
17 #include <Xpetra_Map.hpp>
31 :
public Teuchos::VerboseObject<Parameters>,
32 public Teuchos::Describable {
38 void setCLP(Teuchos::CommandLineProcessor& clp) {
40 const int maxOptions = 2;
42 const char* optionNames[maxOptions];
44 std::stringstream documentation;
46 documentation <<
"linear algebra library (";
49 #if defined(HAVE_XPETRA_EPETRA)
50 documentation <<
"Epetra";
54 optionNames[nOptions] =
"Epetra";
57 #if defined(HAVE_XPETRA_TPETRA)
58 #if defined(HAVE_XPETRA_EPETRA)
59 documentation <<
", ";
61 documentation <<
"Tpetra";
65 optionNames[nOptions] =
"Tpetra";
70 clp.setOption<
Xpetra::UnderlyingLib>(
"linAlgebra", &
lib_, nOptions, optionValues, optionNames, documentation.str().c_str());
72 #if defined(HAVE_XPETRA_TPETRA)
74 const int maxInstOptions = 5;
76 const char* instOptionNames[maxInstOptions];
81 #if defined(HAVE_MUELU_INST_DOUBLE_INT_INT) || defined(HAVE_TPETRA_INST_DOUBLE) && defined(HAVE_TPETRA_INST_INT_INT)
84 instOptionNames[nInstOptions] =
"DOUBLE_INT_INT";
87 #if defined(HAVE_MUELU_INST_DOUBLE_INT_LONGINT) || defined(HAVE_TPETRA_INST_DOUBLE) && defined(HAVE_TPETRA_INST_INT_LONG)
90 instOptionNames[nInstOptions] =
"DOUBLE_INT_LONGINT";
93 #if defined(HAVE_MUELU_INST_DOUBLE_INT_LONGLONGINT) || defined(HAVE_TPETRA_INST_DOUBLE) && defined(HAVE_TPETRA_INST_INT_LONG_LONG)
96 instOptionNames[nInstOptions] =
"DOUBLE_INT_LONGLONGINT";
99 #if defined(HAVE_MUELU_INST_COMPLEX_INT_INT) || defined(HAVE_TPETRA_INST_COMPLEX_DOUBLE) && defined(HAVE_TPETRA_INST_INT_INT)
102 instOptionNames[nInstOptions] =
"COMPLEX_INT_INT";
105 #if defined(HAVE_MUELU_INST_FLOAT_INT_INT) || defined(HAVE_TPETRA_INST_FLOAT) && defined(HAVE_TPETRA_INST_INT_INT)
108 instOptionNames[nInstOptions] =
"FLOAT_INT_INT";
111 std::stringstream instDocumentation;
112 instDocumentation <<
"choice of instantiation";
114 clp.setOption<
Xpetra::Instantiation>(
"instantiation", &
inst_, nInstOptions, instOptionValues, instOptionNames, instDocumentation.str().c_str());
137 std::ostringstream out;
138 out << Teuchos::Describable::description();
144 void describe(Teuchos::FancyOStream& out,
const Teuchos::EVerbosityLevel verbLevel = verbLevel_default)
const {
146 int vl = (verbLevel == Teuchos::VERB_DEFAULT) ? Teuchos::VERB_LOW : verbLevel;
147 if (vl == Teuchos::VERB_NONE)
return;
149 if (vl == Teuchos::VERB_LOW) {
152 out << Teuchos::Describable::description() << endl;
155 if (vl == Teuchos::VERB_MEDIUM || vl == Teuchos::VERB_HIGH || vl == Teuchos::VERB_EXTREME) {
156 Teuchos::OSTab tab1(out);
157 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)