00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include "test_single_stratimikos_solver.hpp"
00030 #include "Teuchos_GlobalMPISession.hpp"
00031 #include "Teuchos_VerboseObject.hpp"
00032 #include "Teuchos_CommandLineProcessor.hpp"
00033 #include "Teuchos_XMLParameterListHelpers.hpp"
00034 #include "Teuchos_StandardCatchMacros.hpp"
00035
00036 int main(int argc, char* argv[])
00037 {
00038
00039 Teuchos::GlobalMPISession mpiSession(&argc,&argv);
00040
00041 using Teuchos::CommandLineProcessor;
00042
00043 bool success = true;
00044 bool verbose = true;
00045
00046 Teuchos::RefCountPtr<Teuchos::FancyOStream>
00047 out = Teuchos::VerboseObjectBase::getDefaultOStream();
00048
00049 try {
00050
00051
00052
00053
00054
00055 std::string inputFile = "";
00056 std::string extraParams = "";
00057 bool dumpAll = false;
00058
00059 CommandLineProcessor clp(false);
00060 clp.setOption( "input-file", &inputFile, "Input file [Required].", true );
00061 clp.setOption( "extra-params", &extraParams, "Extra parameters overriding the parameters read in from --input-file");
00062 clp.setDocString(
00063 "Testing program for Trilinos (and non-Trilinos) linear solvers access through Thyra."
00064 );
00065
00066 CommandLineProcessor::EParseCommandLineReturn parse_return = clp.parse(argc,argv);
00067 if( parse_return != CommandLineProcessor::PARSE_SUCCESSFUL ) return parse_return;
00068
00069 Teuchos::ParameterList paramList;
00070 if(verbose) *out << "\nReading parameters from XML file \""<<inputFile<<"\" ...\n";
00071 Teuchos::updateParametersFromXmlFile(inputFile,¶mList);
00072 if(extraParams.length()) {
00073 if(verbose) *out << "\nAppending extra parameters from the XML string \""<<extraParams<<"\" ...\n";
00074 Teuchos::updateParametersFromXmlString(extraParams,¶mList);
00075 }
00076
00077 success
00078 = Thyra::test_single_stratimikos_solver(
00079 ¶mList,dumpAll,verbose?&*out:0
00080 );
00081
00082 }
00083 TEUCHOS_STANDARD_CATCH_STATEMENTS(verbose,std::cerr,success)
00084
00085 if (verbose) {
00086 if(success) *out << "\nCongratulations! All of the tests checked out!\n";
00087 else *out << "\nOh no! At least one of the tests failed!\n";
00088 }
00089
00090 return ( success ? 0 : 1 );
00091 }