45 #include "MoochoPack_MoochoThyraSolver.hpp"
46 #include "Thyra_EpetraModelEvaluator.hpp"
47 #include "Teuchos_GlobalMPISession.hpp"
48 #include "Teuchos_CommandLineProcessor.hpp"
49 #include "Teuchos_StandardCatchMacros.hpp"
50 #include "Teuchos_VerboseObject.hpp"
51 #include "Teuchos_XMLParameterListHelpers.hpp"
53 # include "Epetra_MpiComm.h"
55 # include "Epetra_SerialComm.h"
59 int main(
int argc,
char* argv[] )
72 bool dummySuccess =
true;
84 MoochoThyraSolver solver;
95 CommandLineProcessor clp;
96 clp.throwExceptions(
false);
97 clp.addOutputSetupOptions(
true);
99 clp.setOption(
"local-dim", &localDim);
100 clp.setOption(
"pt", &pt);
101 clp.setOption(
"p0", &p0);
102 clp.setOption(
"scale", &scale);
104 solver.setupCLP(&clp);
106 CommandLineProcessor::EParseCommandLineReturn
107 parse_return = clp.parse(argc,argv,&std::cerr);
109 if( parse_return != CommandLineProcessor::PARSE_SUCCESSFUL )
112 solver.readParameters( out.
get() );
117 MPI_Comm mpiComm = MPI_COMM_WORLD;
127 *out <<
"\nCreate EpetraExt::DiagonalQuadraticResponseOnlyModelEvaluator object ...\n";
130 epetraModel = EpetraExt::diagonalQuadraticResponseOnlyModelEvaluator(
131 comm, localDim, pt, p0, scale);
133 *out <<
"\nCreate the Thyra::EpetraModelEvaluator wrapper object ...\n";
137 epetraThyraModel->initialize(epetraModel, Teuchos::null);
144 solver.setModel(epetraThyraModel);
147 solver.readInitialGuess(out.
get());
150 const MoochoSolver::ESolutionStatus solution_status = solver.solve();
153 solver.writeFinalSolution(out.
get());
156 solver.writeParamsFile();
162 if(solution_status == MoochoSolver::SOLVE_RETURN_SOLVED)
163 *out <<
"\nEnd Result: TEST PASSED\n";
165 *out <<
"\nEnd Result: TEST FAILED\n";
167 return solution_status;
172 return MoochoSolver::SOLVE_RETURN_EXCEPTION;
basic_OSTab< char > OSTab
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
static RCP< FancyOStream > getDefaultOStream()
#define TEUCHOS_STANDARD_CATCH_STATEMENTS(VERBOSE, ERR_STREAM, SUCCESS_FLAG)