42 #ifndef MOOCHOPACK_MOOCHO_THYRA_SOLVER_HPP
43 #define MOOCHOPACK_MOOCHO_THYRA_SOLVER_HPP
45 #include "MoochoPack_MoochoSolver.hpp"
46 #include "Thyra_ModelEvaluator.hpp"
47 #include "Thyra_DirectionalFiniteDiffCalculator.hpp"
48 #include "Thyra_DefaultNominalBoundsOverrideModelEvaluator.hpp"
49 #include "Thyra_DefaultFinalPointCaptureModelEvaluator.hpp"
50 #include "Thyra_MultiVectorFileIOBase.hpp"
51 #include "Thyra_ParameterDrivenMultiVectorInput.hpp"
52 #include "Teuchos_StandardMemberCompositionMacros.hpp"
54 namespace MoochoPack {
110 const std::string ¶msXmlFileName =
""
111 ,
const std::string &extraParamsXmlString =
""
112 ,
const std::string ¶msUsedXmlOutFileName =
""
113 ,
const std::string ¶msXmlFileNameOption =
"moocho-thyra-params-file"
114 ,
const std::string &extraParamsXmlStringOption =
"extra-moocho-thyra-params"
115 ,
const std::string ¶msUsedXmlOutFileNameOption =
"moocho-thyra-params-used-file"
263 std::ostream *out = NULL
286 std::ostream *out = NULL
304 const std::string &outputXmlFileName =
""
313 enum ENLPType { NLP_TYPE_FIRST_ORDER, NLP_TYPE_DIRECT };
317 typedef value_type Scalar;
319 MoochoSolver solver_;
321 RCP<Thyra::ModelEvaluator<value_type> > origModel_;
330 RCP<Teuchos::ParameterList> paramList_;
332 RCP<Thyra::DefaultNominalBoundsOverrideModelEvaluator<value_type> >
335 RCP<Thyra::DefaultFinalPointCaptureModelEvaluator<value_type> >
338 RCP<Thyra::ModelEvaluator<value_type> > outerModel_;
342 bool nonlinearlyElimiateStates_;
343 bool use_finite_diff_for_obj_;
344 bool use_finite_diff_for_con_;
345 double fwd_newton_tol_;
346 int fwd_newton_max_iters_;
347 bool fwd_newton_dampening_;
348 int fwd_newton_max_ls_iters_;
350 bool useParameterLumping_;
351 std::string outputFileTag_;
352 bool showModelEvaluatorTrace_;
353 std::string stateSoluFileBase_;
354 std::string paramSoluFileBase_;
360 #endif // MOOCHOPACK_MOOCHO_THYRA_SOLVER_HPP
void setParameterList(RCP< Teuchos::ParameterList > const ¶mList)
ESolveMode getSolveMode() const
RCP< Teuchos::ParameterList > unsetParameterList()
const RCP< Thyra::ModelEvaluator< value_type > > getOrigModel() const
void readParameters(std::ostream *out)
Force the parameters to be read from a file or from the commandline arguments.
void setupCLP(Teuchos::CommandLineProcessor *clp)
Sets up the commandline for reading in the parameter list for this object (minus the options for Mooc...
MoochoSolver & getSolver()
RCP< const Teuchos::ParameterList > getValidParameters() const
MoochoThyraSolver(const std::string ¶msXmlFileName="", const std::string &extraParamsXmlString="", const std::string ¶msUsedXmlOutFileName="", const std::string ¶msXmlFileNameOption="moocho-thyra-params-file", const std::string &extraParamsXmlStringOption="extra-moocho-thyra-params", const std::string ¶msUsedXmlOutFileNameOption="moocho-thyra-params-used-file")
Construct with default settings.
MOOCHO NLP Solver class for models represented through Thyra::ModelEvaluator.
MoochoSolver::ESolutionStatus solve()
const RCP< Thyra::ModelEvaluator< value_type > > getOuterModel() const
void writeFinalSolution(std::ostream *out=NULL) const
Write the final solution to a file specified by the parameter list option ???.
RCP< Teuchos::ParameterList > getNonconstParameterList()
STANDARD_NONCONST_COMPOSITION_MEMBERS(Thyra::MultiVectorFileIOBase< value_type >, stateVectorIO)
MultiVectorFileIOBase object used to read and write state vectors to and from files.
void setSolveMode(const ESolveMode solveMode)
void writeParamsFile(const std::string &outputXmlFileName="") const
Write the parameters list for a this object to a file after the parameters are read in order to show ...
Solve an optimization problem for states and parameters.
void setModel(const RCP< Thyra::ModelEvaluator< value_type > > &origModel, const int p_idx=0, const int g_idx=0)
const Thyra::ModelEvaluatorBase::InArgs< value_type > & getFinalPoint() const
Return the final point.
void readInitialGuess(std::ostream *out=NULL)
RCP< const Teuchos::ParameterList > getParameterList() const
STANDARD_MEMBER_COMPOSITION_MEMBERS(std::string, paramsXmlFileName)
The name an XML file that will be read to get XML parameters (if not "").
void setInitialGuess(const RCP< const Thyra::ModelEvaluatorBase::InArgs< value_type > > &initialGuess)
Do a forward solve for the states only.