15 int main(
int argc,
char* argv[])
33 std::string matrixFile =
"";
34 bool testTranspose =
true;
35 int numRandomVectors = 1;
36 double maxFwdError = 1e-14;
37 int maxIterations = 400;
38 double maxResid = 1e-6;
39 double maxSolutionError = 1e-6;
42 std::string aztecOutputLevel =
"freq";
43 int aztecOutputFreq = 0;
44 std::string aztecPrec =
"none";
45 std::string aztecSubdomainSolve =
"ilu";
47 CommandLineProcessor clp(
false);
48 clp.setOption(
"matrix-file", &matrixFile,
"Matrix input file [Required]." );
49 clp.setOption(
"test-transpose",
"no-test-transpose", &testTranspose,
"Test the transpose solve or not." );
50 clp.setOption(
"num-random-vectors", &numRandomVectors,
"Number of times a test is performed with different random vectors." );
51 clp.setOption(
"max-fwd-error", &maxFwdError,
"The maximum relative error in the forward operator." );
52 clp.setOption(
"max-iters", &maxIterations,
"The maximum number of linear solver iterations to take." );
53 clp.setOption(
"max-resid", &maxResid,
"The maximum relative error in the residual." );
54 clp.setOption(
"max-solution-error", &maxSolutionError,
"The maximum relative error in the solution of the linear system." );
55 clp.setOption(
"verbose",
"quiet", &verbose,
"Set if output is printed or not." );
56 clp.setOption(
"show-all-tests",
"no-show-all-tests", &showAllTests,
"Set if all the tests are shown or not." );
57 clp.setOption(
"dump-all",
"no-dump-all", &dumpAll,
"Determines if vectors are printed or not." );
58 clp.setOption(
"aztec-output-level", &aztecOutputLevel,
"Aztec output level (freq,last,summary,warnings,all)" );
59 clp.setOption(
"aztec-output-freq", &aztecOutputFreq,
"Aztec output freqency (> 0)" );
60 clp.setOption(
"aztec-prec", &aztecPrec,
"Type of aztec preconditioner (none,sym_GS,Neumann,Jacobi,ls,dom_decomp)" );
61 clp.setOption(
"aztec-subdomain-solve", &aztecSubdomainSolve,
"Type of subdomain solve for --aztec-prec==dom_decomp only (ilu,ilut)" );
62 CommandLineProcessor::EParseCommandLineReturn parse_return = clp.parse(argc,argv);
63 if( parse_return != CommandLineProcessor::PARSE_SUCCESSFUL )
return parse_return;
68 paramList(
"AztecOOLinearOpWithSolve");
70 &fwdSolveParamList = paramList.
sublist(
"Forward Solve"),
71 &adjSolveParamList = paramList.
sublist(
"Adjoint Solve");
72 fwdSolveParamList.
set(
"Max Iterations",maxIterations);
73 adjSolveParamList.
set(
"Max Iterations",maxIterations);
97 = Thyra::test_single_aztecoo_thyra_solver(
98 matrixFile,testTranspose,numRandomVectors
99 ,maxFwdError,maxResid,maxSolutionError,showAllTests,dumpAll
105 catch(
const std::exception &excpt ) {
106 std::cerr <<
"*** Caught standard exception : " << excpt.what() << std::endl;
110 std::cerr <<
"*** Caught an unknown exception\n";
115 if(success) out <<
"\nCongratulations! All of the tests checked out!\n";
116 else out <<
"\nOh no! At least one of the tests failed!\n";
119 return ( success ? 0 : 1 );
int main(int argc, char *argv[])
RCP< ParameterList > sublist(const RCP< ParameterList > ¶mList, const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)