46 #include "Thyra_EpetraModelEvaluator.hpp"
59 int main(
int argc,
char* argv[] )
72 bool dummySuccess =
true;
75 out = Teuchos::VerboseObjectBase::getDefaultOStream();
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() );
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";
136 epetraThyraModel(
new Thyra::EpetraModelEvaluator());
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;
MOOCHO NLP Solver class for models represented through Thyra::ModelEvaluator.
int main(int argc, char *argv[])
basic_OSTab< char > OSTab
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
#define TEUCHOS_STANDARD_CATCH_STATEMENTS(VERBOSE, ERR_STREAM, SUCCESS_FLAG)
Universal interface to a MOOCHO solver.