MoochoPack_ThyraModelEvaluatorSolver.hpp

Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
00005 //                  Copyright (2003) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 // @HEADER
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 } // namespace MoochoPack
00141 
00142 #endif  // MOOCHOPACK_THYRA_MODEL_EVALUATOR_SOLVER_HPP

Generated on Thu Sep 18 12:35:18 2008 for MOOCHO (Single Doxygen Collection) by doxygen 1.3.9.1