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> 59 :
public Teuchos::VerboseObject<Parameters>,
public Teuchos::Describable
68 void setCLP(Teuchos::CommandLineProcessor& clp) {
70 const int maxOptions=2;
72 const char* optionNames [maxOptions];
74 std::stringstream documentation;
75 documentation <<
"linear algebra library (Epetra, Tpetra)";
78 #if defined(HAVE_XPETRA_EPETRA) 82 optionNames[nOptions] =
"Epetra";
85 #if defined(HAVE_XPETRA_TPETRA) 89 optionNames[nOptions] =
"Tpetra";
93 clp.setOption<
Xpetra::UnderlyingLib>(
"linAlgebra", &
lib_, nOptions, optionValues, optionNames, documentation.str().c_str());
111 std::ostringstream out;
112 out << Teuchos::Describable::description();
118 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = verbLevel_default)
const {
120 int vl = (verbLevel == Teuchos::VERB_DEFAULT) ? Teuchos::VERB_LOW : verbLevel;
121 if (vl == Teuchos::VERB_NONE)
return;
123 if (vl == Teuchos::VERB_LOW) { out <<
description() << endl; }
else { out << Teuchos::Describable::description() << endl; }
125 if (vl == Teuchos::VERB_MEDIUM || vl == Teuchos::VERB_HIGH || vl == Teuchos::VERB_EXTREME) {
126 Teuchos::OSTab tab1(out);
127 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)
std::string description() const
Return a simple one-line description of this object.
Xpetra::UnderlyingLib lib_
Xpetra::UnderlyingLib GetLib() const
Parameters(Teuchos::CommandLineProcessor &clp)