Thyra Version of the Day
Thyra_ModelEvaluator.hpp
00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 //    Thyra: Interfaces and Support for Abstract Numerical Algorithms
00005 //                 Copyright (2004) 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 Michael A. Heroux (maherou@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 // @HEADER
00028 
00029 
00030 #ifndef THYRA_MODEL_EVALUATOR_HPP
00031 #define THYRA_MODEL_EVALUATOR_HPP
00032 
00033 
00034 #include "Thyra_ModelEvaluatorBase.hpp"
00035 #include "Thyra_LinearOpWithSolveFactoryBase.hpp"
00036 
00037 
00038 namespace Thyra {
00039 
00040 
00630 template<class Scalar>
00631 class ModelEvaluator : public ModelEvaluatorBase {
00632 public:
00633 
00635   typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType ScalarMag;
00636 
00639 
00644   virtual int Np() const = 0;
00645 
00651   virtual int Ng() const = 0;
00652 
00654 
00657 
00659   virtual RCP<const VectorSpaceBase<Scalar> > get_x_space() const = 0;
00660 
00662   virtual RCP<const VectorSpaceBase<Scalar> > get_f_space() const = 0;
00663 
00676   virtual RCP<const VectorSpaceBase<Scalar> > get_p_space(int l) const = 0;
00677 
00691   virtual RCP<const Teuchos::Array<std::string> > get_p_names(int l) const = 0;
00692 
00705   virtual RCP<const VectorSpaceBase<Scalar> > get_g_space(int j) const = 0;
00706 
00708 
00711   
00731   virtual ModelEvaluatorBase::InArgs<Scalar> getNominalValues() const = 0;
00732   
00746   virtual ModelEvaluatorBase::InArgs<Scalar> getLowerBounds() const = 0;
00747   
00761   virtual ModelEvaluatorBase::InArgs<Scalar> getUpperBounds() const = 0;
00762 
00764 
00767 
00784   virtual RCP<LinearOpWithSolveBase<Scalar> > create_W() const = 0;
00785 
00810   virtual RCP<LinearOpBase<Scalar> > create_W_op() const = 0;
00811 
00822   virtual RCP<LinearOpBase<Scalar> > create_DfDp_op(int l) const = 0;
00823 
00834   virtual RCP<LinearOpBase<Scalar> > create_DgDx_dot_op(int j) const = 0;
00835 
00846   virtual RCP<LinearOpBase<Scalar> > create_DgDx_op(int j) const = 0;
00847 
00860   virtual RCP<LinearOpBase<Scalar> > create_DgDp_op( int j, int l ) const = 0;
00861   
00863 
00866 
00887   virtual RCP<const LinearOpWithSolveFactoryBase<Scalar> > get_W_factory() const = 0;
00888 
00890 
00893 
00905   virtual ModelEvaluatorBase::InArgs<Scalar> createInArgs() const = 0;
00906 
00918   virtual ModelEvaluatorBase::OutArgs<Scalar> createOutArgs() const = 0;
00919 
00981   virtual void evalModel(
00982     const ModelEvaluatorBase::InArgs<Scalar> &inArgs,
00983     const ModelEvaluatorBase::OutArgs<Scalar> &outArgs
00984     ) const = 0;
00985 
00987 
00990 
00997   virtual void reportFinalPoint(
00998     const ModelEvaluatorBase::InArgs<Scalar> &finalPoint,
00999     const bool wasSolved
01000     ) = 0;
01001 
01003 
01004 private:
01005   
01006   // Not defined and not to be called
01007   ModelEvaluator<Scalar>&
01008   operator=(const ModelEvaluator<Scalar>&);
01009 
01010 };
01011 
01012 } // namespace Thyra
01013 
01014 
01015 #endif // THYRA_MODEL_EVALUATOR_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines