|
EpetraExt
Development
|
00001 //@HEADER 00002 // *********************************************************************** 00003 // 00004 // EpetraExt: Epetra Extended - Linear Algebra Services Package 00005 // Copyright (2011) Sandia Corporation 00006 // 00007 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00008 // the U.S. Government retains certain rights in this software. 00009 // 00010 // Redistribution and use in source and binary forms, with or without 00011 // modification, are permitted provided that the following conditions are 00012 // met: 00013 // 00014 // 1. Redistributions of source code must retain the above copyright 00015 // notice, this list of conditions and the following disclaimer. 00016 // 00017 // 2. Redistributions in binary form must reproduce the above copyright 00018 // notice, this list of conditions and the following disclaimer in the 00019 // documentation and/or other materials provided with the distribution. 00020 // 00021 // 3. Neither the name of the Corporation nor the names of the 00022 // contributors may be used to endorse or promote products derived from 00023 // this software without specific prior written permission. 00024 // 00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY 00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE 00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00036 // 00037 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 00038 // 00039 // *********************************************************************** 00040 //@HEADER 00041 00042 #ifndef EPETRA_EXT_MODEL_EVALUATOR_HPP 00043 #define EPETRA_EXT_MODEL_EVALUATOR_HPP 00044 00045 #include "EpetraExt_ConfigDefs.h" 00046 #include "EpetraExt_PolynomialVectorTraits.h" 00047 #include "Teuchos_RefCountPtr.hpp" 00048 #include "Teuchos_Describable.hpp" 00049 #include "Teuchos_Polynomial.hpp" 00050 #include "Teuchos_Array.hpp" 00051 00052 #ifdef HAVE_PYTRILINOS 00053 #ifndef PyObject_HEAD 00054 struct _object; 00055 typedef _object PyObject; 00056 #endif 00057 #endif 00058 00059 class Epetra_Map; 00060 class Epetra_Vector; 00061 class Epetra_Operator; 00062 00063 // Forward declaration of Stochastic Galerkin (SG) argument types 00064 namespace Stokhos { 00065 class EpetraVectorOrthogPoly; 00066 class EpetraMultiVectorOrthogPoly; 00067 class EpetraOperatorOrthogPoly; 00068 template <typename ordinal_type, typename scalar_type> class OrthogPolyBasis; 00069 template <typename ordinal_type, typename scalar_type> class Quadrature; 00070 template <typename ordinal_type, typename scalar_type> class StandardStorage; 00071 template <typename ordinal_type, typename scalar_type, typename node_type> class OrthogPolyExpansion; 00072 00073 class ProductEpetraVector; 00074 class ProductEpetraMultiVector; 00075 class ProductEpetraOperator; 00076 } 00077 00078 namespace EpetraExt { 00079 00084 class ModelEvaluator : virtual public Teuchos::Describable { 00085 public: 00086 00089 00090 typedef Teuchos::RCP<const Stokhos::ProductEpetraVector> mp_const_vector_t; 00091 typedef Teuchos::RCP<const Stokhos::ProductEpetraMultiVector> mp_const_multivector_t; 00092 typedef Teuchos::RCP<const Stokhos::ProductEpetraOperator > mp_const_operator_t; 00093 typedef Teuchos::RCP<Stokhos::ProductEpetraVector> mp_vector_t; 00094 typedef Teuchos::RCP<Stokhos::ProductEpetraMultiVector> mp_multivector_t; 00095 typedef Teuchos::RCP<Stokhos::ProductEpetraOperator > mp_operator_t; 00096 00098 enum EInArgsMembers { 00099 IN_ARG_x_dot 00100 ,IN_ARG_x 00101 ,IN_ARG_x_dot_poly 00102 ,IN_ARG_x_poly 00103 ,IN_ARG_x_dot_sg 00104 ,IN_ARG_x_sg 00105 ,IN_ARG_x_dot_mp 00106 ,IN_ARG_x_mp 00107 ,IN_ARG_t 00108 ,IN_ARG_alpha 00109 ,IN_ARG_beta 00110 ,IN_ARG_sg_basis 00111 ,IN_ARG_sg_quadrature 00112 ,IN_ARG_sg_expansion 00113 }; 00114 static const int NUM_E_IN_ARGS_MEMBERS=14; 00115 00117 enum EInArgs_p_sg { 00118 IN_ARG_p_sg 00119 }; 00120 00122 enum EInArgs_p_mp { 00123 IN_ARG_p_mp 00124 }; 00125 00127 class InArgs { 00128 public: 00129 00131 typedef Teuchos::RefCountPtr<const Stokhos::EpetraVectorOrthogPoly> sg_const_vector_t; 00132 00134 InArgs(); 00136 std::string modelEvalDescription() const; 00138 int Np() const; 00140 void set_x_dot( const Teuchos::RefCountPtr<const Epetra_Vector> &x_dot ); 00142 Teuchos::RefCountPtr<const Epetra_Vector> get_x_dot() const; 00144 void set_x( const Teuchos::RefCountPtr<const Epetra_Vector> &x ); 00146 Teuchos::RefCountPtr<const Epetra_Vector> get_x() const; 00147 void set_x_poly( 00148 const Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > &x_poly 00149 ); 00151 Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > get_x_poly() const; 00153 void set_x_dot_poly( 00154 const Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > &x_dot_poly 00155 ); 00157 Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > get_x_dot_poly() const; 00159 void set_x_sg(const sg_const_vector_t &x_sg); 00161 sg_const_vector_t get_x_sg() const; 00163 void set_x_dot_sg(const sg_const_vector_t &x_dot_sg); 00165 sg_const_vector_t get_x_dot_sg() const; 00167 void set_x_mp(const mp_const_vector_t &x_mp); 00169 mp_const_vector_t get_x_mp() const; 00171 void set_x_dot_mp(const mp_const_vector_t &x_dot_mp); 00173 mp_const_vector_t get_x_dot_mp() const; 00175 void set_p( int l, const Teuchos::RefCountPtr<const Epetra_Vector> &p_l ); 00177 Teuchos::RefCountPtr<const Epetra_Vector> get_p(int l) const; 00179 void set_p_sg( int l, const sg_const_vector_t &p_sg_l ); 00181 sg_const_vector_t get_p_sg(int l) const; 00183 void set_p_mp( int l, const mp_const_vector_t &p_mp_l ); 00185 mp_const_vector_t get_p_mp(int l) const; 00187 void set_t( double t ); 00189 double get_alpha() const; 00191 void set_alpha( double alpha ); 00193 double get_beta() const; 00195 void set_beta( double beta ); 00197 double get_t() const; 00199 Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> > get_sg_basis() const; 00201 void set_sg_basis( const Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> >& basis ); 00203 Teuchos::RCP<const Stokhos::Quadrature<int,double> > get_sg_quadrature() const; 00205 void set_sg_quadrature( const Teuchos::RCP<const Stokhos::Quadrature<int,double> >& quad ); 00207 Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > > get_sg_expansion() const; 00209 void set_sg_expansion( const Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > >& exp ); 00211 bool supports(EInArgsMembers arg) const; 00213 bool supports(EInArgs_p_sg arg, int l) const; 00215 bool supports(EInArgs_p_mp arg, int l) const; 00216 protected: 00218 void _setModelEvalDescription( const std::string &modelEvalDescription ); 00220 void _set_Np(int Np); 00222 void _setSupports( EInArgsMembers arg, bool supports ); 00224 void _setSupports( EInArgs_p_sg arg, int l, bool supports ); 00226 void _setSupports( EInArgs_p_mp arg, int l, bool supports ); 00227 private: 00228 // types 00229 typedef Teuchos::Array<Teuchos::RefCountPtr<const Epetra_Vector> > p_t; 00230 typedef Teuchos::Array<sg_const_vector_t > p_sg_t; 00231 typedef Teuchos::Array<mp_const_vector_t > p_mp_t; 00232 typedef Teuchos::Array<bool> supports_p_sg_t; 00233 // data 00234 std::string modelEvalDescription_; 00235 Teuchos::RefCountPtr<const Epetra_Vector> x_dot_; 00236 Teuchos::RefCountPtr<const Epetra_Vector> x_; 00237 Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > x_dot_poly_; 00238 Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > x_poly_; 00239 sg_const_vector_t x_dot_sg_; 00240 sg_const_vector_t x_sg_; 00241 mp_const_vector_t x_dot_mp_; 00242 mp_const_vector_t x_mp_; 00243 p_t p_; 00244 p_sg_t p_sg_; 00245 p_mp_t p_mp_; 00246 double t_; 00247 double alpha_; 00248 double beta_; 00249 Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> > sg_basis_; 00250 Teuchos::RCP<const Stokhos::Quadrature<int,double> > sg_quad_; 00251 Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > > sg_exp_; 00252 bool supports_[NUM_E_IN_ARGS_MEMBERS]; 00253 supports_p_sg_t supports_p_sg_; // Np 00254 supports_p_sg_t supports_p_mp_; // Np 00255 // functions 00256 void assert_supports(EInArgsMembers arg) const; 00257 void assert_supports(EInArgs_p_sg arg, int l) const; 00258 void assert_supports(EInArgs_p_mp arg, int l) const; 00259 void assert_l(int l) const; 00260 }; 00261 00263 enum EEvalType { 00264 EVAL_TYPE_EXACT 00265 ,EVAL_TYPE_APPROX_DERIV 00266 ,EVAL_TYPE_VERY_APPROX_DERIV 00267 }; 00268 00270 template<class ObjType> 00271 class Evaluation : public Teuchos::RefCountPtr<ObjType> { 00272 public: 00274 Evaluation() : evalType_(EVAL_TYPE_EXACT) {} 00276 Evaluation( const Teuchos::RefCountPtr<ObjType> &obj ) 00277 : Teuchos::RefCountPtr<ObjType>(obj), evalType_(EVAL_TYPE_EXACT) {} 00279 Evaluation( const Teuchos::RefCountPtr<ObjType> &obj, EEvalType evalType ) 00280 : Teuchos::RefCountPtr<ObjType>(obj), evalType_(evalType) {} 00282 EEvalType getType() const { return evalType_; } 00284 void reset( const Teuchos::RefCountPtr<ObjType> &obj, EEvalType evalType ) 00285 { this->operator=(obj); evalType_ = evalType; } 00286 private: 00287 EEvalType evalType_; 00288 }; 00289 00291 enum EDerivativeMultiVectorOrientation { 00292 DERIV_MV_BY_COL 00293 ,DERIV_TRANS_MV_BY_ROW 00294 }; 00295 00297 enum EDerivativeLinearOp { DERIV_LINEAR_OP }; 00298 00300 class DerivativeSupport { 00301 public: 00303 DerivativeSupport() 00304 :supportsLinearOp_(false), supportsMVByCol_(false), supportsTransMVByRow_(false) 00305 {} 00307 DerivativeSupport( EDerivativeLinearOp ) 00308 :supportsLinearOp_(true), supportsMVByCol_(false), supportsTransMVByRow_(false) 00309 {} 00311 DerivativeSupport( EDerivativeMultiVectorOrientation mvOrientation ) 00312 :supportsLinearOp_(false), supportsMVByCol_(mvOrientation==DERIV_MV_BY_COL) 00313 ,supportsTransMVByRow_(mvOrientation==DERIV_TRANS_MV_BY_ROW) 00314 {} 00316 DerivativeSupport( 00317 EDerivativeLinearOp, EDerivativeMultiVectorOrientation mvOrientation ) 00318 :supportsLinearOp_(true), supportsMVByCol_(mvOrientation==DERIV_MV_BY_COL) 00319 ,supportsTransMVByRow_(mvOrientation==DERIV_TRANS_MV_BY_ROW) 00320 {} 00322 DerivativeSupport( 00323 EDerivativeMultiVectorOrientation mvOrientation1, 00324 EDerivativeMultiVectorOrientation mvOrientation2 00325 ) 00326 :supportsLinearOp_(false) 00327 ,supportsMVByCol_( 00328 mvOrientation1==DERIV_MV_BY_COL||mvOrientation2==DERIV_MV_BY_COL ) 00329 ,supportsTransMVByRow_( 00330 mvOrientation1==DERIV_TRANS_MV_BY_ROW||mvOrientation2==DERIV_TRANS_MV_BY_ROW ) 00331 {} 00333 DerivativeSupport& plus(EDerivativeLinearOp) 00334 { supportsLinearOp_ = true; return *this; } 00336 DerivativeSupport& plus(EDerivativeMultiVectorOrientation mvOrientation) 00337 { 00338 switch(mvOrientation) { 00339 case DERIV_MV_BY_COL: supportsMVByCol_ = true; break; 00340 case DERIV_TRANS_MV_BY_ROW: supportsTransMVByRow_ = true; break; 00341 default: TEUCHOS_TEST_FOR_EXCEPT(true); 00342 } 00343 return *this; 00344 } 00346 bool none() const 00347 { return ( !supportsLinearOp_ && !supportsMVByCol_ && !supportsTransMVByRow_ ); } 00349 bool supports(EDerivativeLinearOp) const 00350 { return supportsLinearOp_; } 00352 bool supports(EDerivativeMultiVectorOrientation mvOrientation) const 00353 { 00354 switch(mvOrientation) { 00355 case DERIV_MV_BY_COL: return supportsMVByCol_; 00356 case DERIV_TRANS_MV_BY_ROW: return supportsTransMVByRow_; 00357 default: TEUCHOS_TEST_FOR_EXCEPT(true); 00358 } 00359 return false; // Will never be called! 00360 } 00361 private: 00362 bool supportsLinearOp_; 00363 bool supportsMVByCol_; 00364 bool supportsTransMVByRow_; 00365 public: 00366 }; 00367 00369 enum EDerivativeLinearity { 00370 DERIV_LINEARITY_UNKNOWN 00371 ,DERIV_LINEARITY_CONST 00372 ,DERIV_LINEARITY_NONCONST 00373 }; 00375 enum ERankStatus { 00376 DERIV_RANK_UNKNOWN 00377 ,DERIV_RANK_FULL 00378 ,DERIV_RANK_DEFICIENT 00379 }; 00380 00382 struct DerivativeProperties { 00384 EDerivativeLinearity linearity; 00386 ERankStatus rank; 00388 bool supportsAdjoint; 00390 DerivativeProperties() 00391 :linearity(DERIV_LINEARITY_UNKNOWN),rank(DERIV_RANK_UNKNOWN),supportsAdjoint(false) {} 00393 DerivativeProperties( 00394 EDerivativeLinearity in_linearity, ERankStatus in_rank, bool in_supportsAdjoint 00395 ):linearity(in_linearity),rank(in_rank),supportsAdjoint(in_supportsAdjoint) {} 00396 }; 00397 00401 class DerivativeMultiVector { 00402 public: 00404 DerivativeMultiVector() {} 00406 DerivativeMultiVector( 00407 const Teuchos::RefCountPtr<Epetra_MultiVector> &mv 00408 ,const EDerivativeMultiVectorOrientation orientation = DERIV_MV_BY_COL 00409 ,const Teuchos::Array<int> ¶mIndexes = Teuchos::Array<int>() 00410 ) : mv_(mv), orientation_(orientation), paramIndexes_(paramIndexes) {} 00412 void changeOrientation( const EDerivativeMultiVectorOrientation orientation ) 00413 { orientation_ = orientation; }; 00415 Teuchos::RefCountPtr<Epetra_MultiVector> getMultiVector() const 00416 { return mv_; } 00418 EDerivativeMultiVectorOrientation getOrientation() const 00419 { return orientation_; } 00421 const Teuchos::Array<int>& getParamIndexes() const 00422 { return paramIndexes_; } 00423 private: 00424 Teuchos::RefCountPtr<Epetra_MultiVector> mv_; 00425 EDerivativeMultiVectorOrientation orientation_; 00426 Teuchos::Array<int> paramIndexes_; 00427 }; 00428 00432 class Derivative { 00433 public: 00435 Derivative() {} 00437 Derivative( const Teuchos::RefCountPtr<Epetra_Operator> &lo ) 00438 : lo_(lo) {} 00440 Derivative( 00441 const Teuchos::RefCountPtr<Epetra_MultiVector> &mv 00442 ,const EDerivativeMultiVectorOrientation orientation = DERIV_MV_BY_COL 00443 ) : dmv_(mv,orientation) {} 00445 Derivative( const DerivativeMultiVector &dmv ) 00446 : dmv_(dmv) {} 00448 Teuchos::RefCountPtr<Epetra_Operator> getLinearOp() const 00449 { return lo_; } 00451 Teuchos::RefCountPtr<Epetra_MultiVector> getMultiVector() const 00452 { return dmv_.getMultiVector(); } 00454 EDerivativeMultiVectorOrientation getMultiVectorOrientation() const 00455 { return dmv_.getOrientation(); } 00457 DerivativeMultiVector getDerivativeMultiVector() const 00458 { return dmv_; } 00460 bool isEmpty() const 00461 { return !lo_.get() && !dmv_.getMultiVector().get(); } 00462 private: 00463 Teuchos::RefCountPtr<Epetra_Operator> lo_; 00464 DerivativeMultiVector dmv_; 00465 }; 00466 00470 struct Preconditioner { 00472 Preconditioner() : PrecOp(Teuchos::null), isAlreadyInverted(false) {} 00474 Preconditioner(const Teuchos::RCP<Epetra_Operator>& PrecOp_, 00475 bool isAlreadyInverted_ ) 00476 : PrecOp(PrecOp_), isAlreadyInverted(isAlreadyInverted_) {} 00478 Teuchos::RCP<Epetra_Operator> PrecOp; 00483 bool isAlreadyInverted; 00484 }; 00485 00489 class SGDerivativeMultiVector { 00490 public: 00492 SGDerivativeMultiVector() {} 00494 SGDerivativeMultiVector( 00495 const Teuchos::RefCountPtr< Stokhos::EpetraMultiVectorOrthogPoly > &mv 00496 ,const EDerivativeMultiVectorOrientation orientation = DERIV_MV_BY_COL 00497 ,const Teuchos::Array<int> ¶mIndexes = Teuchos::Array<int>() 00498 ) : mv_(mv), orientation_(orientation), paramIndexes_(paramIndexes) {} 00500 void changeOrientation( const EDerivativeMultiVectorOrientation orientation ) 00501 { orientation_ = orientation; }; 00503 Teuchos::RefCountPtr< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const 00504 { return mv_; } 00506 EDerivativeMultiVectorOrientation getOrientation() const 00507 { return orientation_; } 00509 const Teuchos::Array<int>& getParamIndexes() const 00510 { return paramIndexes_; } 00511 private: 00512 Teuchos::RefCountPtr< Stokhos::EpetraMultiVectorOrthogPoly > mv_; 00513 EDerivativeMultiVectorOrientation orientation_; 00514 Teuchos::Array<int> paramIndexes_; 00515 }; 00516 00520 class SGDerivative { 00521 public: 00523 SGDerivative() {} 00525 SGDerivative( const Teuchos::RefCountPtr< Stokhos::EpetraOperatorOrthogPoly > &lo ) 00526 : lo_(lo) {} 00528 SGDerivative( 00529 const Teuchos::RefCountPtr< Stokhos::EpetraMultiVectorOrthogPoly > &mv 00530 ,const EDerivativeMultiVectorOrientation orientation = DERIV_MV_BY_COL 00531 ) : dmv_(mv,orientation) {} 00533 SGDerivative( const SGDerivativeMultiVector &dmv ) 00534 : dmv_(dmv) {} 00536 Teuchos::RefCountPtr< Stokhos::EpetraOperatorOrthogPoly > getLinearOp() const 00537 { return lo_; } 00539 Teuchos::RefCountPtr< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const 00540 { return dmv_.getMultiVector(); } 00542 EDerivativeMultiVectorOrientation getMultiVectorOrientation() const 00543 { return dmv_.getOrientation(); } 00545 SGDerivativeMultiVector getDerivativeMultiVector() const 00546 { return dmv_; } 00548 bool isEmpty() const 00549 { return !lo_.get() && !dmv_.getMultiVector().get(); } 00550 private: 00551 Teuchos::RefCountPtr< Stokhos::EpetraOperatorOrthogPoly > lo_; 00552 SGDerivativeMultiVector dmv_; 00553 }; 00554 00558 class MPDerivativeMultiVector { 00559 public: 00560 00562 MPDerivativeMultiVector() {} 00564 MPDerivativeMultiVector( 00565 const mp_multivector_t &mv 00566 ,const EDerivativeMultiVectorOrientation orientation = DERIV_MV_BY_COL 00567 ,const Teuchos::Array<int> ¶mIndexes = Teuchos::Array<int>() 00568 ) : mv_(mv), orientation_(orientation), paramIndexes_(paramIndexes) {} 00570 void changeOrientation( const EDerivativeMultiVectorOrientation orientation ) 00571 { orientation_ = orientation; }; 00573 mp_multivector_t getMultiVector() const 00574 { return mv_; } 00576 EDerivativeMultiVectorOrientation getOrientation() const 00577 { return orientation_; } 00579 const Teuchos::Array<int>& getParamIndexes() const 00580 { return paramIndexes_; } 00581 private: 00582 mp_multivector_t mv_; 00583 EDerivativeMultiVectorOrientation orientation_; 00584 Teuchos::Array<int> paramIndexes_; 00585 }; 00586 00590 class MPDerivative { 00591 public: 00592 00594 MPDerivative() {} 00596 MPDerivative( const mp_operator_t &lo ) 00597 : lo_(lo) {} 00599 MPDerivative( 00600 const mp_multivector_t &mv 00601 ,const EDerivativeMultiVectorOrientation orientation = DERIV_MV_BY_COL 00602 ) : dmv_(mv,orientation) {} 00604 MPDerivative( const MPDerivativeMultiVector &dmv ) 00605 : dmv_(dmv) {} 00607 mp_operator_t getLinearOp() const 00608 { return lo_; } 00610 mp_multivector_t getMultiVector() const 00611 { return dmv_.getMultiVector(); } 00613 EDerivativeMultiVectorOrientation getMultiVectorOrientation() const 00614 { return dmv_.getOrientation(); } 00616 MPDerivativeMultiVector getDerivativeMultiVector() const 00617 { return dmv_; } 00619 bool isEmpty() const 00620 { return !lo_.get() && !dmv_.getMultiVector().get(); } 00621 private: 00622 mp_operator_t lo_; 00623 MPDerivativeMultiVector dmv_; 00624 }; 00625 00627 enum EOutArgsMembers { 00628 OUT_ARG_f 00629 ,OUT_ARG_W 00630 ,OUT_ARG_f_poly 00631 ,OUT_ARG_f_sg 00632 ,OUT_ARG_W_sg 00633 ,OUT_ARG_f_mp 00634 ,OUT_ARG_W_mp 00635 ,OUT_ARG_WPrec 00636 }; 00637 static const int NUM_E_OUT_ARGS_MEMBERS=9; 00638 00640 enum EOutArgsDfDp { 00641 OUT_ARG_DfDp 00642 }; 00643 00645 enum EOutArgsDgDx_dot { 00646 OUT_ARG_DgDx_dot 00647 }; 00648 00650 enum EOutArgsDgDx { 00651 OUT_ARG_DgDx 00652 }; 00653 00655 enum EOutArgsDgDp { 00656 OUT_ARG_DgDp 00657 }; 00658 00660 enum EOutArgsDfDp_sg { 00661 OUT_ARG_DfDp_sg 00662 }; 00663 00665 enum EOutArgs_g_sg { 00666 OUT_ARG_g_sg 00667 }; 00668 00670 enum EOutArgsDgDx_dot_sg { 00671 OUT_ARG_DgDx_dot_sg 00672 }; 00673 00675 enum EOutArgsDgDx_sg { 00676 OUT_ARG_DgDx_sg 00677 }; 00678 00680 enum EOutArgsDgDp_sg { 00681 OUT_ARG_DgDp_sg 00682 }; 00683 00685 enum EOutArgsDfDp_mp { 00686 OUT_ARG_DfDp_mp 00687 }; 00688 00690 enum EOutArgs_g_mp { 00691 OUT_ARG_g_mp 00692 }; 00693 00695 enum EOutArgsDgDx_dot_mp { 00696 OUT_ARG_DgDx_dot_mp 00697 }; 00698 00700 enum EOutArgsDgDx_mp { 00701 OUT_ARG_DgDx_mp 00702 }; 00703 00705 enum EOutArgsDgDp_mp { 00706 OUT_ARG_DgDp_mp 00707 }; 00708 00710 class OutArgs { 00711 public: 00712 00714 typedef Teuchos::RefCountPtr<Stokhos::EpetraVectorOrthogPoly> sg_vector_t; 00715 00717 typedef Teuchos::RefCountPtr<Stokhos::EpetraOperatorOrthogPoly > sg_operator_t; 00718 00720 OutArgs(); 00722 std::string modelEvalDescription() const; 00724 int Np() const; 00726 int Ng() const; 00728 bool supports(EOutArgsMembers arg) const; 00730 const DerivativeSupport& supports(EOutArgsDfDp arg, int l) const; 00732 const DerivativeSupport& supports(EOutArgsDgDx_dot arg, int j) const; 00734 const DerivativeSupport& supports(EOutArgsDgDx arg, int j) const; 00736 const DerivativeSupport& supports(EOutArgsDgDp arg, int j, int l) const; 00738 bool supports(EOutArgs_g_sg arg, int j) const; 00740 const DerivativeSupport& supports(EOutArgsDfDp_sg arg, int l) const; 00742 const DerivativeSupport& supports(EOutArgsDgDx_dot_sg arg, int j) const; 00744 const DerivativeSupport& supports(EOutArgsDgDx_sg arg, int j) const; 00746 const DerivativeSupport& supports(EOutArgsDgDp_sg arg, int j, int l) const; 00748 const DerivativeSupport& supports(EOutArgsDfDp_mp arg, int l) const; 00750 bool supports(EOutArgs_g_mp arg, int j) const; 00752 const DerivativeSupport& supports(EOutArgsDgDx_dot_mp arg, int j) const; 00754 const DerivativeSupport& supports(EOutArgsDgDx_mp arg, int j) const; 00756 const DerivativeSupport& supports(EOutArgsDgDp_mp arg, int j, int l) const; 00758 void set_f( const Evaluation<Epetra_Vector> &f ); 00760 Evaluation<Epetra_Vector> get_f() const; 00762 void set_f_sg( const sg_vector_t& f_sg ); 00764 sg_vector_t get_f_sg() const; 00766 void set_f_mp( const mp_vector_t& f_sg ); 00768 mp_vector_t get_f_mp() const; 00770 void set_g( int j, const Evaluation<Epetra_Vector> &g_j ); 00772 Evaluation<Epetra_Vector> get_g(int j) const; 00775 void set_g_sg( int j, const sg_vector_t &g_sg_j ); 00778 sg_vector_t get_g_sg(int j) const; 00781 void set_g_mp( int j, const mp_vector_t &g_mp_j ); 00784 mp_vector_t get_g_mp(int j) const; 00786 void set_W( const Teuchos::RefCountPtr<Epetra_Operator> &W ); 00787 void set_WPrec( const Teuchos::RefCountPtr<Epetra_Operator> &WPrec ); 00789 Teuchos::RefCountPtr<Epetra_Operator> get_W() const; 00790 Teuchos::RefCountPtr<Epetra_Operator> get_WPrec() const; 00792 DerivativeProperties get_W_properties() const; 00793 DerivativeProperties get_WPrec_properties() const; 00795 void set_W_sg( const sg_operator_t& W_sg ); 00797 sg_operator_t get_W_sg() const; 00799 void set_W_mp( const mp_operator_t& W_sg ); 00801 mp_operator_t get_W_mp() const; 00803 void set_DfDp(int l, const Derivative &DfDp_l); 00805 Derivative get_DfDp(int l) const; 00807 DerivativeProperties get_DfDp_properties(int l) const; 00809 void set_DfDp_sg(int l, const SGDerivative &DfDp_sg_l); 00811 SGDerivative get_DfDp_sg(int l) const; 00813 DerivativeProperties get_DfDp_sg_properties(int l) const; 00815 void set_DfDp_mp(int l, const MPDerivative &DfDp_mp_l); 00817 MPDerivative get_DfDp_mp(int l) const; 00819 DerivativeProperties get_DfDp_mp_properties(int l) const; 00821 void set_DgDx_dot(int j, const Derivative &DgDx_dot_j); 00823 Derivative get_DgDx_dot(int j) const; 00825 DerivativeProperties get_DgDx_dot_properties(int j) const; 00827 void set_DgDx_dot_sg(int j, const SGDerivative &DgDx_dot_j); 00829 SGDerivative get_DgDx_dot_sg(int j) const; 00831 DerivativeProperties get_DgDx_dot_sg_properties(int j) const; 00833 void set_DgDx_dot_mp(int j, const MPDerivative &DgDx_dot_j); 00835 MPDerivative get_DgDx_dot_mp(int j) const; 00837 DerivativeProperties get_DgDx_dot_mp_properties(int j) const; 00839 void set_DgDx(int j, const Derivative &DgDx_j); 00841 Derivative get_DgDx(int j) const; 00843 DerivativeProperties get_DgDx_properties(int j) const; 00845 void set_DgDx_sg(int j, const SGDerivative &DgDx_j); 00847 SGDerivative get_DgDx_sg(int j) const; 00849 DerivativeProperties get_DgDx_sg_properties(int j) const; 00851 void set_DgDx_mp(int j, const MPDerivative &DgDx_j); 00853 MPDerivative get_DgDx_mp(int j) const; 00855 DerivativeProperties get_DgDx_mp_properties(int j) const; 00857 void set_DgDp( int j, int l, const Derivative &DgDp_j_l ); 00859 Derivative get_DgDp(int j, int l) const; 00861 DerivativeProperties get_DgDp_properties(int j, int l) const; 00863 void set_DgDp_sg( int j, int l, const SGDerivative &DgDp_sg_j_l ); 00865 SGDerivative get_DgDp_sg(int j, int l) const; 00867 DerivativeProperties get_DgDp_sg_properties(int j, int l) const; 00869 void set_DgDp_mp( int j, int l, const MPDerivative &DgDp_mp_j_l ); 00871 MPDerivative get_DgDp_mp(int j, int l) const; 00873 DerivativeProperties get_DgDp_mp_properties(int j, int l) const; 00874 00876 void set_f_poly( const Teuchos::RefCountPtr<Teuchos::Polynomial<Epetra_Vector> > &f_poly ); 00878 Teuchos::RefCountPtr<Teuchos::Polynomial<Epetra_Vector> > get_f_poly() const; 00879 00880 00882 bool funcOrDerivesAreSet(EOutArgsMembers arg) const; 00883 00889 void setFailed() const; 00895 bool isFailed() const; 00896 00897 protected: 00899 void _setModelEvalDescription( const std::string &modelEvalDescription ); 00901 void _set_Np_Ng(int Np, int Ng); 00903 void _setSupports( EOutArgsMembers arg, bool supports ); 00905 void _setSupports( EOutArgsDfDp arg, int l, const DerivativeSupport& ); 00907 void _setSupports( EOutArgsDgDx_dot arg, int j, const DerivativeSupport& ); 00909 void _setSupports( EOutArgsDgDx arg, int j, const DerivativeSupport& ); 00911 void _setSupports( EOutArgsDgDp arg, int j, int l, const DerivativeSupport& ); 00913 void _setSupports( EOutArgs_g_sg arg, int j, bool supports ); 00915 void _setSupports( EOutArgsDfDp_sg arg, int l, const DerivativeSupport& ); 00917 void _setSupports( EOutArgsDgDx_dot_sg arg, int j, const DerivativeSupport& ); 00919 void _setSupports( EOutArgsDgDx_sg arg, int j, const DerivativeSupport& ); 00921 void _setSupports( EOutArgsDgDp_sg arg, int j, int l, const DerivativeSupport& ); 00922 00924 void _setSupports( EOutArgs_g_mp arg, int j, bool supports ); 00926 void _setSupports( EOutArgsDfDp_mp arg, int l, const DerivativeSupport& ); 00928 void _setSupports( EOutArgsDgDx_dot_mp arg, int j, const DerivativeSupport& ); 00930 void _setSupports( EOutArgsDgDx_mp arg, int j, const DerivativeSupport& ); 00932 void _setSupports( EOutArgsDgDp_mp arg, int j, int l, const DerivativeSupport& ); 00934 void _set_W_properties( const DerivativeProperties &W_properties ); 00935 void _set_WPrec_properties( const DerivativeProperties &WPrec_properties ); 00937 void _set_DfDp_properties( int l, const DerivativeProperties &properties ); 00939 void _set_DgDx_dot_properties( int j, const DerivativeProperties &properties ); 00941 void _set_DgDx_properties( int j, const DerivativeProperties &properties ); 00943 void _set_DgDp_properties( int j, int l, const DerivativeProperties &properties ); 00945 void _set_DfDp_sg_properties( int l, const DerivativeProperties &properties ); 00947 void _set_DgDx_dot_sg_properties( int j, const DerivativeProperties &properties ); 00949 void _set_DgDx_sg_properties( int j, const DerivativeProperties &properties ); 00951 void _set_DgDp_sg_properties( int j, int l, const DerivativeProperties &properties ); 00952 00954 void _set_DfDp_mp_properties( int l, const DerivativeProperties &properties ); 00956 void _set_DgDx_dot_mp_properties( int j, const DerivativeProperties &properties ); 00958 void _set_DgDx_mp_properties( int j, const DerivativeProperties &properties ); 00960 void _set_DgDp_mp_properties( int j, int l, const DerivativeProperties &properties ); 00961 private: 00962 // types 00963 typedef Teuchos::Array<Evaluation<Epetra_Vector> > g_t; 00964 typedef Teuchos::Array<sg_vector_t > g_sg_t; 00965 typedef Teuchos::Array<mp_vector_t > g_mp_t; 00966 typedef Teuchos::Array<Derivative> deriv_t; 00967 typedef Teuchos::Array<SGDerivative> sg_deriv_t; 00968 typedef Teuchos::Array<MPDerivative> mp_deriv_t; 00969 typedef Teuchos::Array<DerivativeProperties> deriv_properties_t; 00970 typedef Teuchos::Array<DerivativeSupport> supports_t; 00971 typedef Teuchos::Array<bool> supports_g_sg_t; 00972 // data 00973 std::string modelEvalDescription_; 00974 mutable bool isFailed_; 00975 bool supports_[NUM_E_OUT_ARGS_MEMBERS]; 00976 supports_t supports_DfDp_; // Np 00977 supports_t supports_DgDx_dot_; // Ng 00978 supports_t supports_DgDx_; // Ng 00979 supports_t supports_DgDp_; // Ng x Np 00980 supports_g_sg_t supports_g_sg_; // Ng 00981 supports_t supports_DfDp_sg_; // Np 00982 supports_t supports_DgDx_dot_sg_; // Ng 00983 supports_t supports_DgDx_sg_; // Ng 00984 supports_t supports_DgDp_sg_; // Ng x Np 00985 supports_g_sg_t supports_g_mp_; // Ng 00986 supports_t supports_DfDp_mp_; // Np_mp 00987 supports_t supports_DgDx_dot_mp_; // Ng_mp 00988 supports_t supports_DgDx_mp_; // Ng_mp 00989 supports_t supports_DgDp_mp_; // Ng_mp x Np_mp 00990 Evaluation<Epetra_Vector> f_; 00991 g_t g_; 00992 g_sg_t g_sg_; 00993 g_mp_t g_mp_; 00994 Teuchos::RefCountPtr<Epetra_Operator> W_; 00995 Teuchos::RefCountPtr<Epetra_Operator> WPrec_; 00996 DerivativeProperties W_properties_; 00997 DerivativeProperties WPrec_properties_; 00998 deriv_t DfDp_; // Np 00999 deriv_properties_t DfDp_properties_; // Np 01000 deriv_t DgDx_dot_; // Ng 01001 deriv_t DgDx_; // Ng 01002 deriv_properties_t DgDx_dot_properties_; // Ng 01003 deriv_properties_t DgDx_properties_; // Ng 01004 deriv_t DgDp_; // Ng x Np 01005 deriv_properties_t DgDp_properties_; // Ng x Np 01006 Teuchos::RefCountPtr<Teuchos::Polynomial<Epetra_Vector> > f_poly_; 01007 sg_vector_t f_sg_; 01008 sg_operator_t W_sg_; 01009 sg_deriv_t DfDp_sg_; // Np 01010 deriv_properties_t DfDp_sg_properties_; // Np 01011 sg_deriv_t DgDx_dot_sg_; // Ng 01012 sg_deriv_t DgDx_sg_; // Ng 01013 deriv_properties_t DgDx_dot_sg_properties_; // Ng 01014 deriv_properties_t DgDx_sg_properties_; // Ng 01015 sg_deriv_t DgDp_sg_; // Ng x Np 01016 deriv_properties_t DgDp_sg_properties_; // Ng x Np 01017 mp_vector_t f_mp_; 01018 mp_operator_t W_mp_; 01019 mp_deriv_t DfDp_mp_; // Np 01020 deriv_properties_t DfDp_mp_properties_; // Np 01021 mp_deriv_t DgDx_dot_mp_; // Ng 01022 mp_deriv_t DgDx_mp_; // Ng 01023 deriv_properties_t DgDx_dot_mp_properties_; // Ng 01024 deriv_properties_t DgDx_mp_properties_; // Ng 01025 mp_deriv_t DgDp_mp_; // Ng x Np 01026 deriv_properties_t DgDp_mp_properties_; // Ng x Np 01027 // functions 01028 void assert_supports(EOutArgsMembers arg) const; 01029 void assert_supports(EOutArgsDfDp arg, int l) const; 01030 void assert_supports(EOutArgsDgDx_dot arg, int j) const; 01031 void assert_supports(EOutArgsDgDx arg, int j) const; 01032 void assert_supports(EOutArgsDgDp arg, int j, int l) const; 01033 void assert_supports(EOutArgs_g_sg arg, int j) const; 01034 void assert_supports(EOutArgsDfDp_sg arg, int l) const; 01035 void assert_supports(EOutArgsDgDx_dot_sg arg, int j) const; 01036 void assert_supports(EOutArgsDgDx_sg arg, int j) const; 01037 void assert_supports(EOutArgsDgDp_sg arg, int j, int l) const; 01038 void assert_supports(EOutArgs_g_mp arg, int j) const; 01039 void assert_supports(EOutArgsDfDp_mp arg, int l) const; 01040 void assert_supports(EOutArgsDgDx_dot_mp arg, int j) const; 01041 void assert_supports(EOutArgsDgDx_mp arg, int j) const; 01042 void assert_supports(EOutArgsDgDp_mp arg, int j, int l) const; 01043 void assert_l(int l) const; 01044 void assert_j(int j) const; 01045 }; 01046 01048 01051 01053 virtual ~ModelEvaluator(); 01054 01056 01059 01061 virtual Teuchos::RefCountPtr<const Epetra_Map> get_x_map() const = 0; 01062 01064 virtual Teuchos::RefCountPtr<const Epetra_Map> get_f_map() const = 0; 01065 01067 virtual Teuchos::RefCountPtr<const Epetra_Map> get_p_map(int l) const; 01068 01083 virtual Teuchos::RefCountPtr<const Teuchos::Array<std::string> > get_p_names(int l) const; 01084 01086 virtual Teuchos::RefCountPtr<const Epetra_Map> get_g_map(int j) const; 01087 01089 01092 01094 virtual Teuchos::RefCountPtr<const Epetra_Vector> get_x_init() const; 01095 01097 virtual Teuchos::RefCountPtr<const Epetra_Vector> get_x_dot_init() const; 01098 01100 virtual Teuchos::RefCountPtr<const Epetra_Vector> get_p_init(int l) const; 01101 01103 virtual double get_t_init() const; 01104 01106 01109 01114 virtual double getInfBound() const; 01115 01117 virtual Teuchos::RefCountPtr<const Epetra_Vector> get_x_lower_bounds() const; 01118 01120 virtual Teuchos::RefCountPtr<const Epetra_Vector> get_x_upper_bounds() const; 01121 01123 virtual Teuchos::RefCountPtr<const Epetra_Vector> get_p_lower_bounds(int l) const; 01124 01126 virtual Teuchos::RefCountPtr<const Epetra_Vector> get_p_upper_bounds(int l) const; 01127 01129 virtual double get_t_lower_bound() const; 01130 01132 virtual double get_t_upper_bound() const; 01133 01135 01138 01145 virtual Teuchos::RefCountPtr<Epetra_Operator> create_W() const; 01146 virtual Teuchos::RefCountPtr<EpetraExt::ModelEvaluator::Preconditioner> create_WPrec() const; 01147 01149 virtual Teuchos::RefCountPtr<Epetra_Operator> create_DfDp_op(int l) const; 01150 01152 virtual Teuchos::RefCountPtr<Epetra_Operator> create_DgDx_dot_op(int j) const; 01153 01155 virtual Teuchos::RefCountPtr<Epetra_Operator> create_DgDx_op(int j) const; 01156 01158 virtual Teuchos::RefCountPtr<Epetra_Operator> create_DgDp_op( int j, int l ) const; 01159 01161 01164 01166 virtual InArgs createInArgs() const = 0; 01167 01169 virtual OutArgs createOutArgs() const = 0; 01170 01172 virtual void evalModel( const InArgs& inArgs, const OutArgs& outArgs ) const = 0; 01173 01174 #ifdef HAVE_PYTRILINOS 01175 01176 friend InArgs convertInArgsFromPython(PyObject * source); 01177 01179 friend OutArgs convertOutArgsFromPython(PyObject * source); 01180 #endif 01181 01182 01183 protected: 01184 01187 01189 class InArgsSetup : public InArgs { 01190 public: 01192 void setModelEvalDescription( const std::string &modelEvalDescription ); 01194 void set_Np(int Np); 01196 void setSupports( EInArgsMembers arg, bool supports = true ); 01198 void setSupports( EInArgs_p_sg arg, int l, bool supports ); 01200 void setSupports( EInArgs_p_mp arg, int l, bool supports ); 01201 }; 01202 01204 class OutArgsSetup : public OutArgs { 01205 public: 01207 void setModelEvalDescription( const std::string &modelEvalDescription ); 01209 void set_Np_Ng(int Np, int Ng); 01211 void setSupports( EOutArgsMembers arg, bool supports = true ); 01213 void setSupports(EOutArgsDfDp arg, int l, const DerivativeSupport& ); 01215 void setSupports(EOutArgsDgDx_dot arg, int j, const DerivativeSupport& ); 01217 void setSupports(EOutArgsDgDx arg, int j, const DerivativeSupport& ); 01219 void setSupports(EOutArgsDgDp arg, int j, int l, const DerivativeSupport& ); 01221 void setSupports( EOutArgs_g_sg arg, int j, bool supports ); 01223 void setSupports(EOutArgsDfDp_sg arg, int l, const DerivativeSupport& ); 01225 void setSupports(EOutArgsDgDx_dot_sg arg, int j, const DerivativeSupport& ); 01227 void setSupports(EOutArgsDgDx_sg arg, int j, const DerivativeSupport& ); 01229 void setSupports(EOutArgsDgDp_sg arg, int j, int l, const DerivativeSupport& ); 01231 void setSupports( EOutArgs_g_mp arg, int j, bool supports ); 01233 void setSupports(EOutArgsDfDp_mp arg, int l, const DerivativeSupport& ); 01235 void setSupports(EOutArgsDgDx_dot_mp arg, int j, const DerivativeSupport& ); 01237 void setSupports(EOutArgsDgDx_mp arg, int j, const DerivativeSupport& ); 01239 void setSupports(EOutArgsDgDp_mp arg, int j, int l, const DerivativeSupport& ); 01241 void set_W_properties( const DerivativeProperties &properties ); 01242 void set_WPrec_properties( const DerivativeProperties &properties ); 01244 void set_DfDp_properties( int l, const DerivativeProperties &properties ); 01246 void set_DgDx_dot_properties( int j, const DerivativeProperties &properties ); 01248 void set_DgDx_properties( int j, const DerivativeProperties &properties ); 01250 void set_DgDp_properties( int j, int l, const DerivativeProperties &properties ); 01252 void set_DfDp_sg_properties( int l, const DerivativeProperties &properties ); 01254 void set_DgDx_dot_sg_properties( int j, const DerivativeProperties &properties ); 01256 void set_DgDx_sg_properties( int j, const DerivativeProperties &properties ); 01258 void set_DgDp_sg_properties( int j, int l, const DerivativeProperties &properties ); 01260 void set_DfDp_mp_properties( int l, const DerivativeProperties &properties ); 01262 void set_DgDx_dot_mp_properties( int j, const DerivativeProperties &properties ); 01264 void set_DgDx_mp_properties( int j, const DerivativeProperties &properties ); 01266 void set_DgDp_mp_properties( int j, int l, const DerivativeProperties &properties ); 01267 }; 01268 01270 01271 }; 01272 01273 // //////////////////////////// 01274 // Helper functions 01275 01277 std::string toString( ModelEvaluator::EDerivativeMultiVectorOrientation orientation ); 01278 01280 std::string toString( ModelEvaluator::EInArgsMembers inArg ); 01281 01283 std::string toString( ModelEvaluator::EOutArgsMembers outArg ); 01284 01286 Teuchos::RefCountPtr<Epetra_Operator> 01287 getLinearOp( 01288 const std::string &modelEvalDescription, 01289 const ModelEvaluator::Derivative &deriv, 01290 const std::string &derivName 01291 ); 01292 01294 Teuchos::RefCountPtr<Epetra_MultiVector> 01295 getMultiVector( 01296 const std::string &modelEvalDescription, 01297 const ModelEvaluator::Derivative &deriv, 01298 const std::string &derivName, 01299 const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation 01300 ); 01301 01303 Teuchos::RefCountPtr<Epetra_Operator> 01304 get_DfDp_op( 01305 const int l 01306 ,const ModelEvaluator::OutArgs &outArgs 01307 ); 01308 01310 Teuchos::RefCountPtr<Epetra_MultiVector> 01311 get_DfDp_mv( 01312 const int l 01313 ,const ModelEvaluator::OutArgs &outArgs 01314 ); 01315 01317 Teuchos::RefCountPtr<Epetra_MultiVector> 01318 get_DgDx_dot_mv( 01319 const int j 01320 ,const ModelEvaluator::OutArgs &outArgs 01321 ,const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation 01322 ); 01323 01325 Teuchos::RefCountPtr<Epetra_MultiVector> 01326 get_DgDx_mv( 01327 const int j 01328 ,const ModelEvaluator::OutArgs &outArgs 01329 ,const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation 01330 ); 01331 01333 Teuchos::RefCountPtr<Epetra_MultiVector> 01334 get_DgDp_mv( 01335 const int j 01336 ,const int l 01337 ,const ModelEvaluator::OutArgs &outArgs 01338 ,const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation 01339 ); 01340 01341 // /////////////////////////// 01342 // Inline Functions 01343 01344 // 01345 // ModelEvaluator::InArgs 01346 // 01347 01348 inline 01349 std::string ModelEvaluator::InArgs::modelEvalDescription() const 01350 { return modelEvalDescription_; } 01351 01352 inline 01353 int ModelEvaluator::InArgs::Np() const 01354 { return p_.size(); } 01355 01356 inline 01357 void ModelEvaluator::InArgs::set_x_dot( const Teuchos::RefCountPtr<const Epetra_Vector> &x_dot ) 01358 { assert_supports(IN_ARG_x_dot); x_dot_ = x_dot; } 01359 01360 inline 01361 Teuchos::RefCountPtr<const Epetra_Vector> ModelEvaluator::InArgs::get_x_dot() const 01362 { assert_supports(IN_ARG_x_dot); return x_dot_; } 01363 01364 inline 01365 void ModelEvaluator::InArgs::set_x( const Teuchos::RefCountPtr<const Epetra_Vector> &x ) 01366 { assert_supports(IN_ARG_x); x_ = x; } 01367 01368 inline 01369 Teuchos::RefCountPtr<const Epetra_Vector> ModelEvaluator::InArgs::get_x() const 01370 { assert_supports(IN_ARG_x); return x_; } 01371 01372 inline 01373 void ModelEvaluator::InArgs::set_x_dot_poly( const Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > &x_dot_poly ) 01374 { assert_supports(IN_ARG_x_dot_poly); x_dot_poly_ = x_dot_poly; } 01375 01376 inline 01377 Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > 01378 ModelEvaluator::InArgs::get_x_dot_poly() const 01379 { assert_supports(IN_ARG_x_dot_poly); return x_dot_poly_; } 01380 01381 inline 01382 void ModelEvaluator::InArgs::set_x_poly( const Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > &x_poly ) 01383 { assert_supports(IN_ARG_x_poly); x_poly_ = x_poly; } 01384 01385 inline 01386 Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > 01387 ModelEvaluator::InArgs::get_x_poly() const 01388 { assert_supports(IN_ARG_x_poly); return x_poly_; } 01389 01390 inline 01391 void ModelEvaluator::InArgs::set_x_dot_sg( const ModelEvaluator::InArgs::sg_const_vector_t &x_dot_sg ) 01392 { assert_supports(IN_ARG_x_dot_sg); x_dot_sg_ = x_dot_sg; } 01393 01394 inline 01395 ModelEvaluator::InArgs::sg_const_vector_t 01396 ModelEvaluator::InArgs::get_x_dot_sg() const 01397 { assert_supports(IN_ARG_x_dot_sg); return x_dot_sg_; } 01398 01399 inline 01400 void ModelEvaluator::InArgs::set_x_dot_mp( const ModelEvaluator::mp_const_vector_t &x_dot_mp ) 01401 { assert_supports(IN_ARG_x_dot_mp); x_dot_mp_ = x_dot_mp; } 01402 01403 inline 01404 ModelEvaluator::mp_const_vector_t 01405 ModelEvaluator::InArgs::get_x_dot_mp() const 01406 { assert_supports(IN_ARG_x_dot_mp); return x_dot_mp_; } 01407 01408 inline 01409 void ModelEvaluator::InArgs::set_x_sg( const ModelEvaluator::InArgs::sg_const_vector_t &x_sg ) 01410 { assert_supports(IN_ARG_x_sg); x_sg_ = x_sg; } 01411 01412 inline 01413 ModelEvaluator::InArgs::sg_const_vector_t 01414 ModelEvaluator::InArgs::get_x_sg() const 01415 { assert_supports(IN_ARG_x_sg); return x_sg_; } 01416 01417 inline 01418 void ModelEvaluator::InArgs::set_x_mp( const ModelEvaluator::mp_const_vector_t &x_mp ) 01419 { assert_supports(IN_ARG_x_mp); x_mp_ = x_mp; } 01420 01421 inline 01422 ModelEvaluator::mp_const_vector_t 01423 ModelEvaluator::InArgs::get_x_mp() const 01424 { assert_supports(IN_ARG_x_mp); return x_mp_; } 01425 01426 inline 01427 void ModelEvaluator::InArgs::set_p( int l, const Teuchos::RefCountPtr<const Epetra_Vector> &p_l ) 01428 { assert_l(l); p_[l] = p_l; } 01429 01430 inline 01431 Teuchos::RefCountPtr<const Epetra_Vector> ModelEvaluator::InArgs::get_p(int l) const 01432 { assert_l(l); return p_[l]; } 01433 01434 inline 01435 void ModelEvaluator::InArgs::set_p_sg( int l, 01436 const ModelEvaluator::InArgs::sg_const_vector_t &p_sg_l ) 01437 { assert_supports(IN_ARG_p_sg, l); p_sg_[l] = p_sg_l; } 01438 01439 inline 01440 ModelEvaluator::InArgs::sg_const_vector_t 01441 ModelEvaluator::InArgs::get_p_sg(int l) const 01442 { assert_supports(IN_ARG_p_sg, l); return p_sg_[l]; } 01443 01444 inline 01445 void ModelEvaluator::InArgs::set_p_mp( int l, 01446 const ModelEvaluator::mp_const_vector_t &p_mp_l ) 01447 { assert_supports(IN_ARG_p_mp, l); p_mp_[l] = p_mp_l; } 01448 01449 inline 01450 ModelEvaluator::mp_const_vector_t 01451 ModelEvaluator::InArgs::get_p_mp(int l) const 01452 { assert_supports(IN_ARG_p_mp, l); return p_mp_[l]; } 01453 01454 inline 01455 void ModelEvaluator::InArgs::set_t( double t ) 01456 { assert_supports(IN_ARG_t); t_ = t; } 01457 01458 inline 01459 double ModelEvaluator::InArgs::get_t() const 01460 { assert_supports(IN_ARG_t); return t_; } 01461 01462 inline 01463 void ModelEvaluator::InArgs::set_alpha( double alpha ) 01464 { assert_supports(IN_ARG_alpha); alpha_ = alpha; } 01465 01466 inline 01467 double ModelEvaluator::InArgs::get_alpha() const 01468 { assert_supports(IN_ARG_alpha); return alpha_; } 01469 01470 inline 01471 void ModelEvaluator::InArgs::set_beta( double beta ) 01472 { assert_supports(IN_ARG_beta); beta_ = beta; } 01473 01474 inline 01475 double ModelEvaluator::InArgs::get_beta() const 01476 { assert_supports(IN_ARG_beta); return beta_; } 01477 01478 inline 01479 void ModelEvaluator::InArgs::set_sg_basis( const Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> >& basis ) 01480 { assert_supports(IN_ARG_sg_basis); sg_basis_ = basis; } 01481 01482 inline 01483 Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> > 01484 ModelEvaluator::InArgs::get_sg_basis() const 01485 { assert_supports(IN_ARG_sg_basis); return sg_basis_; } 01486 01487 inline 01488 void ModelEvaluator::InArgs::set_sg_quadrature( const Teuchos::RCP<const Stokhos::Quadrature<int,double> >& quad ) 01489 { assert_supports(IN_ARG_sg_quadrature); sg_quad_ = quad; } 01490 01491 inline 01492 Teuchos::RCP<const Stokhos::Quadrature<int,double> > 01493 ModelEvaluator::InArgs::get_sg_quadrature() const 01494 { assert_supports(IN_ARG_sg_quadrature); return sg_quad_; } 01495 01496 inline 01497 void ModelEvaluator::InArgs::set_sg_expansion( const Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > >& exp ) 01498 { assert_supports(IN_ARG_sg_expansion); sg_exp_ = exp; } 01499 01500 inline 01501 Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > > 01502 ModelEvaluator::InArgs::get_sg_expansion() const 01503 { assert_supports(IN_ARG_sg_expansion); return sg_exp_; } 01504 01505 inline 01506 void ModelEvaluator::InArgs::_setModelEvalDescription( const std::string &new_modelEvalDescription ) 01507 { 01508 modelEvalDescription_ = new_modelEvalDescription; 01509 } 01510 01511 inline 01512 void ModelEvaluator::InArgs::_set_Np(int new_Np) 01513 { 01514 p_.resize(new_Np); 01515 p_sg_.resize(new_Np); 01516 p_mp_.resize(new_Np); 01517 supports_p_sg_.resize(new_Np); 01518 supports_p_mp_.resize(new_Np); 01519 } 01520 01521 // 01522 // ModelEvaluator::OutArgs 01523 // 01524 01525 inline 01526 std::string ModelEvaluator::OutArgs::modelEvalDescription() const 01527 { return modelEvalDescription_; } 01528 01529 inline 01530 int ModelEvaluator::OutArgs::Np() const 01531 { 01532 return DfDp_.size(); 01533 } 01534 01535 inline 01536 int ModelEvaluator::OutArgs::Ng() const 01537 { 01538 return g_.size(); 01539 } 01540 01541 inline 01542 void ModelEvaluator::OutArgs::set_f( const Evaluation<Epetra_Vector> &f ) { f_ = f; } 01543 01544 inline 01545 ModelEvaluator::Evaluation<Epetra_Vector> 01546 ModelEvaluator::OutArgs::get_f() const { return f_; } 01547 01548 inline 01549 void ModelEvaluator::OutArgs::set_g( int j, const Evaluation<Epetra_Vector> &g_j ) 01550 { 01551 assert_j(j); 01552 g_[j] = g_j; 01553 } 01554 01555 inline 01556 ModelEvaluator::Evaluation<Epetra_Vector> 01557 ModelEvaluator::OutArgs::get_g(int j) const 01558 { 01559 assert_j(j); 01560 return g_[j]; 01561 } 01562 01563 inline 01564 void ModelEvaluator::OutArgs::set_g_sg( int j, const sg_vector_t &g_sg_j ) 01565 { 01566 assert_supports(OUT_ARG_g_sg, j); 01567 g_sg_[j] = g_sg_j; 01568 } 01569 01570 inline 01571 ModelEvaluator::OutArgs::sg_vector_t 01572 ModelEvaluator::OutArgs::get_g_sg(int j) const 01573 { 01574 assert_supports(OUT_ARG_g_sg, j); 01575 return g_sg_[j]; 01576 } 01577 01578 inline 01579 void ModelEvaluator::OutArgs::set_g_mp( int j, const mp_vector_t &g_mp_j ) 01580 { 01581 assert_supports(OUT_ARG_g_mp, j); 01582 g_mp_[j] = g_mp_j; 01583 } 01584 01585 inline 01586 ModelEvaluator::mp_vector_t 01587 ModelEvaluator::OutArgs::get_g_mp(int j) const 01588 { 01589 assert_supports(OUT_ARG_g_mp, j); 01590 return g_mp_[j]; 01591 } 01592 01593 inline 01594 void ModelEvaluator::OutArgs::set_W( const Teuchos::RefCountPtr<Epetra_Operator> &W ) { W_ = W; } 01595 inline 01596 void ModelEvaluator::OutArgs::set_WPrec( const Teuchos::RefCountPtr<Epetra_Operator> &WPrec ) { WPrec_ = WPrec; } 01597 01598 inline 01599 Teuchos::RefCountPtr<Epetra_Operator> ModelEvaluator::OutArgs::get_W() const { return W_; } 01600 inline 01601 Teuchos::RefCountPtr<Epetra_Operator> ModelEvaluator::OutArgs::get_WPrec() const { return WPrec_; } 01602 01603 inline 01604 ModelEvaluator::DerivativeProperties ModelEvaluator::OutArgs::get_W_properties() const 01605 { return W_properties_; } 01606 inline 01607 ModelEvaluator::DerivativeProperties ModelEvaluator::OutArgs::get_WPrec_properties() const 01608 { return WPrec_properties_; } 01609 01610 inline 01611 void ModelEvaluator::OutArgs::set_DfDp( int l, const Derivative &DfDp_l ) 01612 { 01613 assert_supports(OUT_ARG_DfDp,l); 01614 DfDp_[l] = DfDp_l; 01615 } 01616 01617 inline 01618 ModelEvaluator::Derivative 01619 ModelEvaluator::OutArgs::get_DfDp(int l) const 01620 { 01621 assert_supports(OUT_ARG_DfDp,l); 01622 return DfDp_[l]; 01623 } 01624 01625 inline 01626 ModelEvaluator::DerivativeProperties 01627 ModelEvaluator::OutArgs::get_DfDp_properties(int l) const 01628 { 01629 assert_supports(OUT_ARG_DfDp,l); 01630 return DfDp_properties_[l]; 01631 } 01632 01633 inline 01634 void ModelEvaluator::OutArgs::set_DfDp_sg( int l, const SGDerivative &DfDp_sg_l ) 01635 { 01636 assert_supports(OUT_ARG_DfDp_sg,l); 01637 DfDp_sg_[l] = DfDp_sg_l; 01638 } 01639 01640 inline 01641 ModelEvaluator::SGDerivative 01642 ModelEvaluator::OutArgs::get_DfDp_sg(int l) const 01643 { 01644 assert_supports(OUT_ARG_DfDp_sg,l); 01645 return DfDp_sg_[l]; 01646 } 01647 01648 inline 01649 ModelEvaluator::DerivativeProperties 01650 ModelEvaluator::OutArgs::get_DfDp_sg_properties(int l) const 01651 { 01652 assert_supports(OUT_ARG_DfDp_sg,l); 01653 return DfDp_sg_properties_[l]; 01654 } 01655 01656 inline 01657 void ModelEvaluator::OutArgs::set_DfDp_mp( int l, const MPDerivative &DfDp_mp_l ) 01658 { 01659 assert_supports(OUT_ARG_DfDp_mp,l); 01660 DfDp_mp_[l] = DfDp_mp_l; 01661 } 01662 01663 inline 01664 ModelEvaluator::MPDerivative 01665 ModelEvaluator::OutArgs::get_DfDp_mp(int l) const 01666 { 01667 assert_supports(OUT_ARG_DfDp_mp,l); 01668 return DfDp_mp_[l]; 01669 } 01670 01671 inline 01672 ModelEvaluator::DerivativeProperties 01673 ModelEvaluator::OutArgs::get_DfDp_mp_properties(int l) const 01674 { 01675 assert_supports(OUT_ARG_DfDp_mp,l); 01676 return DfDp_mp_properties_[l]; 01677 } 01678 01679 inline 01680 void ModelEvaluator::OutArgs::set_DgDx_dot( int j, const Derivative &DgDx_dot_j ) 01681 { 01682 assert_supports(OUT_ARG_DgDx_dot,j); 01683 DgDx_dot_[j] = DgDx_dot_j; 01684 } 01685 01686 inline 01687 ModelEvaluator::Derivative 01688 ModelEvaluator::OutArgs::get_DgDx_dot(int j) const 01689 { 01690 assert_supports(OUT_ARG_DgDx_dot,j); 01691 return DgDx_dot_[j]; 01692 } 01693 01694 inline 01695 ModelEvaluator::DerivativeProperties 01696 ModelEvaluator::OutArgs::get_DgDx_dot_properties(int j) const 01697 { 01698 assert_supports(OUT_ARG_DgDx_dot,j); 01699 return DgDx_dot_properties_[j]; 01700 } 01701 01702 inline 01703 void ModelEvaluator::OutArgs::set_DgDx_dot_sg( int j, const SGDerivative &DgDx_dot_sg_j ) 01704 { 01705 assert_supports(OUT_ARG_DgDx_dot_sg,j); 01706 DgDx_dot_sg_[j] = DgDx_dot_sg_j; 01707 } 01708 01709 inline 01710 ModelEvaluator::SGDerivative 01711 ModelEvaluator::OutArgs::get_DgDx_dot_sg(int j) const 01712 { 01713 assert_supports(OUT_ARG_DgDx_dot_sg,j); 01714 return DgDx_dot_sg_[j]; 01715 } 01716 01717 inline 01718 ModelEvaluator::DerivativeProperties 01719 ModelEvaluator::OutArgs::get_DgDx_dot_sg_properties(int j) const 01720 { 01721 assert_supports(OUT_ARG_DgDx_dot_sg,j); 01722 return DgDx_dot_sg_properties_[j]; 01723 } 01724 01725 inline 01726 void ModelEvaluator::OutArgs::set_DgDx_dot_mp( int j, const MPDerivative &DgDx_dot_mp_j ) 01727 { 01728 assert_supports(OUT_ARG_DgDx_dot_mp,j); 01729 DgDx_dot_mp_[j] = DgDx_dot_mp_j; 01730 } 01731 01732 inline 01733 ModelEvaluator::MPDerivative 01734 ModelEvaluator::OutArgs::get_DgDx_dot_mp(int j) const 01735 { 01736 assert_supports(OUT_ARG_DgDx_dot_mp,j); 01737 return DgDx_dot_mp_[j]; 01738 } 01739 01740 inline 01741 ModelEvaluator::DerivativeProperties 01742 ModelEvaluator::OutArgs::get_DgDx_dot_mp_properties(int j) const 01743 { 01744 assert_supports(OUT_ARG_DgDx_dot_mp,j); 01745 return DgDx_dot_mp_properties_[j]; 01746 } 01747 01748 inline 01749 void ModelEvaluator::OutArgs::set_DgDx( int j, const Derivative &DgDx_j ) 01750 { 01751 assert_supports(OUT_ARG_DgDx,j); 01752 DgDx_[j] = DgDx_j; 01753 } 01754 01755 inline 01756 ModelEvaluator::Derivative 01757 ModelEvaluator::OutArgs::get_DgDx(int j) const 01758 { 01759 assert_supports(OUT_ARG_DgDx,j); 01760 return DgDx_[j]; 01761 } 01762 01763 inline 01764 ModelEvaluator::DerivativeProperties 01765 ModelEvaluator::OutArgs::get_DgDx_properties(int j) const 01766 { 01767 assert_supports(OUT_ARG_DgDx,j); 01768 return DgDx_properties_[j]; 01769 } 01770 01771 inline 01772 void ModelEvaluator::OutArgs::set_DgDx_sg( int j, const SGDerivative &DgDx_sg_j ) 01773 { 01774 assert_supports(OUT_ARG_DgDx_sg,j); 01775 DgDx_sg_[j] = DgDx_sg_j; 01776 } 01777 01778 inline 01779 ModelEvaluator::SGDerivative 01780 ModelEvaluator::OutArgs::get_DgDx_sg(int j) const 01781 { 01782 assert_supports(OUT_ARG_DgDx_sg,j); 01783 return DgDx_sg_[j]; 01784 } 01785 01786 inline 01787 ModelEvaluator::DerivativeProperties 01788 ModelEvaluator::OutArgs::get_DgDx_sg_properties(int j) const 01789 { 01790 assert_supports(OUT_ARG_DgDx_sg,j); 01791 return DgDx_sg_properties_[j]; 01792 } 01793 01794 inline 01795 void ModelEvaluator::OutArgs::set_DgDx_mp( int j, const MPDerivative &DgDx_mp_j ) 01796 { 01797 assert_supports(OUT_ARG_DgDx_mp,j); 01798 DgDx_mp_[j] = DgDx_mp_j; 01799 } 01800 01801 inline 01802 ModelEvaluator::MPDerivative 01803 ModelEvaluator::OutArgs::get_DgDx_mp(int j) const 01804 { 01805 assert_supports(OUT_ARG_DgDx_mp,j); 01806 return DgDx_mp_[j]; 01807 } 01808 01809 inline 01810 ModelEvaluator::DerivativeProperties 01811 ModelEvaluator::OutArgs::get_DgDx_mp_properties(int j) const 01812 { 01813 assert_supports(OUT_ARG_DgDx_mp,j); 01814 return DgDx_mp_properties_[j]; 01815 } 01816 01817 inline 01818 void ModelEvaluator::OutArgs::set_DgDp( int j, int l, const Derivative &DgDp_j_l ) 01819 { 01820 assert_supports(OUT_ARG_DgDp,j,l); 01821 DgDp_[ j*Np() + l ] = DgDp_j_l; 01822 } 01823 01824 inline 01825 ModelEvaluator::Derivative 01826 ModelEvaluator::OutArgs::get_DgDp(int j, int l) const 01827 { 01828 assert_supports(OUT_ARG_DgDp,j,l); 01829 return DgDp_[ j*Np() + l ]; 01830 } 01831 01832 inline 01833 ModelEvaluator::DerivativeProperties 01834 ModelEvaluator::OutArgs::get_DgDp_properties(int j, int l) const 01835 { 01836 assert_supports(OUT_ARG_DgDp,j,l); 01837 return DgDp_properties_[ j*Np() + l ]; 01838 } 01839 01840 inline 01841 void ModelEvaluator::OutArgs::set_DgDp_sg( int j, int l, const SGDerivative &DgDp_sg_j_l ) 01842 { 01843 assert_supports(OUT_ARG_DgDp_sg,j,l); 01844 DgDp_sg_[ j*Np() + l ] = DgDp_sg_j_l; 01845 } 01846 01847 inline 01848 ModelEvaluator::SGDerivative 01849 ModelEvaluator::OutArgs::get_DgDp_sg(int j, int l) const 01850 { 01851 assert_supports(OUT_ARG_DgDp_sg,j,l); 01852 return DgDp_sg_[ j*Np() + l ]; 01853 } 01854 01855 inline 01856 ModelEvaluator::DerivativeProperties 01857 ModelEvaluator::OutArgs::get_DgDp_sg_properties(int j, int l) const 01858 { 01859 assert_supports(OUT_ARG_DgDp_sg,j,l); 01860 return DgDp_sg_properties_[ j*Np() + l ]; 01861 } 01862 01863 inline 01864 void ModelEvaluator::OutArgs::set_DgDp_mp( int j, int l, const MPDerivative &DgDp_mp_j_l ) 01865 { 01866 assert_supports(OUT_ARG_DgDp_mp,j,l); 01867 DgDp_mp_[ j*Np() + l ] = DgDp_mp_j_l; 01868 } 01869 01870 inline 01871 ModelEvaluator::MPDerivative 01872 ModelEvaluator::OutArgs::get_DgDp_mp(int j, int l) const 01873 { 01874 assert_supports(OUT_ARG_DgDp_mp,j,l); 01875 return DgDp_mp_[ j*Np() + l ]; 01876 } 01877 01878 inline 01879 ModelEvaluator::DerivativeProperties 01880 ModelEvaluator::OutArgs::get_DgDp_mp_properties(int j, int l) const 01881 { 01882 assert_supports(OUT_ARG_DgDp_mp,j,l); 01883 return DgDp_mp_properties_[ j*Np() + l ]; 01884 } 01885 01886 inline 01887 void ModelEvaluator::OutArgs::set_f_poly( const Teuchos::RefCountPtr<Teuchos::Polynomial<Epetra_Vector> > &f_poly ) 01888 { f_poly_ = f_poly; } 01889 01890 inline 01891 Teuchos::RefCountPtr<Teuchos::Polynomial<Epetra_Vector> > 01892 ModelEvaluator::OutArgs::get_f_poly() const 01893 { return f_poly_; } 01894 01895 inline 01896 void ModelEvaluator::OutArgs::set_f_sg( const ModelEvaluator::OutArgs::sg_vector_t& f_sg ) 01897 { f_sg_ = f_sg; } 01898 01899 inline 01900 ModelEvaluator::OutArgs::sg_vector_t 01901 ModelEvaluator::OutArgs::get_f_sg() const 01902 { return f_sg_; } 01903 01904 inline 01905 void ModelEvaluator::OutArgs::set_W_sg( const ModelEvaluator::OutArgs::sg_operator_t& W_sg ) { W_sg_ = W_sg; } 01906 01907 inline 01908 ModelEvaluator::OutArgs::sg_operator_t ModelEvaluator::OutArgs::get_W_sg() const { return W_sg_; } 01909 01910 inline 01911 void ModelEvaluator::OutArgs::set_f_mp( const ModelEvaluator::mp_vector_t& f_mp ) 01912 { f_mp_ = f_mp; } 01913 01914 inline 01915 ModelEvaluator::mp_vector_t 01916 ModelEvaluator::OutArgs::get_f_mp() const 01917 { return f_mp_; } 01918 01919 inline 01920 void ModelEvaluator::OutArgs::set_W_mp( const ModelEvaluator::mp_operator_t& W_mp ) { W_mp_ = W_mp; } 01921 01922 inline 01923 ModelEvaluator::mp_operator_t ModelEvaluator::OutArgs::get_W_mp() const { return W_mp_; } 01924 01925 // 01926 // ModelEvaluator::InArgsSetup 01927 // 01928 01929 inline 01930 void ModelEvaluator::InArgsSetup::setModelEvalDescription( const std::string &new_modelEvalDescription ) 01931 { 01932 this->_setModelEvalDescription(new_modelEvalDescription); 01933 } 01934 01935 inline 01936 void ModelEvaluator::InArgsSetup::set_Np(int new_Np) 01937 { this->_set_Np(new_Np); } 01938 01939 inline 01940 void ModelEvaluator::InArgsSetup::setSupports( EInArgsMembers arg, bool new_supports ) 01941 { this->_setSupports(arg,new_supports); } 01942 01943 inline 01944 void ModelEvaluator::InArgsSetup::setSupports( EInArgs_p_sg arg, int l, bool new_supports ) 01945 { this->_setSupports(arg,l,new_supports); } 01946 01947 inline 01948 void ModelEvaluator::InArgsSetup::setSupports( EInArgs_p_mp arg, int l, bool new_supports ) 01949 { this->_setSupports(arg,l,new_supports); } 01950 01951 // 01952 // ModelEvaluator::OutArgsSetup 01953 // 01954 01955 inline 01956 void ModelEvaluator::OutArgsSetup::setModelEvalDescription( const std::string &new_modelEvalDescription ) 01957 { 01958 this->_setModelEvalDescription(new_modelEvalDescription); 01959 } 01960 01961 inline 01962 void ModelEvaluator::OutArgsSetup::set_Np_Ng(int new_Np, int new_Ng) 01963 { this->_set_Np_Ng(new_Np,new_Ng); } 01964 01965 inline 01966 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsMembers arg, bool new_supports ) 01967 { this->_setSupports(arg,new_supports); } 01968 01969 inline 01970 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDfDp arg, int l, const DerivativeSupport& new_supports ) 01971 { this->_setSupports(arg,l,new_supports); } 01972 01973 inline 01974 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx_dot arg, int j, const DerivativeSupport& new_supports ) 01975 { this->_setSupports(arg,j,new_supports); } 01976 01977 inline 01978 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx arg, int j, const DerivativeSupport& new_supports ) 01979 { this->_setSupports(arg,j,new_supports); } 01980 01981 inline 01982 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDp arg, int j, int l, const DerivativeSupport& new_supports ) 01983 { this->_setSupports(arg,j,l,new_supports); } 01984 01985 inline 01986 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgs_g_sg arg, int j, bool new_supports ) 01987 { this->_setSupports(arg,j,new_supports); } 01988 01989 inline 01990 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDfDp_sg arg, int l, const DerivativeSupport& new_supports ) 01991 { this->_setSupports(arg,l,new_supports); } 01992 01993 inline 01994 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx_dot_sg arg, int j, const DerivativeSupport& new_supports ) 01995 { this->_setSupports(arg,j,new_supports); } 01996 01997 inline 01998 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx_sg arg, int j, const DerivativeSupport& new_supports ) 01999 { this->_setSupports(arg,j,new_supports); } 02000 02001 inline 02002 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDp_sg arg, int j, int l, const DerivativeSupport& new_supports ) 02003 { this->_setSupports(arg,j,l,new_supports); } 02004 02005 inline 02006 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgs_g_mp arg, int j, bool new_supports ) 02007 { this->_setSupports(arg,j,new_supports); } 02008 02009 inline 02010 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDfDp_mp arg, int l, const DerivativeSupport& new_supports ) 02011 { this->_setSupports(arg,l,new_supports); } 02012 02013 inline 02014 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx_dot_mp arg, int j, const DerivativeSupport& new_supports ) 02015 { this->_setSupports(arg,j,new_supports); } 02016 02017 inline 02018 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx_mp arg, int j, const DerivativeSupport& new_supports ) 02019 { this->_setSupports(arg,j,new_supports); } 02020 02021 inline 02022 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDp_mp arg, int j, int l, const DerivativeSupport& new_supports ) 02023 { this->_setSupports(arg,j,l,new_supports); } 02024 02025 inline 02026 void ModelEvaluator::OutArgsSetup::set_W_properties( const DerivativeProperties &properties ) 02027 { this->_set_W_properties(properties); } 02028 inline 02029 void ModelEvaluator::OutArgsSetup::set_WPrec_properties( const DerivativeProperties &properties ) 02030 { this->_set_WPrec_properties(properties); } 02031 02032 inline 02033 void ModelEvaluator::OutArgsSetup::set_DfDp_properties( int l, const DerivativeProperties &properties ) 02034 { 02035 this->_set_DfDp_properties(l,properties); 02036 } 02037 02038 inline 02039 void ModelEvaluator::OutArgsSetup::set_DgDx_dot_properties( int j, const DerivativeProperties &properties ) 02040 { 02041 this->_set_DgDx_dot_properties(j,properties); 02042 } 02043 02044 inline 02045 void ModelEvaluator::OutArgsSetup::set_DgDx_properties( int j, const DerivativeProperties &properties ) 02046 { 02047 this->_set_DgDx_properties(j,properties); 02048 } 02049 02050 inline 02051 void ModelEvaluator::OutArgsSetup::set_DgDp_properties( int j, int l, const DerivativeProperties &properties ) 02052 { 02053 this->_set_DgDp_properties(j,l,properties); 02054 } 02055 02056 inline 02057 void ModelEvaluator::OutArgsSetup::set_DfDp_sg_properties( int l, const DerivativeProperties &properties ) 02058 { 02059 this->_set_DfDp_sg_properties(l,properties); 02060 } 02061 02062 inline 02063 void ModelEvaluator::OutArgsSetup::set_DgDx_dot_sg_properties( int j, const DerivativeProperties &properties ) 02064 { 02065 this->_set_DgDx_dot_sg_properties(j,properties); 02066 } 02067 02068 inline 02069 void ModelEvaluator::OutArgsSetup::set_DgDx_sg_properties( int j, const DerivativeProperties &properties ) 02070 { 02071 this->_set_DgDx_sg_properties(j,properties); 02072 } 02073 02074 inline 02075 void ModelEvaluator::OutArgsSetup::set_DgDp_sg_properties( int j, int l, const DerivativeProperties &properties ) 02076 { 02077 this->_set_DgDp_sg_properties(j,l,properties); 02078 } 02079 02080 inline 02081 void ModelEvaluator::OutArgsSetup::set_DfDp_mp_properties( int l, const DerivativeProperties &properties ) 02082 { 02083 this->_set_DfDp_mp_properties(l,properties); 02084 } 02085 02086 inline 02087 void ModelEvaluator::OutArgsSetup::set_DgDx_dot_mp_properties( int j, const DerivativeProperties &properties ) 02088 { 02089 this->_set_DgDx_dot_mp_properties(j,properties); 02090 } 02091 02092 inline 02093 void ModelEvaluator::OutArgsSetup::set_DgDx_mp_properties( int j, const DerivativeProperties &properties ) 02094 { 02095 this->_set_DgDx_mp_properties(j,properties); 02096 } 02097 02098 inline 02099 void ModelEvaluator::OutArgsSetup::set_DgDp_mp_properties( int j, int l, const DerivativeProperties &properties ) 02100 { 02101 this->_set_DgDp_mp_properties(j,l,properties); 02102 } 02103 02104 } // namespace EpetraExt 02105 02106 #endif // EPETRA_EXT_MODEL_EVALUATOR_HPP
1.7.6.1