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 #ifndef MOOCHOPACK_THYRA_MODEL_EVALUATOR_SOLVER_HPP
00030 #define MOOCHOPACK_THYRA_MODEL_EVALUATOR_SOLVER_HPP
00031
00032 #include "MoochoPack_MoochoSolver.hpp"
00033 #include "Thyra_ModelEvaluator.hpp"
00034 #include "Thyra_DirectionalFiniteDiffCalculator.hpp"
00035 #include "Thyra_DefaultNominalBoundsOverrideModelEvaluator.hpp"
00036 #include "Thyra_DefaultFinalPointCaptureModelEvaluator.hpp"
00037 #include "Teuchos_StandardMemberCompositionMacros.hpp"
00038
00039 namespace MoochoPack {
00040
00046 class ThyraModelEvaluatorSolver {
00047 public:
00048
00050 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, insertStateElimCommandLineOptions )
00051
00052
00053 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, insertFiniteDiffCommandLineOptions )
00054
00056 ThyraModelEvaluatorSolver();
00057
00059 void setupCLP(
00060 Teuchos::CommandLineProcessor *clp
00061 );
00062
00064 MoochoSolver& getSolver();
00065
00067 const MoochoSolver& getSolver() const;
00068
00070 void setDoSim( const bool doSim );
00071
00073 bool getDoSim() const;
00074
00076 void setModel(
00077 const Teuchos::RefCountPtr<Thyra::ModelEvaluator<value_type> > &model
00078 ,const int p_idx = 0
00079 ,const int g_idx = 0
00080 );
00081
00083 void readInitialGuess(
00084 std::ostream *out = NULL
00085 );
00086
00088 void setInitialGuess(
00089 const Teuchos::RefCountPtr<const Thyra::ModelEvaluatorBase::InArgs<value_type> > &initialGuess
00090 );
00091
00093 void setInitialGuess(
00094 const Thyra::ModelEvaluatorBase::InArgs<value_type> &initialGuess
00095 );
00096
00098 MoochoSolver::ESolutionStatus solve();
00099
00101 const Thyra::ModelEvaluatorBase::InArgs<value_type>& getFinalPoint() const;
00102
00104 void writeFinalSolution(
00105 std::ostream *out = NULL
00106 ) const;
00107
00108
00109 private:
00110
00111 MoochoSolver solver_;
00112
00113 Teuchos::RefCountPtr<Thyra::ModelEvaluator<value_type> > origModel_;
00114 int p_idx_;
00115 int g_idx_;
00116
00117 Teuchos::RefCountPtr<Thyra::DefaultNominalBoundsOverrideModelEvaluator<value_type> > nominalModel_;
00118
00119 Teuchos::RefCountPtr<Thyra::DefaultFinalPointCaptureModelEvaluator<value_type> > finalPointModel_;
00120
00121 Teuchos::RefCountPtr<Thyra::ModelEvaluator<value_type> > outerModel_;
00122
00123 bool do_sim_;
00124 bool use_direct_;
00125 bool use_black_box_;
00126 bool use_finite_diff_;
00127 Thyra::DirectionalFiniteDiffCalculatorTypes::EFDMethodType fd_method_type_;
00128 double fd_step_len_;
00129 double fwd_newton_tol_;
00130 int fwd_newton_max_iters_;
00131 std::string stateGuessFileBase_;
00132 double scaleStateGuess_;
00133 std::string paramGuessFileBase_;
00134 double scaleParamGuess_;
00135 std::string stateSoluFileBase_;
00136 std::string paramSoluFileBase_;
00137
00138 };
00139
00140 }
00141
00142 #endif