本文整理汇总了C++中Teuchos::getParametersFromXmlFile方法的典型用法代码示例。如果您正苦于以下问题:C++ Teuchos::getParametersFromXmlFile方法的具体用法?C++ Teuchos::getParametersFromXmlFile怎么用?C++ Teuchos::getParametersFromXmlFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Teuchos
的用法示例。
在下文中一共展示了Teuchos::getParametersFromXmlFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[])
{
using Teuchos::describe;
using Teuchos::rcp;
using Teuchos::rcp_dynamic_cast;
using Teuchos::rcp_const_cast;
using Teuchos::RCP;
using Teuchos::CommandLineProcessor;
using Teuchos::ParameterList;
using Teuchos::sublist;
using Teuchos::getParametersFromXmlFile;
typedef ParameterList::PrintOptions PLPrintOptions;
using Thyra::inverse;
using Thyra::initializePreconditionedOp;
using Thyra::initializeOp;
using Thyra::unspecifiedPrec;
using Thyra::solve;
typedef RCP<const Thyra::LinearOpBase<double> > LinearOpPtr;
typedef RCP<Thyra::VectorBase<double> > VectorPtr;
bool success = true;
bool verbose = true;
Teuchos::GlobalMPISession mpiSession(&argc,&argv);
Teuchos::RCP<Teuchos::FancyOStream>
out = Teuchos::VerboseObjectBase::getDefaultOStream();
try {
//
// Read in options from the command line
//
CommandLineProcessor clp(false); // Don't throw exceptions
const int numVerbLevels = 6;
Teuchos::EVerbosityLevel
verbLevelValues[] =
{
Teuchos::VERB_DEFAULT, Teuchos::VERB_NONE,
Teuchos::VERB_LOW, Teuchos::VERB_MEDIUM,
Teuchos::VERB_HIGH, Teuchos::VERB_EXTREME
};
const char*
verbLevelNames[] =
{ "default", "none", "low", "medium", "high", "extreme" };
Teuchos::EVerbosityLevel verbLevel = Teuchos::VERB_MEDIUM;
clp.setOption( "verb-level", &verbLevel,
numVerbLevels, verbLevelValues, verbLevelNames,
"Verbosity level used for all objects."
);
std::string matrixFile = ".";
clp.setOption( "matrix-file", &matrixFile,
"Matrix file."
);
std::string paramListFile = "";
clp.setOption( "param-list-file", ¶mListFile,
"Parameter list for preconditioner and solver blocks."
);
bool showParams = false;
clp.setOption( "show-params", "no-show-params", &showParams,
"Show the parameter list or not."
);
bool testPrecIsLinearOp = true;
clp.setOption( "test-prec-is-linear-op", "test-prec-is-linear-op", &testPrecIsLinearOp,
"Test if the preconditioner is a linear operator or not."
);
double solveTol = 1e-8;
clp.setOption( "solve-tol", &solveTol,
"Tolerance for the solution to determine success or failure!"
);
clp.setDocString(
"This example program shows how to use one linear solver (e.g. AztecOO)\n"
"as a preconditioner for another iterative solver (e.g. Belos).\n"
);
// Note: Use --help on the command line to see the above documentation
CommandLineProcessor::EParseCommandLineReturn parse_return = clp.parse(argc,argv);
if( parse_return != CommandLineProcessor::PARSE_SUCCESSFUL ) return parse_return;
//
*out << "\nA) Reading in the matrix ...\n";
//
#ifdef HAVE_MPI
Epetra_MpiComm comm(MPI_COMM_WORLD);
#else
Epetra_SerialComm comm;
#endif
//.........这里部分代码省略.........