EpetraExt_ModelEvaluator.h

Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 //     EpetraExt: Epetra Extended - Linear Algebra Services Package
00005 //                 Copyright (2001) 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 #ifndef EPETRA_EXT_MODEL_EVALUATOR_HPP
00030 #define EPETRA_EXT_MODEL_EVALUATOR_HPP
00031 
00032 #include "EpetraExt_ConfigDefs.h"
00033 #include "EpetraExt_PolynomialVectorTraits.h"
00034 #include "Teuchos_RefCountPtr.hpp"
00035 #include "Teuchos_Describable.hpp"
00036 #include "Teuchos_Polynomial.hpp"
00037 #include "Teuchos_Array.hpp"
00038 
00039 #ifdef HAVE_PYTRILINOS
00040 #undef HAVE_INTTYPES_H
00041 #undef HAVE_STDINT_H
00042 #undef HAVE_SYS_TIME_H
00043 #include "Python.h"
00044 #endif
00045 
00046 class Epetra_Map;
00047 class Epetra_Vector;
00048 class Epetra_Operator;
00049 
00050 // Forward declaration of Stochastic Galerkin (SG) argument types
00051 namespace Stokhos {
00052   template <typename coeff_type> class VectorOrthogPoly;
00053   class EpetraVectorOrthogPoly;
00054   class EpetraMultiVectorOrthogPoly;
00055   template <typename ordinal_type, typename scalar_type> class OrthogPolyBasis;
00056   template <typename ordinal_type, typename scalar_type> class Quadrature;
00057   template <typename ordinal_type, typename scalar_type> class OrthogPolyExpansion;
00058 }
00059 
00060 namespace EpetraExt {
00061 
00066 class ModelEvaluator : virtual public Teuchos::Describable {
00067 public:
00068 
00071 
00073   enum EInArgsMembers {
00074     IN_ARG_x_dot
00075     ,IN_ARG_x
00076     ,IN_ARG_x_dot_poly 
00077     ,IN_ARG_x_poly    
00078     ,IN_ARG_x_dot_sg  
00079     ,IN_ARG_x_sg      
00080     ,IN_ARG_t
00081     ,IN_ARG_alpha
00082     ,IN_ARG_beta
00083     ,IN_ARG_sg_basis 
00084     ,IN_ARG_sg_quadrature 
00085     ,IN_ARG_sg_expansion 
00086   };
00087   static const int NUM_E_IN_ARGS_MEMBERS=12;
00088 
00090   class InArgs {
00091   public:
00092 
00094     typedef Teuchos::RefCountPtr<const Stokhos::EpetraVectorOrthogPoly> sg_const_vector_t;
00095     
00097     InArgs();
00099     std::string modelEvalDescription() const;
00101     int Np() const;
00103     int Np_sg() const;
00105     void set_x_dot( const Teuchos::RefCountPtr<const Epetra_Vector> &x_dot );
00107     Teuchos::RefCountPtr<const Epetra_Vector> get_x_dot() const;
00109     void set_x( const Teuchos::RefCountPtr<const Epetra_Vector> &x );
00111     Teuchos::RefCountPtr<const Epetra_Vector> get_x() const;
00112     void set_x_poly(
00113       const Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > &x_poly
00114       );
00116     Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > get_x_poly() const;
00118     void set_x_dot_poly(
00119       const Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > &x_dot_poly
00120       );
00122     Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > get_x_dot_poly() const;
00124     void set_x_sg(const sg_const_vector_t &x_sg);
00126     sg_const_vector_t get_x_sg() const;
00128     void set_x_dot_sg(const sg_const_vector_t &x_dot_sg);
00130     sg_const_vector_t get_x_dot_sg() const;
00132     void set_p( int l, const Teuchos::RefCountPtr<const Epetra_Vector> &p_l );
00134     Teuchos::RefCountPtr<const Epetra_Vector> get_p(int l) const;
00136     void set_p_sg( int l, const sg_const_vector_t &p_sg_l );
00138     sg_const_vector_t get_p_sg(int l) const;
00140     void set_t( double t );
00142     double get_alpha() const;
00144     void set_alpha( double alpha );
00146     double get_beta() const;
00148     void set_beta( double beta );
00150     double get_t() const;
00152     Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> > get_sg_basis() const;
00154     void set_sg_basis( const Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> >& basis );
00156     Teuchos::RCP<const Stokhos::Quadrature<int,double> > get_sg_quadrature() const;
00158     void set_sg_quadrature( const Teuchos::RCP<const Stokhos::Quadrature<int,double> >& quad );
00160     Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double> > get_sg_expansion() const;
00162     void set_sg_expansion( const Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double> >& exp );
00164     bool supports(EInArgsMembers arg) const;
00165   protected:
00167     void _setModelEvalDescription( const std::string &modelEvalDescription );
00169     void _set_Np(int Np);
00171     void _set_Np_sg(int Np);
00173     void _setSupports( EInArgsMembers arg, bool supports );
00174   private:
00175     // types
00176     typedef Teuchos::Array<Teuchos::RefCountPtr<const Epetra_Vector> > p_t;
00177     typedef Teuchos::Array<sg_const_vector_t > p_sg_t;
00178     // data
00179     std::string modelEvalDescription_;
00180     Teuchos::RefCountPtr<const Epetra_Vector>  x_dot_;
00181     Teuchos::RefCountPtr<const Epetra_Vector>  x_;
00182     Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > x_dot_poly_;
00183     Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > x_poly_;
00184     sg_const_vector_t                          x_dot_sg_;
00185     sg_const_vector_t                          x_sg_;
00186     p_t                                        p_;
00187     p_sg_t                                     p_sg_;
00188     double                                     t_;
00189     double                                     alpha_;
00190     double                                     beta_;
00191     Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> > sg_basis_;
00192     Teuchos::RCP<const Stokhos::Quadrature<int,double> > sg_quad_;
00193     Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double> > sg_exp_;
00194     bool supports_[NUM_E_IN_ARGS_MEMBERS];
00195     // functions
00196     void assert_supports(EInArgsMembers arg) const;
00197     void assert_l(int l) const;
00198   };
00199 
00201   enum EEvalType {
00202     EVAL_TYPE_EXACT                
00203     ,EVAL_TYPE_APPROX_DERIV        
00204     ,EVAL_TYPE_VERY_APPROX_DERIV   
00205   };
00206 
00208   template<class ObjType>
00209   class Evaluation : public Teuchos::RefCountPtr<ObjType> {
00210   public:
00212     Evaluation() : evalType_(EVAL_TYPE_EXACT) {}
00214     Evaluation( const Teuchos::RefCountPtr<ObjType> &obj )
00215       : Teuchos::RefCountPtr<ObjType>(obj), evalType_(EVAL_TYPE_EXACT) {}
00217     Evaluation( const Teuchos::RefCountPtr<ObjType> &obj, EEvalType evalType )
00218       : Teuchos::RefCountPtr<ObjType>(obj), evalType_(evalType) {}
00220     EEvalType getType() const { return evalType_; }
00222     void reset( const Teuchos::RefCountPtr<ObjType> &obj, EEvalType evalType ) 
00223     { this->operator=(obj); evalType_ = evalType; }
00224   private:
00225     EEvalType                      evalType_;
00226   };
00227   
00229   enum EDerivativeMultiVectorOrientation {
00230     DERIV_MV_BY_COL           
00231     ,DERIV_TRANS_MV_BY_ROW    
00232   };
00233 
00235   enum EDerivativeLinearOp { DERIV_LINEAR_OP };
00236 
00238   class DerivativeSupport {
00239   public:
00241     DerivativeSupport()
00242       :supportsLinearOp_(false), supportsMVByCol_(false), supportsTransMVByRow_(false)
00243       {}
00245     DerivativeSupport( EDerivativeLinearOp )
00246       :supportsLinearOp_(true), supportsMVByCol_(false), supportsTransMVByRow_(false)
00247       {}
00249     DerivativeSupport( EDerivativeMultiVectorOrientation mvOrientation )
00250       :supportsLinearOp_(false), supportsMVByCol_(mvOrientation==DERIV_MV_BY_COL)
00251       ,supportsTransMVByRow_(mvOrientation==DERIV_TRANS_MV_BY_ROW)
00252       {}
00254     DerivativeSupport(
00255       EDerivativeLinearOp, EDerivativeMultiVectorOrientation mvOrientation )
00256       :supportsLinearOp_(true), supportsMVByCol_(mvOrientation==DERIV_MV_BY_COL)
00257       ,supportsTransMVByRow_(mvOrientation==DERIV_TRANS_MV_BY_ROW)
00258       {}
00260     DerivativeSupport(
00261       EDerivativeMultiVectorOrientation mvOrientation1,
00262       EDerivativeMultiVectorOrientation mvOrientation2
00263       )
00264       :supportsLinearOp_(false)
00265       ,supportsMVByCol_(
00266         mvOrientation1==DERIV_MV_BY_COL||mvOrientation2==DERIV_MV_BY_COL )
00267       ,supportsTransMVByRow_(
00268         mvOrientation1==DERIV_TRANS_MV_BY_ROW||mvOrientation2==DERIV_TRANS_MV_BY_ROW )
00269       {}
00271     DerivativeSupport& plus(EDerivativeLinearOp)
00272       { supportsLinearOp_ = true; return *this; }
00274     DerivativeSupport& plus(EDerivativeMultiVectorOrientation mvOrientation)
00275       {
00276         switch(mvOrientation) {
00277           case DERIV_MV_BY_COL: supportsMVByCol_ = true; break;
00278           case DERIV_TRANS_MV_BY_ROW: supportsTransMVByRow_ = true; break;
00279           default: TEST_FOR_EXCEPT(true);
00280         }
00281         return *this;
00282       }
00284     bool none() const
00285       { return ( !supportsLinearOp_ && !supportsMVByCol_ && !supportsTransMVByRow_ ); }
00287     bool supports(EDerivativeLinearOp) const
00288       { return supportsLinearOp_; }
00290     bool supports(EDerivativeMultiVectorOrientation mvOrientation) const
00291       {
00292         switch(mvOrientation) {
00293           case DERIV_MV_BY_COL: return supportsMVByCol_;
00294           case DERIV_TRANS_MV_BY_ROW: return supportsTransMVByRow_;
00295           default: TEST_FOR_EXCEPT(true);
00296         }
00297         return false; // Will never be called!
00298       }
00299   private:
00300     bool supportsLinearOp_;
00301     bool supportsMVByCol_;
00302     bool supportsTransMVByRow_;
00303   public:
00304   };
00305 
00307   enum EDerivativeLinearity {
00308     DERIV_LINEARITY_UNKNOWN      
00309     ,DERIV_LINEARITY_CONST       
00310     ,DERIV_LINEARITY_NONCONST    
00311   };
00313   enum ERankStatus {
00314     DERIV_RANK_UNKNOWN       
00315     ,DERIV_RANK_FULL         
00316     ,DERIV_RANK_DEFICIENT    
00317   };
00318 
00320   struct DerivativeProperties {
00322     EDerivativeLinearity linearity;
00324     ERankStatus rank;
00326     bool supportsAdjoint;
00328     DerivativeProperties()
00329       :linearity(DERIV_LINEARITY_UNKNOWN),rank(DERIV_RANK_UNKNOWN),supportsAdjoint(false) {}
00331     DerivativeProperties(
00332       EDerivativeLinearity in_linearity, ERankStatus in_rank, bool in_supportsAdjoint
00333       ):linearity(in_linearity),rank(in_rank),supportsAdjoint(in_supportsAdjoint) {}
00334   };
00335 
00339   class DerivativeMultiVector {
00340   public:
00342     DerivativeMultiVector() {}
00344     DerivativeMultiVector(
00345       const Teuchos::RefCountPtr<Epetra_MultiVector> &mv
00346       ,const EDerivativeMultiVectorOrientation orientation = DERIV_MV_BY_COL
00347       ,const Teuchos::Array<int> &paramIndexes = Teuchos::Array<int>()
00348       ) : mv_(mv), orientation_(orientation), paramIndexes_(paramIndexes) {}
00350     void changeOrientation( const EDerivativeMultiVectorOrientation orientation )
00351       { orientation_ = orientation; };
00353     Teuchos::RefCountPtr<Epetra_MultiVector> getMultiVector() const
00354       { return mv_; }
00356     EDerivativeMultiVectorOrientation getOrientation() const
00357       { return orientation_; }
00359     const Teuchos::Array<int>& getParamIndexes() const
00360       { return paramIndexes_; }
00361   private:
00362     Teuchos::RefCountPtr<Epetra_MultiVector> mv_;
00363     EDerivativeMultiVectorOrientation orientation_;
00364     Teuchos::Array<int> paramIndexes_;
00365   };
00366 
00370   class Derivative {
00371   public:
00373     Derivative() {}
00375     Derivative( const Teuchos::RefCountPtr<Epetra_Operator> &lo )
00376       : lo_(lo) {}
00378     Derivative(
00379       const Teuchos::RefCountPtr<Epetra_MultiVector> &mv
00380       ,const EDerivativeMultiVectorOrientation orientation = DERIV_MV_BY_COL
00381       ) : dmv_(mv,orientation) {}
00383     Derivative( const DerivativeMultiVector &dmv )
00384       : dmv_(dmv) {}
00386     Teuchos::RefCountPtr<Epetra_Operator> getLinearOp() const
00387       { return lo_; }
00389     Teuchos::RefCountPtr<Epetra_MultiVector> getMultiVector() const
00390       { return dmv_.getMultiVector(); }
00392     EDerivativeMultiVectorOrientation getMultiVectorOrientation() const
00393       { return dmv_.getOrientation(); }
00395     DerivativeMultiVector getDerivativeMultiVector() const
00396       { return dmv_; }
00398     bool isEmpty() const
00399         { return !lo_.get() && !dmv_.getMultiVector().get(); }
00400   private:
00401     Teuchos::RefCountPtr<Epetra_Operator> lo_;
00402     DerivativeMultiVector dmv_;
00403   };
00404 
00408   struct Preconditioner {
00410     Preconditioner() : PrecOp(Teuchos::null), isAlreadyInverted(false) {}
00412     Preconditioner(const Teuchos::RCP<Epetra_Operator>& PrecOp_,
00413                      bool isAlreadyInverted_ )
00414       : PrecOp(PrecOp_), isAlreadyInverted(isAlreadyInverted_) {}
00416     Teuchos::RCP<Epetra_Operator> PrecOp;
00421     bool isAlreadyInverted;
00422   };
00423 
00427   class SGDerivativeMultiVector {
00428   public:
00430     SGDerivativeMultiVector() {}
00432     SGDerivativeMultiVector(
00433       const Teuchos::RefCountPtr< Stokhos::EpetraMultiVectorOrthogPoly > &mv
00434       ,const EDerivativeMultiVectorOrientation orientation = DERIV_MV_BY_COL
00435       ,const Teuchos::Array<int> &paramIndexes = Teuchos::Array<int>()
00436       ) : mv_(mv), orientation_(orientation), paramIndexes_(paramIndexes) {}
00438     void changeOrientation( const EDerivativeMultiVectorOrientation orientation )
00439       { orientation_ = orientation; };
00441     Teuchos::RefCountPtr< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const
00442       { return mv_; }
00444     EDerivativeMultiVectorOrientation getOrientation() const
00445       { return orientation_; }
00447     const Teuchos::Array<int>& getParamIndexes() const
00448       { return paramIndexes_; }
00449   private:
00450     Teuchos::RefCountPtr< Stokhos::EpetraMultiVectorOrthogPoly > mv_;
00451     EDerivativeMultiVectorOrientation orientation_;
00452     Teuchos::Array<int> paramIndexes_;
00453   };
00454 
00458   class SGDerivative {
00459   public:
00461     SGDerivative() {}
00463     SGDerivative( const Teuchos::RefCountPtr< Stokhos::VectorOrthogPoly<Epetra_Operator> > &lo )
00464       : lo_(lo) {}
00466     SGDerivative(
00467       const Teuchos::RefCountPtr< Stokhos::EpetraMultiVectorOrthogPoly > &mv
00468       ,const EDerivativeMultiVectorOrientation orientation = DERIV_MV_BY_COL
00469       ) : dmv_(mv,orientation) {}
00471     SGDerivative( const SGDerivativeMultiVector &dmv )
00472       : dmv_(dmv) {}
00474     Teuchos::RefCountPtr< Stokhos::VectorOrthogPoly<Epetra_Operator> > getLinearOp() const
00475       { return lo_; }
00477     Teuchos::RefCountPtr< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const
00478       { return dmv_.getMultiVector(); }
00480     EDerivativeMultiVectorOrientation getMultiVectorOrientation() const
00481       { return dmv_.getOrientation(); }
00483     SGDerivativeMultiVector getDerivativeMultiVector() const
00484       { return dmv_; }
00486     bool isEmpty() const
00487         { return !lo_.get() && !dmv_.getMultiVector().get(); }
00488   private:
00489     Teuchos::RefCountPtr< Stokhos::VectorOrthogPoly<Epetra_Operator> > lo_;
00490     SGDerivativeMultiVector dmv_;
00491   };
00492 
00494   enum EOutArgsMembers {
00495     OUT_ARG_f
00496     ,OUT_ARG_W
00497     ,OUT_ARG_f_poly   
00498     ,OUT_ARG_f_sg     
00499     ,OUT_ARG_W_sg     
00500     ,OUT_ARG_WPrec   
00501   };
00502   static const int NUM_E_OUT_ARGS_MEMBERS=7;
00503 
00505   enum EOutArgsDfDp {
00506     OUT_ARG_DfDp   
00507   };
00508 
00510   enum EOutArgsDgDx_dot {
00511     OUT_ARG_DgDx_dot   
00512   };
00513 
00515   enum EOutArgsDgDx {
00516     OUT_ARG_DgDx   
00517   };
00518 
00520   enum EOutArgsDgDp {
00521     OUT_ARG_DgDp   
00522   };
00523 
00525   enum EOutArgsDfDp_sg {
00526     OUT_ARG_DfDp_sg   
00527   };
00528 
00530   enum EOutArgsDgDx_dot_sg {
00531     OUT_ARG_DgDx_dot_sg   
00532   };
00533 
00535   enum EOutArgsDgDx_sg {
00536     OUT_ARG_DgDx_sg   
00537   };
00538 
00540   enum EOutArgsDgDp_sg {
00541     OUT_ARG_DgDp_sg   
00542   };
00543 
00545   class OutArgs {
00546   public:
00547 
00549     typedef Teuchos::RefCountPtr<Stokhos::EpetraVectorOrthogPoly> sg_vector_t;
00550 
00552     typedef Teuchos::RefCountPtr<Stokhos::VectorOrthogPoly<Epetra_Operator> > sg_operator_t;
00553 
00555     OutArgs();
00557     std::string modelEvalDescription() const;
00559     int Np() const;
00561     int Ng() const;
00563     int Np_sg() const;
00565     int Ng_sg() const;
00567     bool supports(EOutArgsMembers arg) const;
00569     const DerivativeSupport& supports(EOutArgsDfDp arg, int l) const;
00571     const DerivativeSupport& supports(EOutArgsDgDx_dot arg, int j) const;
00573     const DerivativeSupport& supports(EOutArgsDgDx arg, int j) const;
00575     const DerivativeSupport& supports(EOutArgsDgDp arg, int j, int l) const;
00577     const DerivativeSupport& supports(EOutArgsDfDp_sg arg, int l) const;
00579     const DerivativeSupport& supports(EOutArgsDgDx_dot_sg arg, int j) const;
00581     const DerivativeSupport& supports(EOutArgsDgDx_sg arg, int j) const;
00583     const DerivativeSupport& supports(EOutArgsDgDp_sg arg, int j, int l) const;
00585     void set_f( const Evaluation<Epetra_Vector> &f );
00587     Evaluation<Epetra_Vector> get_f() const;
00589     void set_f_sg( const sg_vector_t& f_sg );
00591     sg_vector_t get_f_sg() const;
00593     void set_g( int j, const Evaluation<Epetra_Vector> &g_j );
00595     Evaluation<Epetra_Vector> get_g(int j) const;
00598     void set_g_sg( int j, const sg_vector_t &g_sg_j );
00601     sg_vector_t get_g_sg(int j) const;
00603     void set_W( const Teuchos::RefCountPtr<Epetra_Operator> &W );
00604     void set_WPrec( const Teuchos::RefCountPtr<Epetra_Operator> &WPrec );
00606     Teuchos::RefCountPtr<Epetra_Operator> get_W() const;
00607     Teuchos::RefCountPtr<Epetra_Operator> get_WPrec() const;
00609     DerivativeProperties get_W_properties() const;
00610     DerivativeProperties get_WPrec_properties() const;
00612     void set_W_sg( const sg_operator_t& W_sg );
00614     sg_operator_t get_W_sg() const;
00616     void set_DfDp(int l,  const Derivative &DfDp_l);
00618     Derivative get_DfDp(int l) const;
00620     DerivativeProperties get_DfDp_properties(int l) const;
00622     void set_DfDp_sg(int l,  const SGDerivative &DfDp_sg_l);
00624     SGDerivative get_DfDp_sg(int l) const;
00626     DerivativeProperties get_DfDp_sg_properties(int l) const;
00628     void set_DgDx_dot(int j, const Derivative &DgDx_dot_j);
00630     Derivative get_DgDx_dot(int j) const;
00632     DerivativeProperties get_DgDx_dot_properties(int j) const;
00634     void set_DgDx_dot_sg(int j, const SGDerivative &DgDx_dot_j);
00636     SGDerivative get_DgDx_dot_sg(int j) const;
00638     DerivativeProperties get_DgDx_dot_sg_properties(int j) const;
00640     void set_DgDx(int j, const Derivative &DgDx_j);
00642     Derivative get_DgDx(int j) const;
00644     DerivativeProperties get_DgDx_properties(int j) const;
00646     void set_DgDx_sg(int j, const SGDerivative &DgDx_j);
00648     SGDerivative get_DgDx_sg(int j) const;
00650     DerivativeProperties get_DgDx_sg_properties(int j) const;
00652     void set_DgDp( int j, int l, const Derivative &DgDp_j_l );
00654     Derivative get_DgDp(int j, int l) const;
00656     DerivativeProperties get_DgDp_properties(int j, int l) const;
00658     void set_DgDp_sg( int j, int l, const SGDerivative &DgDp_sg_j_l );
00660     SGDerivative get_DgDp_sg(int j, int l) const;
00662     DerivativeProperties get_DgDp_sg_properties(int j, int l) const;
00663 
00665     void set_f_poly( const Teuchos::RefCountPtr<Teuchos::Polynomial<Epetra_Vector> > &f_poly );
00667     Teuchos::RefCountPtr<Teuchos::Polynomial<Epetra_Vector> > get_f_poly() const;
00668     
00669     
00671     bool funcOrDerivesAreSet(EOutArgsMembers arg) const;
00672   protected:
00674     void _setModelEvalDescription( const std::string &modelEvalDescription );
00676     void _set_Np_Ng(int Np, int Ng);
00678     void _set_Np_Ng_sg(int Np_sg, int Ng_sg);
00680     void _setSupports( EOutArgsMembers arg, bool supports );
00682     void _setSupports( EOutArgsDfDp arg, int l, const DerivativeSupport& );
00684     void _setSupports( EOutArgsDgDx_dot arg, int j, const DerivativeSupport& );
00686     void _setSupports( EOutArgsDgDx arg, int j, const DerivativeSupport& );
00688     void _setSupports( EOutArgsDgDp arg, int j, int l, const DerivativeSupport& );
00690     void _setSupports( EOutArgsDfDp_sg arg, int l, const DerivativeSupport& );
00692     void _setSupports( EOutArgsDgDx_dot_sg arg, int j, const DerivativeSupport& );
00694     void _setSupports( EOutArgsDgDx_sg arg, int j, const DerivativeSupport& );
00696     void _setSupports( EOutArgsDgDp_sg arg, int j, int l, const DerivativeSupport& );
00698     void _set_W_properties( const DerivativeProperties &W_properties );
00699     void _set_WPrec_properties( const DerivativeProperties &WPrec_properties );
00701     void _set_DfDp_properties( int l, const DerivativeProperties &properties );
00703     void _set_DgDx_dot_properties( int j, const DerivativeProperties &properties );
00705     void _set_DgDx_properties( int j, const DerivativeProperties &properties );
00707     void _set_DgDp_properties( int j, int l, const DerivativeProperties &properties );
00709     void _set_DfDp_sg_properties( int l, const DerivativeProperties &properties );
00711     void _set_DgDx_dot_sg_properties( int j, const DerivativeProperties &properties );
00713     void _set_DgDx_sg_properties( int j, const DerivativeProperties &properties );
00715     void _set_DgDp_sg_properties( int j, int l, const DerivativeProperties &properties );
00716   private:
00717     // types
00718     typedef Teuchos::Array<Evaluation<Epetra_Vector> > g_t;
00719     typedef Teuchos::Array<sg_vector_t > g_sg_t;
00720     typedef Teuchos::Array<Derivative> deriv_t;
00721     typedef Teuchos::Array<SGDerivative> sg_deriv_t;
00722     typedef Teuchos::Array<DerivativeProperties> deriv_properties_t;
00723     typedef Teuchos::Array<DerivativeSupport> supports_t;
00724     // data
00725     std::string modelEvalDescription_;
00726     bool supports_[NUM_E_OUT_ARGS_MEMBERS];
00727     supports_t supports_DfDp_; // Np
00728     supports_t supports_DgDx_dot_; // Ng
00729     supports_t supports_DgDx_; // Ng
00730     supports_t supports_DgDp_; // Ng x Np
00731     supports_t supports_DfDp_sg_; // Np_sg
00732     supports_t supports_DgDx_dot_sg_; // Ng_sg
00733     supports_t supports_DgDx_sg_; // Ng_sg
00734     supports_t supports_DgDp_sg_; // Ng_sg x Np_sg
00735     Evaluation<Epetra_Vector> f_;
00736     g_t g_;
00737     g_sg_t g_sg_;
00738     Teuchos::RefCountPtr<Epetra_Operator> W_;
00739     Teuchos::RefCountPtr<Epetra_Operator> WPrec_;
00740     DerivativeProperties W_properties_;
00741     DerivativeProperties WPrec_properties_;
00742     deriv_t DfDp_; // Np
00743     deriv_properties_t DfDp_properties_; // Np
00744     deriv_t DgDx_dot_; // Ng
00745     deriv_t DgDx_; // Ng
00746     deriv_properties_t DgDx_dot_properties_; // Ng
00747     deriv_properties_t DgDx_properties_; // Ng
00748     deriv_t DgDp_; // Ng x Np
00749     deriv_properties_t DgDp_properties_; // Ng x Np
00750     Teuchos::RefCountPtr<Teuchos::Polynomial<Epetra_Vector> > f_poly_;
00751     sg_vector_t f_sg_;
00752     sg_operator_t W_sg_;
00753     sg_deriv_t DfDp_sg_; // Np_sg
00754     deriv_properties_t DfDp_sg_properties_; // Np_sg
00755     sg_deriv_t DgDx_dot_sg_; // Ng_sg
00756     sg_deriv_t DgDx_sg_; // Ng_sg
00757     deriv_properties_t DgDx_dot_sg_properties_; // Ng_sg
00758     deriv_properties_t DgDx_sg_properties_; // Ng_sg
00759     sg_deriv_t DgDp_sg_; // Ng_sg x Np_sg
00760     deriv_properties_t DgDp_sg_properties_; // Ng_sg x Np_sg
00761     // functions
00762     void assert_supports(EOutArgsMembers arg) const;
00763     void assert_supports(EOutArgsDfDp arg, int l) const;
00764     void assert_supports(EOutArgsDgDx_dot arg, int j) const;
00765     void assert_supports(EOutArgsDgDx arg, int j) const;
00766     void assert_supports(EOutArgsDgDp arg, int j, int l) const;
00767     void assert_supports(EOutArgsDfDp_sg arg, int l) const;
00768     void assert_supports(EOutArgsDgDx_dot_sg arg, int j) const;
00769     void assert_supports(EOutArgsDgDx_sg arg, int j) const;
00770     void assert_supports(EOutArgsDgDp_sg arg, int j, int l) const;
00771     void assert_l(int l) const;
00772     void assert_j(int j) const;
00773     void assert_l_sg(int l) const;
00774     void assert_j_sg(int j) const;
00775   };
00776 
00778 
00781 
00783   virtual ~ModelEvaluator();
00784 
00786 
00789 
00791   virtual Teuchos::RefCountPtr<const Epetra_Map> get_x_map() const = 0;
00792 
00794   virtual Teuchos::RefCountPtr<const Epetra_Map> get_f_map() const = 0;
00795 
00797   virtual Teuchos::RefCountPtr<const Epetra_Map> get_p_map(int l) const;
00798 
00800   virtual Teuchos::RefCountPtr<const Epetra_Map> get_p_sg_map(int l) const;
00801 
00816   virtual Teuchos::RefCountPtr<const Teuchos::Array<std::string> > get_p_names(int l) const;
00817 
00819   virtual Teuchos::RefCountPtr<const Teuchos::Array<std::string> > get_p_sg_names(int l) const;
00820 
00822   virtual Teuchos::RefCountPtr<const Epetra_Map> get_g_map(int j) const;
00823 
00825   virtual Teuchos::RefCountPtr<const Epetra_Map> get_g_sg_map(int j) const;
00826 
00828 
00831 
00833   virtual Teuchos::RefCountPtr<const Epetra_Vector> get_x_init() const;
00834 
00836   virtual Teuchos::RefCountPtr<const Stokhos::EpetraVectorOrthogPoly> get_x_sg_init() const;
00837 
00839   virtual Teuchos::RefCountPtr<const Epetra_Vector> get_x_dot_init() const;
00840 
00842   virtual Teuchos::RefCountPtr<const Stokhos::EpetraVectorOrthogPoly> get_x_dot_sg_init() const;
00843 
00845   virtual Teuchos::RefCountPtr<const Epetra_Vector> get_p_init(int l) const;
00846 
00848   virtual Teuchos::RefCountPtr<const Stokhos::EpetraVectorOrthogPoly> get_p_sg_init(int l) const;
00849 
00851   virtual double get_t_init() const;
00852 
00854 
00857 
00862   virtual double getInfBound() const;
00863 
00865   virtual Teuchos::RefCountPtr<const Epetra_Vector> get_x_lower_bounds() const;
00866 
00868   virtual Teuchos::RefCountPtr<const Epetra_Vector> get_x_upper_bounds() const;
00869 
00871   virtual Teuchos::RefCountPtr<const Epetra_Vector> get_p_lower_bounds(int l) const;
00872 
00874   virtual Teuchos::RefCountPtr<const Epetra_Vector> get_p_upper_bounds(int l) const;
00875 
00877   virtual double get_t_lower_bound() const;
00878 
00880   virtual double get_t_upper_bound() const;
00881 
00883 
00886 
00893   virtual Teuchos::RefCountPtr<Epetra_Operator> create_W() const;
00894   virtual Teuchos::RefCountPtr<EpetraExt::ModelEvaluator::Preconditioner> create_WPrec() const;
00895 
00897   virtual Teuchos::RefCountPtr<Epetra_Operator> create_DfDp_op(int l) const;
00898 
00900   virtual Teuchos::RefCountPtr<Epetra_Operator> create_DfDp_sg_op(int l) const;
00901 
00903   virtual Teuchos::RefCountPtr<Epetra_Operator> create_DgDx_dot_op(int j) const;
00904 
00906   virtual Teuchos::RefCountPtr<Epetra_Operator> create_DgDx_dot_sg_op(int j) const;
00907 
00909   virtual Teuchos::RefCountPtr<Epetra_Operator> create_DgDx_op(int j) const;
00910 
00912   virtual Teuchos::RefCountPtr<Epetra_Operator> create_DgDx_sg_op(int j) const;
00913 
00915   virtual Teuchos::RefCountPtr<Epetra_Operator> create_DgDp_op( int j, int l ) const;
00916 
00918   virtual Teuchos::RefCountPtr<Epetra_Operator> create_DgDp_sg_op( int j, int l ) const;
00919 
00921 
00924 
00926   virtual InArgs createInArgs() const = 0;
00927 
00929   virtual OutArgs createOutArgs() const = 0;
00930 
00932   virtual void evalModel( const InArgs& inArgs, const OutArgs& outArgs ) const = 0;
00933 
00934 #ifdef HAVE_PYTRILINOS
00935 
00936   friend InArgs convertInArgsFromPython(PyObject * source);
00937 
00939   friend OutArgs convertOutArgsFromPython(PyObject * source);
00940 #endif
00941 
00942 
00943 protected:
00944 
00947 
00949   class InArgsSetup : public InArgs {
00950   public:
00952     void setModelEvalDescription( const std::string &modelEvalDescription );
00954     void set_Np(int Np);
00956     void set_Np_sg(int Np);
00958     void setSupports( EInArgsMembers arg, bool supports = true );
00959   };
00960 
00962   class OutArgsSetup : public OutArgs {
00963   public:
00965     void setModelEvalDescription( const std::string &modelEvalDescription );
00967     void set_Np_Ng(int Np, int Ng);
00969     void set_Np_Ng_sg(int Np_sg, int Ng_sg);
00971     void setSupports( EOutArgsMembers arg, bool supports = true );
00973     void setSupports(EOutArgsDfDp arg, int l, const DerivativeSupport& );
00975     void setSupports(EOutArgsDgDx_dot arg, int j, const DerivativeSupport& );
00977     void setSupports(EOutArgsDgDx arg, int j, const DerivativeSupport& );
00979     void setSupports(EOutArgsDgDp arg, int j, int l, const DerivativeSupport& );
00981     void setSupports(EOutArgsDfDp_sg arg, int l, const DerivativeSupport& );
00983     void setSupports(EOutArgsDgDx_dot_sg arg, int j, const DerivativeSupport& );
00985     void setSupports(EOutArgsDgDx_sg arg, int j, const DerivativeSupport& );
00987     void setSupports(EOutArgsDgDp_sg arg, int j, int l, const DerivativeSupport& );
00989     void set_W_properties( const DerivativeProperties &properties );
00990     void set_WPrec_properties( const DerivativeProperties &properties );
00992     void set_DfDp_properties( int l, const DerivativeProperties &properties );
00994     void set_DgDx_dot_properties( int j, const DerivativeProperties &properties );
00996     void set_DgDx_properties( int j, const DerivativeProperties &properties );
00998     void set_DgDp_properties( int j, int l, const DerivativeProperties &properties );
01000     void set_DfDp_sg_properties( int l, const DerivativeProperties &properties );
01002     void set_DgDx_dot_sg_properties( int j, const DerivativeProperties &properties );
01004     void set_DgDx_sg_properties( int j, const DerivativeProperties &properties );
01006     void set_DgDp_sg_properties( int j, int l, const DerivativeProperties &properties );
01007   };
01008 
01010 
01011 };
01012 
01013 // ////////////////////////////
01014 // Helper functions
01015 
01017 std::string toString( ModelEvaluator::EDerivativeMultiVectorOrientation orientation );
01018 
01020 std::string toString( ModelEvaluator::EInArgsMembers inArg );
01021 
01023 std::string toString( ModelEvaluator::EOutArgsMembers outArg );
01024 
01026 Teuchos::RefCountPtr<Epetra_Operator>
01027 getLinearOp(
01028   const std::string &modelEvalDescription,
01029   const ModelEvaluator::Derivative &deriv,
01030   const std::string &derivName
01031   );
01032 
01034 Teuchos::RefCountPtr<Epetra_MultiVector>
01035 getMultiVector(
01036   const std::string &modelEvalDescription,
01037   const ModelEvaluator::Derivative &deriv,
01038   const std::string &derivName,
01039   const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation
01040   );
01041 
01043 Teuchos::RefCountPtr<Epetra_Operator>
01044 get_DfDp_op(
01045   const int l
01046   ,const ModelEvaluator::OutArgs &outArgs
01047   );
01048 
01050 Teuchos::RefCountPtr<Epetra_MultiVector>
01051 get_DfDp_mv(
01052   const int l
01053   ,const ModelEvaluator::OutArgs &outArgs
01054   );
01055 
01057 Teuchos::RefCountPtr<Epetra_MultiVector>
01058 get_DgDx_dot_mv(
01059   const int j
01060   ,const ModelEvaluator::OutArgs &outArgs
01061   ,const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation
01062   );
01063 
01065 Teuchos::RefCountPtr<Epetra_MultiVector>
01066 get_DgDx_mv(
01067   const int j
01068   ,const ModelEvaluator::OutArgs &outArgs
01069   ,const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation
01070   );
01071 
01073 Teuchos::RefCountPtr<Epetra_MultiVector>
01074 get_DgDp_mv(
01075   const int j
01076   ,const int l
01077   ,const ModelEvaluator::OutArgs &outArgs
01078   ,const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation
01079   );
01080 
01081 // ///////////////////////////
01082 // Inline Functions
01083 
01084 //
01085 // ModelEvaluator::InArgs
01086 //
01087 
01088 inline
01089 std::string ModelEvaluator::InArgs::modelEvalDescription() const
01090 { return modelEvalDescription_; }
01091 
01092 inline
01093 int ModelEvaluator::InArgs::Np() const
01094 { return p_.size(); }
01095 
01096 inline
01097 int ModelEvaluator::InArgs::Np_sg() const
01098 { return p_sg_.size(); }
01099 
01100 inline
01101 void ModelEvaluator::InArgs::set_x_dot( const Teuchos::RefCountPtr<const Epetra_Vector> &x_dot )
01102 { assert_supports(IN_ARG_x_dot); x_dot_ = x_dot; }
01103 
01104 inline
01105 Teuchos::RefCountPtr<const Epetra_Vector> ModelEvaluator::InArgs::get_x_dot() const
01106 { assert_supports(IN_ARG_x_dot); return x_dot_; }
01107 
01108 inline
01109 void ModelEvaluator::InArgs::set_x( const Teuchos::RefCountPtr<const Epetra_Vector> &x )
01110 { assert_supports(IN_ARG_x); x_ = x; }
01111 
01112 inline
01113 Teuchos::RefCountPtr<const Epetra_Vector> ModelEvaluator::InArgs::get_x() const
01114 { assert_supports(IN_ARG_x); return x_; }
01115 
01116 inline 
01117 void ModelEvaluator::InArgs::set_x_dot_poly( const Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > &x_dot_poly )
01118 { assert_supports(IN_ARG_x_dot_poly); x_dot_poly_ = x_dot_poly; }
01119 
01120 inline 
01121 Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> >
01122 ModelEvaluator::InArgs::get_x_dot_poly() const
01123 { assert_supports(IN_ARG_x_dot_poly); return x_dot_poly_; }
01124 
01125 inline 
01126 void ModelEvaluator::InArgs::set_x_poly( const Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > &x_poly )
01127 { assert_supports(IN_ARG_x_poly); x_poly_ = x_poly; }
01128 
01129 inline 
01130 Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> >
01131 ModelEvaluator::InArgs::get_x_poly() const
01132 { assert_supports(IN_ARG_x_poly); return x_poly_; }
01133 
01134 inline 
01135 void ModelEvaluator::InArgs::set_x_dot_sg( const ModelEvaluator::InArgs::sg_const_vector_t &x_dot_sg )
01136 { assert_supports(IN_ARG_x_dot_sg); x_dot_sg_ = x_dot_sg; }
01137 
01138 inline 
01139 ModelEvaluator::InArgs::sg_const_vector_t
01140 ModelEvaluator::InArgs::get_x_dot_sg() const
01141 { assert_supports(IN_ARG_x_dot_sg); return x_dot_sg_; }
01142 
01143 inline 
01144 void ModelEvaluator::InArgs::set_x_sg( const ModelEvaluator::InArgs::sg_const_vector_t &x_sg )
01145 { assert_supports(IN_ARG_x_sg); x_sg_ = x_sg; }
01146 
01147 inline 
01148 ModelEvaluator::InArgs::sg_const_vector_t
01149 ModelEvaluator::InArgs::get_x_sg() const
01150 { assert_supports(IN_ARG_x_sg); return x_sg_; }
01151 
01152 inline
01153 void ModelEvaluator::InArgs::set_p( int l, const Teuchos::RefCountPtr<const Epetra_Vector> &p_l )
01154 { assert_l(l); p_[l] = p_l; }
01155 
01156 inline
01157 Teuchos::RefCountPtr<const Epetra_Vector> ModelEvaluator::InArgs::get_p(int l) const
01158 { assert_l(l); return p_[l]; }
01159 
01160 inline
01161 void ModelEvaluator::InArgs::set_p_sg( int l, 
01162                const ModelEvaluator::InArgs::sg_const_vector_t &p_sg_l )
01163 { assert_l(l); p_sg_[l] = p_sg_l; }
01164 
01165 inline
01166 ModelEvaluator::InArgs::sg_const_vector_t 
01167 ModelEvaluator::InArgs::get_p_sg(int l) const
01168 { assert_l(l); return p_sg_[l]; }
01169 
01170 inline
01171 void ModelEvaluator::InArgs::set_t( double t )
01172 { assert_supports(IN_ARG_t); t_ = t; }
01173 
01174 inline
01175 double ModelEvaluator::InArgs::get_t() const
01176 { assert_supports(IN_ARG_t); return t_; }
01177 
01178 inline
01179 void ModelEvaluator::InArgs::set_alpha( double alpha )
01180 { assert_supports(IN_ARG_alpha); alpha_ = alpha; }
01181 
01182 inline
01183 double ModelEvaluator::InArgs::get_alpha() const
01184 { assert_supports(IN_ARG_alpha); return alpha_; }
01185 
01186 inline
01187 void ModelEvaluator::InArgs::set_beta( double beta )
01188 { assert_supports(IN_ARG_beta); beta_ = beta; }
01189 
01190 inline
01191 double ModelEvaluator::InArgs::get_beta() const
01192 { assert_supports(IN_ARG_beta); return beta_; }
01193 
01194 inline
01195 void ModelEvaluator::InArgs::set_sg_basis( const Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> >& basis )
01196 { assert_supports(IN_ARG_sg_basis); sg_basis_ = basis; }
01197 
01198 inline
01199 Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> >
01200 ModelEvaluator::InArgs::get_sg_basis() const
01201 { assert_supports(IN_ARG_sg_basis); return sg_basis_; }
01202 
01203 inline
01204 void ModelEvaluator::InArgs::set_sg_quadrature( const Teuchos::RCP<const Stokhos::Quadrature<int,double> >& quad )
01205 { assert_supports(IN_ARG_sg_quadrature); sg_quad_ = quad; }
01206 
01207 inline
01208 Teuchos::RCP<const Stokhos::Quadrature<int,double> >
01209 ModelEvaluator::InArgs::get_sg_quadrature() const
01210 { assert_supports(IN_ARG_sg_quadrature); return sg_quad_; }
01211 
01212 inline
01213 void ModelEvaluator::InArgs::set_sg_expansion( const Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double> >& exp )
01214 { assert_supports(IN_ARG_sg_expansion); sg_exp_ = exp; }
01215 
01216 inline
01217 Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double> >
01218 ModelEvaluator::InArgs::get_sg_expansion() const
01219 { assert_supports(IN_ARG_sg_expansion); return sg_exp_; }
01220 
01221 inline
01222 void ModelEvaluator::InArgs::_setModelEvalDescription( const std::string &new_modelEvalDescription )
01223 {
01224   modelEvalDescription_ = new_modelEvalDescription;
01225 }
01226 
01227 inline
01228 void ModelEvaluator::InArgs::_set_Np(int new_Np)
01229 {
01230   p_.resize(new_Np);
01231 }
01232 
01233 inline
01234 void ModelEvaluator::InArgs::_set_Np_sg(int new_Np)
01235 {
01236   p_sg_.resize(new_Np);
01237 }
01238 
01239 //
01240 // ModelEvaluator::OutArgs
01241 //
01242 
01243 inline
01244 std::string ModelEvaluator::OutArgs::modelEvalDescription() const
01245 { return modelEvalDescription_; }
01246 
01247 inline
01248 int ModelEvaluator::OutArgs::Np() const
01249 {
01250   return DfDp_.size();
01251 }
01252 
01253 inline
01254 int ModelEvaluator::OutArgs::Ng() const
01255 { 
01256   return g_.size();
01257 }
01258 
01259 inline
01260 int ModelEvaluator::OutArgs::Np_sg() const
01261 {
01262   return DfDp_sg_.size();
01263 }
01264 
01265 inline
01266 int ModelEvaluator::OutArgs::Ng_sg() const
01267 { 
01268   return g_sg_.size();
01269 }
01270 
01271 inline
01272 void ModelEvaluator::OutArgs::set_f( const Evaluation<Epetra_Vector> &f ) { f_ = f; }
01273 
01274 inline
01275 ModelEvaluator::Evaluation<Epetra_Vector>
01276 ModelEvaluator::OutArgs::get_f() const { return f_; }
01277 
01278 inline
01279 void ModelEvaluator::OutArgs::set_g( int j, const Evaluation<Epetra_Vector> &g_j )
01280 {
01281   assert_j(j);
01282   g_[j] = g_j;
01283 }
01284 
01285 inline
01286 ModelEvaluator::Evaluation<Epetra_Vector>
01287 ModelEvaluator::OutArgs::get_g(int j) const
01288 {
01289   assert_j(j);
01290   return g_[j];
01291 }
01292 
01293 inline
01294 void ModelEvaluator::OutArgs::set_g_sg( int j, const sg_vector_t &g_sg_j )
01295 {
01296   assert_j_sg(j);
01297   g_sg_[j] = g_sg_j;
01298 }
01299 
01300 inline
01301 ModelEvaluator::OutArgs::sg_vector_t
01302 ModelEvaluator::OutArgs::get_g_sg(int j) const
01303 {
01304   assert_j_sg(j);
01305   return g_sg_[j];
01306 }
01307 
01308 inline
01309 void ModelEvaluator::OutArgs::set_W( const Teuchos::RefCountPtr<Epetra_Operator> &W ) { W_ = W; }
01310 inline
01311 void ModelEvaluator::OutArgs::set_WPrec( const Teuchos::RefCountPtr<Epetra_Operator> &WPrec ) { WPrec_ = WPrec; }
01312 
01313 inline
01314 Teuchos::RefCountPtr<Epetra_Operator> ModelEvaluator::OutArgs::get_W() const { return W_; }
01315 inline
01316 Teuchos::RefCountPtr<Epetra_Operator> ModelEvaluator::OutArgs::get_WPrec() const { return WPrec_; }
01317 
01318 inline
01319 ModelEvaluator::DerivativeProperties ModelEvaluator::OutArgs::get_W_properties() const
01320 { return W_properties_; }
01321 inline
01322 ModelEvaluator::DerivativeProperties ModelEvaluator::OutArgs::get_WPrec_properties() const
01323 { return WPrec_properties_; }
01324 
01325 inline
01326 void ModelEvaluator::OutArgs::set_DfDp( int l, const Derivative &DfDp_l )
01327 {
01328   assert_supports(OUT_ARG_DfDp,l);
01329   DfDp_[l] = DfDp_l;
01330 }
01331 
01332 inline
01333 ModelEvaluator::Derivative
01334 ModelEvaluator::OutArgs::get_DfDp(int l) const
01335 {
01336   assert_supports(OUT_ARG_DfDp,l);
01337   return DfDp_[l];
01338 }
01339 
01340 inline
01341 ModelEvaluator::DerivativeProperties
01342 ModelEvaluator::OutArgs::get_DfDp_properties(int l) const
01343 {
01344   assert_supports(OUT_ARG_DfDp,l);
01345   return DfDp_properties_[l];
01346 }
01347 
01348 inline
01349 void ModelEvaluator::OutArgs::set_DfDp_sg( int l, const SGDerivative &DfDp_sg_l )
01350 {
01351   assert_supports(OUT_ARG_DfDp_sg,l);
01352   DfDp_sg_[l] = DfDp_sg_l;
01353 }
01354 
01355 inline
01356 ModelEvaluator::SGDerivative
01357 ModelEvaluator::OutArgs::get_DfDp_sg(int l) const
01358 {
01359   assert_supports(OUT_ARG_DfDp_sg,l);
01360   return DfDp_sg_[l];
01361 }
01362 
01363 inline
01364 ModelEvaluator::DerivativeProperties
01365 ModelEvaluator::OutArgs::get_DfDp_sg_properties(int l) const
01366 {
01367   assert_supports(OUT_ARG_DfDp_sg,l);
01368   return DfDp_sg_properties_[l];
01369 }
01370 
01371 inline
01372 void ModelEvaluator::OutArgs::set_DgDx_dot( int j, const Derivative &DgDx_dot_j )
01373 {
01374   assert_supports(OUT_ARG_DgDx_dot,j);
01375   DgDx_dot_[j] = DgDx_dot_j;
01376 }
01377 
01378 inline
01379 ModelEvaluator::Derivative
01380 ModelEvaluator::OutArgs::get_DgDx_dot(int j) const
01381 {
01382   assert_supports(OUT_ARG_DgDx_dot,j);
01383   return DgDx_dot_[j];
01384 }
01385 
01386 inline
01387 ModelEvaluator::DerivativeProperties
01388 ModelEvaluator::OutArgs::get_DgDx_dot_properties(int j) const
01389 {
01390   assert_supports(OUT_ARG_DgDx_dot,j);
01391   return DgDx_dot_properties_[j];
01392 }
01393 
01394 inline
01395 void ModelEvaluator::OutArgs::set_DgDx_dot_sg( int j, const SGDerivative &DgDx_dot_sg_j )
01396 {
01397   assert_supports(OUT_ARG_DgDx_dot_sg,j);
01398   DgDx_dot_sg_[j] = DgDx_dot_sg_j;
01399 }
01400 
01401 inline
01402 ModelEvaluator::SGDerivative
01403 ModelEvaluator::OutArgs::get_DgDx_dot_sg(int j) const
01404 {
01405   assert_supports(OUT_ARG_DgDx_dot_sg,j);
01406   return DgDx_dot_sg_[j];
01407 }
01408 
01409 inline
01410 ModelEvaluator::DerivativeProperties
01411 ModelEvaluator::OutArgs::get_DgDx_dot_sg_properties(int j) const
01412 {
01413   assert_supports(OUT_ARG_DgDx_dot_sg,j);
01414   return DgDx_dot_sg_properties_[j];
01415 }
01416 
01417 inline
01418 void ModelEvaluator::OutArgs::set_DgDx( int j, const Derivative &DgDx_j )
01419 {
01420   assert_supports(OUT_ARG_DgDx,j);
01421   DgDx_[j] = DgDx_j;
01422 }
01423 
01424 inline
01425 ModelEvaluator::Derivative
01426 ModelEvaluator::OutArgs::get_DgDx(int j) const
01427 {
01428   assert_supports(OUT_ARG_DgDx,j);
01429   return DgDx_[j];
01430 }
01431 
01432 inline
01433 ModelEvaluator::DerivativeProperties
01434 ModelEvaluator::OutArgs::get_DgDx_properties(int j) const
01435 {
01436   assert_supports(OUT_ARG_DgDx,j);
01437   return DgDx_properties_[j];
01438 }
01439 
01440 inline
01441 void ModelEvaluator::OutArgs::set_DgDx_sg( int j, const SGDerivative &DgDx_sg_j )
01442 {
01443   assert_supports(OUT_ARG_DgDx_sg,j);
01444   DgDx_sg_[j] = DgDx_sg_j;
01445 }
01446 
01447 inline
01448 ModelEvaluator::SGDerivative
01449 ModelEvaluator::OutArgs::get_DgDx_sg(int j) const
01450 {
01451   assert_supports(OUT_ARG_DgDx_sg,j);
01452   return DgDx_sg_[j];
01453 }
01454 
01455 inline
01456 ModelEvaluator::DerivativeProperties
01457 ModelEvaluator::OutArgs::get_DgDx_sg_properties(int j) const
01458 {
01459   assert_supports(OUT_ARG_DgDx_sg,j);
01460   return DgDx_sg_properties_[j];
01461 }
01462 
01463 inline
01464 void ModelEvaluator::OutArgs::set_DgDp( int j, int l, const Derivative &DgDp_j_l )
01465 {
01466   assert_supports(OUT_ARG_DgDp,j,l);
01467   DgDp_[ j*Np() + l ] = DgDp_j_l;
01468 }
01469 
01470 inline
01471 ModelEvaluator::Derivative
01472 ModelEvaluator::OutArgs::get_DgDp(int j, int l) const
01473 {
01474   assert_supports(OUT_ARG_DgDp,j,l);
01475   return DgDp_[ j*Np() + l ];
01476 }
01477 
01478 inline
01479 ModelEvaluator::DerivativeProperties
01480 ModelEvaluator::OutArgs::get_DgDp_properties(int j, int l) const
01481 {
01482   assert_supports(OUT_ARG_DgDp,j,l);
01483   return DgDp_properties_[ j*Np() + l ];
01484 }
01485 
01486 inline
01487 void ModelEvaluator::OutArgs::set_DgDp_sg( int j, int l, const SGDerivative &DgDp_sg_j_l )
01488 {
01489   assert_supports(OUT_ARG_DgDp_sg,j,l);
01490   DgDp_sg_[ j*Np_sg() + l ] = DgDp_sg_j_l;
01491 }
01492 
01493 inline
01494 ModelEvaluator::SGDerivative
01495 ModelEvaluator::OutArgs::get_DgDp_sg(int j, int l) const
01496 {
01497   assert_supports(OUT_ARG_DgDp_sg,j,l);
01498   return DgDp_sg_[ j*Np_sg() + l ];
01499 }
01500 
01501 inline
01502 ModelEvaluator::DerivativeProperties
01503 ModelEvaluator::OutArgs::get_DgDp_sg_properties(int j, int l) const
01504 {
01505   assert_supports(OUT_ARG_DgDp_sg,j,l);
01506   return DgDp_sg_properties_[ j*Np_sg() + l ];
01507 }
01508 
01509 inline
01510 void ModelEvaluator::OutArgs::set_f_poly( const Teuchos::RefCountPtr<Teuchos::Polynomial<Epetra_Vector> > &f_poly )
01511 { f_poly_ = f_poly; }
01512 
01513 inline
01514 Teuchos::RefCountPtr<Teuchos::Polynomial<Epetra_Vector> >
01515 ModelEvaluator::OutArgs::get_f_poly() const
01516 { return f_poly_; }
01517 
01518 inline
01519 void ModelEvaluator::OutArgs::set_f_sg( const ModelEvaluator::OutArgs::sg_vector_t& f_sg )
01520 { f_sg_ = f_sg; }
01521 
01522 inline
01523 ModelEvaluator::OutArgs::sg_vector_t
01524 ModelEvaluator::OutArgs::get_f_sg() const
01525 { return f_sg_; }
01526 
01527 inline
01528 void ModelEvaluator::OutArgs::set_W_sg( const ModelEvaluator::OutArgs::sg_operator_t& W_sg ) { W_sg_ = W_sg; }
01529 
01530 inline
01531 ModelEvaluator::OutArgs::sg_operator_t ModelEvaluator::OutArgs::get_W_sg() const { return W_sg_; }
01532 
01533 //
01534 // ModelEvaluator::InArgsSetup
01535 //
01536 
01537 inline
01538 void ModelEvaluator::InArgsSetup::setModelEvalDescription( const std::string &new_modelEvalDescription )
01539 {
01540   this->_setModelEvalDescription(new_modelEvalDescription);
01541 }
01542 
01543 inline
01544 void ModelEvaluator::InArgsSetup::set_Np(int new_Np)
01545 { this->_set_Np(new_Np); }
01546 
01547 inline
01548 void ModelEvaluator::InArgsSetup::set_Np_sg(int new_Np)
01549 { this->_set_Np_sg(new_Np); }
01550 
01551 inline
01552 void ModelEvaluator::InArgsSetup::setSupports( EInArgsMembers arg, bool new_supports )
01553 { this->_setSupports(arg,new_supports); }
01554 
01555 //
01556 // ModelEvaluator::OutArgsSetup
01557 //
01558 
01559 inline
01560 void ModelEvaluator::OutArgsSetup::setModelEvalDescription( const std::string &new_modelEvalDescription )
01561 {
01562   this->_setModelEvalDescription(new_modelEvalDescription);
01563 }
01564 
01565 inline
01566 void ModelEvaluator::OutArgsSetup::set_Np_Ng(int new_Np, int new_Ng)
01567 { this->_set_Np_Ng(new_Np,new_Ng); }
01568 
01569 inline
01570 void ModelEvaluator::OutArgsSetup::set_Np_Ng_sg(int new_Np_sg, int new_Ng_sg)
01571 { this->_set_Np_Ng_sg(new_Np_sg, new_Ng_sg); }
01572 
01573 inline
01574 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsMembers arg, bool new_supports )
01575 { this->_setSupports(arg,new_supports); }
01576 
01577 inline
01578 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDfDp arg, int l, const DerivativeSupport& new_supports )
01579 { this->_setSupports(arg,l,new_supports); }
01580 
01581 inline
01582 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx_dot arg, int j, const DerivativeSupport& new_supports )
01583 { this->_setSupports(arg,j,new_supports); }
01584 
01585 inline
01586 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx arg, int j, const DerivativeSupport& new_supports )
01587 { this->_setSupports(arg,j,new_supports); }
01588 
01589 inline
01590 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDp arg, int j, int l, const DerivativeSupport& new_supports )
01591 { this->_setSupports(arg,j,l,new_supports); }
01592 
01593 inline
01594 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDfDp_sg arg, int l, const DerivativeSupport& new_supports )
01595 { this->_setSupports(arg,l,new_supports); }
01596 
01597 inline
01598 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx_dot_sg arg, int j, const DerivativeSupport& new_supports )
01599 { this->_setSupports(arg,j,new_supports); }
01600 
01601 inline
01602 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx_sg arg, int j, const DerivativeSupport& new_supports )
01603 { this->_setSupports(arg,j,new_supports); }
01604 
01605 inline
01606 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDp_sg arg, int j, int l, const DerivativeSupport& new_supports )
01607 { this->_setSupports(arg,j,l,new_supports); }
01608 
01609 inline
01610 void ModelEvaluator::OutArgsSetup::set_W_properties( const DerivativeProperties &properties )
01611 { this->_set_W_properties(properties); }
01612 inline
01613 void ModelEvaluator::OutArgsSetup::set_WPrec_properties( const DerivativeProperties &properties )
01614 { this->_set_WPrec_properties(properties); }
01615 
01616 inline
01617 void ModelEvaluator::OutArgsSetup::set_DfDp_properties( int l, const DerivativeProperties &properties )
01618 {
01619   this->_set_DfDp_properties(l,properties);
01620 }
01621 
01622 inline
01623 void ModelEvaluator::OutArgsSetup::set_DgDx_dot_properties( int j, const DerivativeProperties &properties )
01624 {
01625   this->_set_DgDx_dot_properties(j,properties);
01626 }
01627 
01628 inline
01629 void ModelEvaluator::OutArgsSetup::set_DgDx_properties( int j, const DerivativeProperties &properties )
01630 {
01631   this->_set_DgDx_properties(j,properties);
01632 }
01633 
01634 inline
01635 void ModelEvaluator::OutArgsSetup::set_DgDp_properties( int j, int l, const DerivativeProperties &properties )
01636 {
01637   this->_set_DgDp_properties(j,l,properties);
01638 }
01639 
01640 inline
01641 void ModelEvaluator::OutArgsSetup::set_DfDp_sg_properties( int l, const DerivativeProperties &properties )
01642 {
01643   this->_set_DfDp_sg_properties(l,properties);
01644 }
01645 
01646 inline
01647 void ModelEvaluator::OutArgsSetup::set_DgDx_dot_sg_properties( int j, const DerivativeProperties &properties )
01648 {
01649   this->_set_DgDx_dot_sg_properties(j,properties);
01650 }
01651 
01652 inline
01653 void ModelEvaluator::OutArgsSetup::set_DgDx_sg_properties( int j, const DerivativeProperties &properties )
01654 {
01655   this->_set_DgDx_sg_properties(j,properties);
01656 }
01657 
01658 inline
01659 void ModelEvaluator::OutArgsSetup::set_DgDp_sg_properties( int j, int l, const DerivativeProperties &properties )
01660 {
01661   this->_set_DgDp_sg_properties(j,l,properties);
01662 }
01663 
01664 } // namespace EpetraExt
01665 
01666 #endif // EPETRA_EXT_MODEL_EVALUATOR_HPP

Generated on Tue Jul 13 09:23:06 2010 for EpetraExt by  doxygen 1.4.7