EpetraExt  Development
EpetraExt_ModelEvaluator.h
Go to the documentation of this file.
1 //@HEADER
2 // ***********************************************************************
3 //
4 // EpetraExt: Epetra Extended - Linear Algebra Services Package
5 // Copyright (2011) Sandia Corporation
6 //
7 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
8 // the U.S. Government retains certain rights in this software.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
38 //
39 // ***********************************************************************
40 //@HEADER
41 
42 #ifndef EPETRA_EXT_MODEL_EVALUATOR_HPP
43 #define EPETRA_EXT_MODEL_EVALUATOR_HPP
44 
45 #include "EpetraExt_ConfigDefs.h"
47 #include "Teuchos_RCP.hpp"
48 #include "Teuchos_Describable.hpp"
49 #include "Teuchos_Polynomial.hpp"
50 #include "Teuchos_Array.hpp"
51 
52 #ifdef HAVE_PYTRILINOS
53 #ifndef PyObject_HEAD
54 struct _object;
55 typedef _object PyObject;
56 #endif
57 #endif
58 
59 class Epetra_Map;
60 class Epetra_Vector;
61 class Epetra_Operator;
62 
63 // Forward declaration of Stochastic Galerkin (SG) argument types
64 namespace Stokhos {
65  class EpetraVectorOrthogPoly;
66  class EpetraMultiVectorOrthogPoly;
67  class EpetraOperatorOrthogPoly;
68  template <typename ordinal_type, typename scalar_type> class OrthogPolyBasis;
69  template <typename ordinal_type, typename scalar_type> class Quadrature;
70  template <typename ordinal_type, typename scalar_type> class StandardStorage;
71  template <typename ordinal_type, typename scalar_type, typename node_type> class OrthogPolyExpansion;
72 
73  class ProductEpetraVector;
74  class ProductEpetraMultiVector;
75  class ProductEpetraOperator;
76 }
77 
78 namespace EpetraExt {
79 
84 class ModelEvaluator : virtual public Teuchos::Describable {
85 public:
86 
89 
90  typedef Teuchos::RCP<const Stokhos::ProductEpetraVector> mp_const_vector_t;
91  typedef Teuchos::RCP<const Stokhos::ProductEpetraMultiVector> mp_const_multivector_t;
92  typedef Teuchos::RCP<const Stokhos::ProductEpetraOperator > mp_const_operator_t;
93  typedef Teuchos::RCP<Stokhos::ProductEpetraVector> mp_vector_t;
94  typedef Teuchos::RCP<Stokhos::ProductEpetraMultiVector> mp_multivector_t;
95  typedef Teuchos::RCP<Stokhos::ProductEpetraOperator > mp_operator_t;
96 
99  IN_ARG_x_dot
100  ,IN_ARG_x
101  ,IN_ARG_x_dot_poly
102  ,IN_ARG_x_poly
103  ,IN_ARG_x_dot_sg
104  ,IN_ARG_x_sg
105  ,IN_ARG_x_dot_mp
106  ,IN_ARG_x_mp
107  ,IN_ARG_t
108  ,IN_ARG_alpha
109  ,IN_ARG_beta
110  ,IN_ARG_x_dotdot
111  ,IN_ARG_x_dotdot_poly
112  ,IN_ARG_x_dotdot_sg
113  ,IN_ARG_x_dotdot_mp
114  ,IN_ARG_omega // < Coeff of second derivative term d(x_dotdot)/dx
115  ,IN_ARG_sg_basis
116  ,IN_ARG_sg_quadrature
117  ,IN_ARG_sg_expansion
118  };
119  static const int NUM_E_IN_ARGS_MEMBERS=19;
120 
123  IN_ARG_p_sg
124  };
125 
128  IN_ARG_p_mp
129  };
130 
132  class InArgs {
133  public:
134 
136  typedef Teuchos::RCP<const Stokhos::EpetraVectorOrthogPoly> sg_const_vector_t;
137 
139  InArgs();
141  std::string modelEvalDescription() const;
143  int Np() const;
145  void set_x_dot( const Teuchos::RCP<const Epetra_Vector> &x_dot );
147  void set_x_dotdot( const Teuchos::RCP<const Epetra_Vector> &x_dotdot );
149  Teuchos::RCP<const Epetra_Vector> get_x_dot() const;
151  Teuchos::RCP<const Epetra_Vector> get_x_dotdot() const;
153  void set_x( const Teuchos::RCP<const Epetra_Vector> &x );
155  Teuchos::RCP<const Epetra_Vector> get_x() const;
156  void set_x_poly(
157  const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_poly
158  );
160  Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > get_x_poly() const;
162  void set_x_dot_poly(
163  const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_dot_poly
164  );
165  void set_x_dotdot_poly(
166  const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_dotdot_poly
167  );
169  Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > get_x_dot_poly() const;
170  Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > get_x_dotdot_poly() const;
172  void set_x_sg(const sg_const_vector_t &x_sg);
174  sg_const_vector_t get_x_sg() const;
176  void set_x_dot_sg(const sg_const_vector_t &x_dot_sg);
177  void set_x_dotdot_sg(const sg_const_vector_t &x_dotdot_sg);
179  sg_const_vector_t get_x_dot_sg() const;
180  sg_const_vector_t get_x_dotdot_sg() const;
182  void set_x_mp(const mp_const_vector_t &x_mp);
184  mp_const_vector_t get_x_mp() const;
186  void set_x_dot_mp(const mp_const_vector_t &x_dot_mp);
187  void set_x_dotdot_mp(const mp_const_vector_t &x_dotdot_mp);
189  mp_const_vector_t get_x_dot_mp() const;
190  mp_const_vector_t get_x_dotdot_mp() const;
192  void set_p( int l, const Teuchos::RCP<const Epetra_Vector> &p_l );
194  Teuchos::RCP<const Epetra_Vector> get_p(int l) const;
196  void set_p_sg( int l, const sg_const_vector_t &p_sg_l );
198  sg_const_vector_t get_p_sg(int l) const;
200  void set_p_mp( int l, const mp_const_vector_t &p_mp_l );
202  mp_const_vector_t get_p_mp(int l) const;
204  void set_t( double t );
206  double get_alpha() const;
208  void set_alpha( double alpha );
211  double get_omega() const;
213  void set_omega( double omega );
214  double get_beta() const;
216  void set_beta( double beta );
218  double get_t() const;
220  Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> > get_sg_basis() const;
222  void set_sg_basis( const Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> >& basis );
224  Teuchos::RCP<const Stokhos::Quadrature<int,double> > get_sg_quadrature() const;
226  void set_sg_quadrature( const Teuchos::RCP<const Stokhos::Quadrature<int,double> >& quad );
228  Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > > get_sg_expansion() const;
230  void set_sg_expansion( const Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > >& exp );
232  bool supports(EInArgsMembers arg) const;
234  bool supports(EInArgs_p_sg arg, int l) const;
236  bool supports(EInArgs_p_mp arg, int l) const;
237  protected:
239  void _setModelEvalDescription( const std::string &modelEvalDescription );
241  void _set_Np(int Np);
243  void _setSupports( EInArgsMembers arg, bool supports );
245  void _setSupports( EInArgs_p_sg arg, int l, bool supports );
247  void _setSupports( EInArgs_p_mp arg, int l, bool supports );
248  private:
249  // types
250  typedef Teuchos::Array<Teuchos::RCP<const Epetra_Vector> > p_t;
251  typedef Teuchos::Array<sg_const_vector_t > p_sg_t;
252  typedef Teuchos::Array<mp_const_vector_t > p_mp_t;
253  typedef Teuchos::Array<bool> supports_p_sg_t;
254  // data
255  std::string modelEvalDescription_;
256  Teuchos::RCP<const Epetra_Vector> x_dot_;
257  Teuchos::RCP<const Epetra_Vector> x_dotdot_;
258  Teuchos::RCP<const Epetra_Vector> x_;
259  Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > x_dot_poly_;
260  Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > x_dotdot_poly_;
261  Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > x_poly_;
262  sg_const_vector_t x_dot_sg_;
263  sg_const_vector_t x_dotdot_sg_;
264  sg_const_vector_t x_sg_;
265  mp_const_vector_t x_dot_mp_;
266  mp_const_vector_t x_dotdot_mp_;
267  mp_const_vector_t x_mp_;
268  p_t p_;
269  p_sg_t p_sg_;
270  p_mp_t p_mp_;
271  double t_;
272  double alpha_;
273  double omega_;
274  double beta_;
275  Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> > sg_basis_;
276  Teuchos::RCP<const Stokhos::Quadrature<int,double> > sg_quad_;
277  Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > > sg_exp_;
278  bool supports_[NUM_E_IN_ARGS_MEMBERS];
279  supports_p_sg_t supports_p_sg_; // Np
280  supports_p_sg_t supports_p_mp_; // Np
281  // functions
282  void assert_supports(EInArgsMembers arg) const;
283  void assert_supports(EInArgs_p_sg arg, int l) const;
284  void assert_supports(EInArgs_p_mp arg, int l) const;
285  void assert_l(int l) const;
286  };
287 
289  enum EEvalType {
290  EVAL_TYPE_EXACT
291  ,EVAL_TYPE_APPROX_DERIV
292  ,EVAL_TYPE_VERY_APPROX_DERIV
293  };
294 
296  template<class ObjType>
297  class Evaluation : public Teuchos::RCP<ObjType> {
298  public:
300  Evaluation() : evalType_(EVAL_TYPE_EXACT) {}
302  Evaluation( const Teuchos::RCP<ObjType> &obj )
303  : Teuchos::RCP<ObjType>(obj), evalType_(EVAL_TYPE_EXACT) {}
305  Evaluation( const Teuchos::RCP<ObjType> &obj, EEvalType evalType )
306  : Teuchos::RCP<ObjType>(obj), evalType_(evalType) {}
308  EEvalType getType() const { return evalType_; }
310  void reset( const Teuchos::RCP<ObjType> &obj, EEvalType evalType )
311  { this->operator=(obj); evalType_ = evalType; }
312  private:
313  EEvalType evalType_;
314  };
315 
318  DERIV_MV_BY_COL
319  ,DERIV_TRANS_MV_BY_ROW
320  };
321 
323  enum EDerivativeLinearOp { DERIV_LINEAR_OP };
324 
327  public:
330  :supportsLinearOp_(false), supportsMVByCol_(false), supportsTransMVByRow_(false)
331  {}
334  :supportsLinearOp_(true), supportsMVByCol_(false), supportsTransMVByRow_(false)
335  {}
338  :supportsLinearOp_(false), supportsMVByCol_(mvOrientation==DERIV_MV_BY_COL)
339  ,supportsTransMVByRow_(mvOrientation==DERIV_TRANS_MV_BY_ROW)
340  {}
344  :supportsLinearOp_(true), supportsMVByCol_(mvOrientation==DERIV_MV_BY_COL)
345  ,supportsTransMVByRow_(mvOrientation==DERIV_TRANS_MV_BY_ROW)
346  {}
349  EDerivativeMultiVectorOrientation mvOrientation1,
350  EDerivativeMultiVectorOrientation mvOrientation2
351  )
352  :supportsLinearOp_(false)
353  ,supportsMVByCol_(
354  mvOrientation1==DERIV_MV_BY_COL||mvOrientation2==DERIV_MV_BY_COL )
355  ,supportsTransMVByRow_(
356  mvOrientation1==DERIV_TRANS_MV_BY_ROW||mvOrientation2==DERIV_TRANS_MV_BY_ROW )
357  {}
360  { supportsLinearOp_ = true; return *this; }
363  {
364  switch(mvOrientation) {
365  case DERIV_MV_BY_COL: supportsMVByCol_ = true; break;
366  case DERIV_TRANS_MV_BY_ROW: supportsTransMVByRow_ = true; break;
367  default: TEUCHOS_TEST_FOR_EXCEPT(true);
368  }
369  return *this;
370  }
372  bool none() const
373  { return ( !supportsLinearOp_ && !supportsMVByCol_ && !supportsTransMVByRow_ ); }
376  { return supportsLinearOp_; }
378  bool supports(EDerivativeMultiVectorOrientation mvOrientation) const
379  {
380  switch(mvOrientation) {
381  case DERIV_MV_BY_COL: return supportsMVByCol_;
382  case DERIV_TRANS_MV_BY_ROW: return supportsTransMVByRow_;
383  default: TEUCHOS_TEST_FOR_EXCEPT(true);
384  }
385  return false; // Will never be called!
386  }
387  private:
388  bool supportsLinearOp_;
389  bool supportsMVByCol_;
390  bool supportsTransMVByRow_;
391  public:
392  };
393 
396  DERIV_LINEARITY_UNKNOWN
397  ,DERIV_LINEARITY_CONST
398  ,DERIV_LINEARITY_NONCONST
399  };
401  enum ERankStatus {
402  DERIV_RANK_UNKNOWN
403  ,DERIV_RANK_FULL
404  ,DERIV_RANK_DEFICIENT
405  };
406 
417  :linearity(DERIV_LINEARITY_UNKNOWN),rank(DERIV_RANK_UNKNOWN),supportsAdjoint(false) {}
420  EDerivativeLinearity in_linearity, ERankStatus in_rank, bool in_supportsAdjoint
421  ):linearity(in_linearity),rank(in_rank),supportsAdjoint(in_supportsAdjoint) {}
422  };
423 
428  public:
433  const Teuchos::RCP<Epetra_MultiVector> &mv
434  ,const EDerivativeMultiVectorOrientation orientation = DERIV_MV_BY_COL
435  ,const Teuchos::Array<int> &paramIndexes = Teuchos::Array<int>()
436  ) : mv_(mv), orientation_(orientation), paramIndexes_(paramIndexes) {}
439  { orientation_ = orientation; };
441  Teuchos::RCP<Epetra_MultiVector> getMultiVector() const
442  { return mv_; }
445  { return orientation_; }
447  const Teuchos::Array<int>& getParamIndexes() const
448  { return paramIndexes_; }
449  private:
450  Teuchos::RCP<Epetra_MultiVector> mv_;
452  Teuchos::Array<int> paramIndexes_;
453  };
454 
458  class Derivative {
459  public:
463  Derivative( const Teuchos::RCP<Epetra_Operator> &lo )
464  : lo_(lo) {}
467  const Teuchos::RCP<Epetra_MultiVector> &mv
468  ,const EDerivativeMultiVectorOrientation orientation = DERIV_MV_BY_COL
469  ) : dmv_(mv,orientation) {}
472  : dmv_(dmv) {}
474  Teuchos::RCP<Epetra_Operator> getLinearOp() const
475  { return lo_; }
477  Teuchos::RCP<Epetra_MultiVector> getMultiVector() const
478  { return dmv_.getMultiVector(); }
481  { return dmv_.getOrientation(); }
484  { return dmv_; }
486  bool isEmpty() const
487  { return !lo_.get() && !dmv_.getMultiVector().get(); }
488  private:
489  Teuchos::RCP<Epetra_Operator> lo_;
491  };
492 
496  struct Preconditioner {
498  Preconditioner() : PrecOp(Teuchos::null), isAlreadyInverted(false) {}
500  Preconditioner(const Teuchos::RCP<Epetra_Operator>& PrecOp_,
501  bool isAlreadyInverted_ )
502  : PrecOp(PrecOp_), isAlreadyInverted(isAlreadyInverted_) {}
504  Teuchos::RCP<Epetra_Operator> PrecOp;
510  };
511 
516  public:
521  const Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > &mv
522  ,const EDerivativeMultiVectorOrientation orientation = DERIV_MV_BY_COL
523  ,const Teuchos::Array<int> &paramIndexes = Teuchos::Array<int>()
524  ) : mv_(mv), orientation_(orientation), paramIndexes_(paramIndexes) {}
527  { orientation_ = orientation; };
529  Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const
530  { return mv_; }
533  { return orientation_; }
535  const Teuchos::Array<int>& getParamIndexes() const
536  { return paramIndexes_; }
537  private:
538  Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > mv_;
540  Teuchos::Array<int> paramIndexes_;
541  };
542 
546  class SGDerivative {
547  public:
551  SGDerivative( const Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > &lo )
552  : lo_(lo) {}
555  const Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > &mv
556  ,const EDerivativeMultiVectorOrientation orientation = DERIV_MV_BY_COL
557  ) : dmv_(mv,orientation) {}
560  : dmv_(dmv) {}
562  Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > getLinearOp() const
563  { return lo_; }
565  Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const
566  { return dmv_.getMultiVector(); }
569  { return dmv_.getOrientation(); }
572  { return dmv_; }
574  bool isEmpty() const
575  { return !lo_.get() && !dmv_.getMultiVector().get(); }
576  private:
577  Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > lo_;
579  };
580 
585  public:
586 
591  const mp_multivector_t &mv
592  ,const EDerivativeMultiVectorOrientation orientation = DERIV_MV_BY_COL
593  ,const Teuchos::Array<int> &paramIndexes = Teuchos::Array<int>()
594  ) : mv_(mv), orientation_(orientation), paramIndexes_(paramIndexes) {}
597  { orientation_ = orientation; };
599  mp_multivector_t getMultiVector() const
600  { return mv_; }
603  { return orientation_; }
605  const Teuchos::Array<int>& getParamIndexes() const
606  { return paramIndexes_; }
607  private:
608  mp_multivector_t mv_;
610  Teuchos::Array<int> paramIndexes_;
611  };
612 
616  class MPDerivative {
617  public:
618 
622  MPDerivative( const mp_operator_t &lo )
623  : lo_(lo) {}
626  const mp_multivector_t &mv
627  ,const EDerivativeMultiVectorOrientation orientation = DERIV_MV_BY_COL
628  ) : dmv_(mv,orientation) {}
631  : dmv_(dmv) {}
633  mp_operator_t getLinearOp() const
634  { return lo_; }
636  mp_multivector_t getMultiVector() const
637  { return dmv_.getMultiVector(); }
640  { return dmv_.getOrientation(); }
643  { return dmv_; }
645  bool isEmpty() const
646  { return !lo_.get() && !dmv_.getMultiVector().get(); }
647  private:
648  mp_operator_t lo_;
650  };
651 
654  OUT_ARG_f
655  ,OUT_ARG_W
656  ,OUT_ARG_f_poly
657  ,OUT_ARG_f_sg
658  ,OUT_ARG_W_sg
659  ,OUT_ARG_f_mp
660  ,OUT_ARG_W_mp
661  ,OUT_ARG_WPrec
662  };
663  static const int NUM_E_OUT_ARGS_MEMBERS=9;
664 
667  OUT_ARG_DfDp
668  };
669 
672  OUT_ARG_DgDx_dot
673  };
674 
677  OUT_ARG_DgDx_dotdot
678  };
679 
682  OUT_ARG_DgDx
683  };
684 
687  OUT_ARG_DgDp
688  };
689 
692  OUT_ARG_DfDp_sg
693  };
694 
697  OUT_ARG_g_sg
698  };
699 
702  OUT_ARG_DgDx_dot_sg
703  };
704 
707  OUT_ARG_DgDx_dotdot_sg
708  };
709 
712  OUT_ARG_DgDx_sg
713  };
714 
717  OUT_ARG_DgDp_sg
718  };
719 
722  OUT_ARG_DfDp_mp
723  };
724 
727  OUT_ARG_g_mp
728  };
729 
732  OUT_ARG_DgDx_dot_mp
733  };
734 
737  OUT_ARG_DgDx_dotdot_mp
738  };
739 
742  OUT_ARG_DgDx_mp
743  };
744 
747  OUT_ARG_DgDp_mp
748  };
749 
751  class OutArgs {
752  public:
753 
755  typedef Teuchos::RCP<Stokhos::EpetraVectorOrthogPoly> sg_vector_t;
756 
758  typedef Teuchos::RCP<Stokhos::EpetraOperatorOrthogPoly > sg_operator_t;
759 
761  OutArgs();
763  std::string modelEvalDescription() const;
765  int Np() const;
767  int Ng() const;
769  bool supports(EOutArgsMembers arg) const;
771  const DerivativeSupport& supports(EOutArgsDfDp arg, int l) const;
773  const DerivativeSupport& supports(EOutArgsDgDx_dot arg, int j) const;
774  const DerivativeSupport& supports(EOutArgsDgDx_dotdot arg, int j) const;
776  const DerivativeSupport& supports(EOutArgsDgDx arg, int j) const;
778  const DerivativeSupport& supports(EOutArgsDgDp arg, int j, int l) const;
780  bool supports(EOutArgs_g_sg arg, int j) const;
782  const DerivativeSupport& supports(EOutArgsDfDp_sg arg, int l) const;
784  const DerivativeSupport& supports(EOutArgsDgDx_dot_sg arg, int j) const;
785  const DerivativeSupport& supports(EOutArgsDgDx_dotdot_sg arg, int j) const;
787  const DerivativeSupport& supports(EOutArgsDgDx_sg arg, int j) const;
789  const DerivativeSupport& supports(EOutArgsDgDp_sg arg, int j, int l) const;
791  const DerivativeSupport& supports(EOutArgsDfDp_mp arg, int l) const;
793  bool supports(EOutArgs_g_mp arg, int j) const;
795  const DerivativeSupport& supports(EOutArgsDgDx_dot_mp arg, int j) const;
796  const DerivativeSupport& supports(EOutArgsDgDx_dotdot_mp arg, int j) const;
798  const DerivativeSupport& supports(EOutArgsDgDx_mp arg, int j) const;
800  const DerivativeSupport& supports(EOutArgsDgDp_mp arg, int j, int l) const;
802  void set_f( const Evaluation<Epetra_Vector> &f );
804  Evaluation<Epetra_Vector> get_f() const;
806  void set_f_sg( const sg_vector_t& f_sg );
808  sg_vector_t get_f_sg() const;
810  void set_f_mp( const mp_vector_t& f_mp );
812  mp_vector_t get_f_mp() const;
814  void set_g( int j, const Evaluation<Epetra_Vector> &g_j );
816  Evaluation<Epetra_Vector> get_g(int j) const;
819  void set_g_sg( int j, const sg_vector_t &g_sg_j );
822  sg_vector_t get_g_sg(int j) const;
825  void set_g_mp( int j, const mp_vector_t &g_mp_j );
828  mp_vector_t get_g_mp(int j) const;
830  void set_W( const Teuchos::RCP<Epetra_Operator> &W );
831  void set_WPrec( const Teuchos::RCP<Epetra_Operator> &WPrec );
833  Teuchos::RCP<Epetra_Operator> get_W() const;
834  Teuchos::RCP<Epetra_Operator> get_WPrec() const;
836  DerivativeProperties get_W_properties() const;
837  DerivativeProperties get_WPrec_properties() const;
839  void set_W_sg( const sg_operator_t& W_sg );
841  sg_operator_t get_W_sg() const;
843  void set_W_mp( const mp_operator_t& W_sg );
845  mp_operator_t get_W_mp() const;
847  void set_DfDp(int l, const Derivative &DfDp_l);
849  Derivative get_DfDp(int l) const;
851  DerivativeProperties get_DfDp_properties(int l) const;
853  void set_DfDp_sg(int l, const SGDerivative &DfDp_sg_l);
855  SGDerivative get_DfDp_sg(int l) const;
857  DerivativeProperties get_DfDp_sg_properties(int l) const;
859  void set_DfDp_mp(int l, const MPDerivative &DfDp_mp_l);
861  MPDerivative get_DfDp_mp(int l) const;
863  DerivativeProperties get_DfDp_mp_properties(int l) const;
865  void set_DgDx_dot(int j, const Derivative &DgDx_dot_j);
866  void set_DgDx_dotdot(int j, const Derivative &DgDx_dotdot_j);
868  Derivative get_DgDx_dot(int j) const;
869  Derivative get_DgDx_dotdot(int j) const;
871  DerivativeProperties get_DgDx_dot_properties(int j) const;
872  DerivativeProperties get_DgDx_dotdot_properties(int j) const;
874  void set_DgDx_dot_sg(int j, const SGDerivative &DgDx_dot_j);
875  void set_DgDx_dotdot_sg(int j, const SGDerivative &DgDx_dotdot_j);
877  SGDerivative get_DgDx_dot_sg(int j) const;
878  SGDerivative get_DgDx_dotdot_sg(int j) const;
880  DerivativeProperties get_DgDx_dot_sg_properties(int j) const;
881  DerivativeProperties get_DgDx_dotdot_sg_properties(int j) const;
883  void set_DgDx_dot_mp(int j, const MPDerivative &DgDx_dot_j);
884  void set_DgDx_dotdot_mp(int j, const MPDerivative &DgDx_dotdot_j);
886  MPDerivative get_DgDx_dot_mp(int j) const;
887  MPDerivative get_DgDx_dotdot_mp(int j) const;
889  DerivativeProperties get_DgDx_dot_mp_properties(int j) const;
890  DerivativeProperties get_DgDx_dotdot_mp_properties(int j) const;
892  void set_DgDx(int j, const Derivative &DgDx_j);
894  Derivative get_DgDx(int j) const;
896  DerivativeProperties get_DgDx_properties(int j) const;
898  void set_DgDx_sg(int j, const SGDerivative &DgDx_j);
900  SGDerivative get_DgDx_sg(int j) const;
902  DerivativeProperties get_DgDx_sg_properties(int j) const;
904  void set_DgDx_mp(int j, const MPDerivative &DgDx_j);
906  MPDerivative get_DgDx_mp(int j) const;
908  DerivativeProperties get_DgDx_mp_properties(int j) const;
910  void set_DgDp( int j, int l, const Derivative &DgDp_j_l );
912  Derivative get_DgDp(int j, int l) const;
914  DerivativeProperties get_DgDp_properties(int j, int l) const;
916  void set_DgDp_sg( int j, int l, const SGDerivative &DgDp_sg_j_l );
918  SGDerivative get_DgDp_sg(int j, int l) const;
920  DerivativeProperties get_DgDp_sg_properties(int j, int l) const;
922  void set_DgDp_mp( int j, int l, const MPDerivative &DgDp_mp_j_l );
924  MPDerivative get_DgDp_mp(int j, int l) const;
926  DerivativeProperties get_DgDp_mp_properties(int j, int l) const;
927 
929  void set_f_poly( const Teuchos::RCP<Teuchos::Polynomial<Epetra_Vector> > &f_poly );
931  Teuchos::RCP<Teuchos::Polynomial<Epetra_Vector> > get_f_poly() const;
932 
933 
935  bool funcOrDerivesAreSet(EOutArgsMembers arg) const;
936 
942  void setFailed() const;
948  bool isFailed() const;
949 
950  protected:
952  void _setModelEvalDescription( const std::string &modelEvalDescription );
954  void _set_Np_Ng(int Np, int Ng);
956  void _setSupports( EOutArgsMembers arg, bool supports );
958  void _setSupports( EOutArgsDfDp arg, int l, const DerivativeSupport& );
960  void _setSupports( EOutArgsDgDx_dot arg, int j, const DerivativeSupport& );
961  void _setSupports( EOutArgsDgDx_dotdot arg, int j, const DerivativeSupport& );
963  void _setSupports( EOutArgsDgDx arg, int j, const DerivativeSupport& );
965  void _setSupports( EOutArgsDgDp arg, int j, int l, const DerivativeSupport& );
967  void _setSupports( EOutArgs_g_sg arg, int j, bool supports );
969  void _setSupports( EOutArgsDfDp_sg arg, int l, const DerivativeSupport& );
971  void _setSupports( EOutArgsDgDx_dot_sg arg, int j, const DerivativeSupport& );
972  void _setSupports( EOutArgsDgDx_dotdot_sg arg, int j, const DerivativeSupport& );
974  void _setSupports( EOutArgsDgDx_sg arg, int j, const DerivativeSupport& );
976  void _setSupports( EOutArgsDgDp_sg arg, int j, int l, const DerivativeSupport& );
977 
979  void _setSupports( EOutArgs_g_mp arg, int j, bool supports );
981  void _setSupports( EOutArgsDfDp_mp arg, int l, const DerivativeSupport& );
983  void _setSupports( EOutArgsDgDx_dot_mp arg, int j, const DerivativeSupport& );
984  void _setSupports( EOutArgsDgDx_dotdot_mp arg, int j, const DerivativeSupport& );
986  void _setSupports( EOutArgsDgDx_mp arg, int j, const DerivativeSupport& );
988  void _setSupports( EOutArgsDgDp_mp arg, int j, int l, const DerivativeSupport& );
990  void _set_W_properties( const DerivativeProperties &W_properties );
991  void _set_WPrec_properties( const DerivativeProperties &WPrec_properties );
993  void _set_DfDp_properties( int l, const DerivativeProperties &properties );
995  void _set_DgDx_dot_properties( int j, const DerivativeProperties &properties );
996  void _set_DgDx_dotdot_properties( int j, const DerivativeProperties &properties );
998  void _set_DgDx_properties( int j, const DerivativeProperties &properties );
1000  void _set_DgDp_properties( int j, int l, const DerivativeProperties &properties );
1002  void _set_DfDp_sg_properties( int l, const DerivativeProperties &properties );
1004  void _set_DgDx_dot_sg_properties( int j, const DerivativeProperties &properties );
1005  void _set_DgDx_dotdot_sg_properties( int j, const DerivativeProperties &properties );
1007  void _set_DgDx_sg_properties( int j, const DerivativeProperties &properties );
1009  void _set_DgDp_sg_properties( int j, int l, const DerivativeProperties &properties );
1010 
1012  void _set_DfDp_mp_properties( int l, const DerivativeProperties &properties );
1014  void _set_DgDx_dot_mp_properties( int j, const DerivativeProperties &properties );
1015  void _set_DgDx_dotdot_mp_properties( int j, const DerivativeProperties &properties );
1017  void _set_DgDx_mp_properties( int j, const DerivativeProperties &properties );
1019  void _set_DgDp_mp_properties( int j, int l, const DerivativeProperties &properties );
1020  private:
1021  // types
1022  typedef Teuchos::Array<Evaluation<Epetra_Vector> > g_t;
1023  typedef Teuchos::Array<sg_vector_t > g_sg_t;
1024  typedef Teuchos::Array<mp_vector_t > g_mp_t;
1025  typedef Teuchos::Array<Derivative> deriv_t;
1026  typedef Teuchos::Array<SGDerivative> sg_deriv_t;
1027  typedef Teuchos::Array<MPDerivative> mp_deriv_t;
1028  typedef Teuchos::Array<DerivativeProperties> deriv_properties_t;
1029  typedef Teuchos::Array<DerivativeSupport> supports_t;
1030  typedef Teuchos::Array<bool> supports_g_sg_t;
1031  // data
1032  std::string modelEvalDescription_;
1033  mutable bool isFailed_;
1034  bool supports_[NUM_E_OUT_ARGS_MEMBERS];
1035  supports_t supports_DfDp_; // Np
1036  supports_t supports_DgDx_dot_; // Ng
1037  supports_t supports_DgDx_dotdot_; // Ng
1038  supports_t supports_DgDx_; // Ng
1039  supports_t supports_DgDp_; // Ng x Np
1040  supports_g_sg_t supports_g_sg_; // Ng
1041  supports_t supports_DfDp_sg_; // Np
1042  supports_t supports_DgDx_dot_sg_; // Ng
1043  supports_t supports_DgDx_dotdot_sg_; // Ng
1044  supports_t supports_DgDx_sg_; // Ng
1045  supports_t supports_DgDp_sg_; // Ng x Np
1046  supports_g_sg_t supports_g_mp_; // Ng
1047  supports_t supports_DfDp_mp_; // Np_mp
1048  supports_t supports_DgDx_dot_mp_; // Ng_mp
1049  supports_t supports_DgDx_dotdot_mp_; // Ng_mp
1050  supports_t supports_DgDx_mp_; // Ng_mp
1051  supports_t supports_DgDp_mp_; // Ng_mp x Np_mp
1053  g_t g_;
1054  g_sg_t g_sg_;
1055  g_mp_t g_mp_;
1056  Teuchos::RCP<Epetra_Operator> W_;
1057  Teuchos::RCP<Epetra_Operator> WPrec_;
1058  DerivativeProperties W_properties_;
1059  DerivativeProperties WPrec_properties_;
1060  deriv_t DfDp_; // Np
1061  deriv_properties_t DfDp_properties_; // Np
1062  deriv_t DgDx_dot_; // Ng
1063  deriv_t DgDx_dotdot_; // Ng
1064  deriv_t DgDx_; // Ng
1065  deriv_properties_t DgDx_dot_properties_; // Ng
1066  deriv_properties_t DgDx_dotdot_properties_; // Ng
1067  deriv_properties_t DgDx_properties_; // Ng
1068  deriv_t DgDp_; // Ng x Np
1069  deriv_properties_t DgDp_properties_; // Ng x Np
1070  Teuchos::RCP<Teuchos::Polynomial<Epetra_Vector> > f_poly_;
1071  sg_vector_t f_sg_;
1072  sg_operator_t W_sg_;
1073  sg_deriv_t DfDp_sg_; // Np
1074  deriv_properties_t DfDp_sg_properties_; // Np
1075  sg_deriv_t DgDx_dot_sg_; // Ng
1076  sg_deriv_t DgDx_dotdot_sg_; // Ng
1077  sg_deriv_t DgDx_sg_; // Ng
1078  deriv_properties_t DgDx_dot_sg_properties_; // Ng
1079  deriv_properties_t DgDx_dotdot_sg_properties_; // Ng
1080  deriv_properties_t DgDx_sg_properties_; // Ng
1081  sg_deriv_t DgDp_sg_; // Ng x Np
1082  deriv_properties_t DgDp_sg_properties_; // Ng x Np
1083  mp_vector_t f_mp_;
1084  mp_operator_t W_mp_;
1085  mp_deriv_t DfDp_mp_; // Np
1086  deriv_properties_t DfDp_mp_properties_; // Np
1087  mp_deriv_t DgDx_dot_mp_; // Ng
1088  mp_deriv_t DgDx_dotdot_mp_; // Ng
1089  mp_deriv_t DgDx_mp_; // Ng
1090  deriv_properties_t DgDx_dot_mp_properties_; // Ng
1091  deriv_properties_t DgDx_dotdot_mp_properties_; // Ng
1092  deriv_properties_t DgDx_mp_properties_; // Ng
1093  mp_deriv_t DgDp_mp_; // Ng x Np
1094  deriv_properties_t DgDp_mp_properties_; // Ng x Np
1095  // functions
1096  void assert_supports(EOutArgsMembers arg) const;
1097  void assert_supports(EOutArgsDfDp arg, int l) const;
1098  void assert_supports(EOutArgsDgDx_dot arg, int j) const;
1099  void assert_supports(EOutArgsDgDx_dotdot arg, int j) const;
1100  void assert_supports(EOutArgsDgDx arg, int j) const;
1101  void assert_supports(EOutArgsDgDp arg, int j, int l) const;
1102  void assert_supports(EOutArgs_g_sg arg, int j) const;
1103  void assert_supports(EOutArgsDfDp_sg arg, int l) const;
1104  void assert_supports(EOutArgsDgDx_dot_sg arg, int j) const;
1105  void assert_supports(EOutArgsDgDx_dotdot_sg arg, int j) const;
1106  void assert_supports(EOutArgsDgDx_sg arg, int j) const;
1107  void assert_supports(EOutArgsDgDp_sg arg, int j, int l) const;
1108  void assert_supports(EOutArgs_g_mp arg, int j) const;
1109  void assert_supports(EOutArgsDfDp_mp arg, int l) const;
1110  void assert_supports(EOutArgsDgDx_dot_mp arg, int j) const;
1111  void assert_supports(EOutArgsDgDx_dotdot_mp arg, int j) const;
1112  void assert_supports(EOutArgsDgDx_mp arg, int j) const;
1113  void assert_supports(EOutArgsDgDp_mp arg, int j, int l) const;
1114  void assert_l(int l) const;
1115  void assert_j(int j) const;
1116  };
1117 
1119 
1122 
1124  virtual ~ModelEvaluator();
1125 
1127 
1130 
1132  virtual Teuchos::RCP<const Epetra_Map> get_x_map() const = 0;
1133 
1135  virtual Teuchos::RCP<const Epetra_Map> get_f_map() const = 0;
1136 
1138  virtual Teuchos::RCP<const Epetra_Map> get_p_map(int l) const;
1139 
1154  virtual Teuchos::RCP<const Teuchos::Array<std::string> > get_p_names(int l) const;
1155 
1157  virtual Teuchos::RCP<const Epetra_Map> get_g_map(int j) const;
1158 
1173  virtual Teuchos::ArrayView<const std::string> get_g_names(int j) const;
1174 
1176 
1179 
1181  virtual Teuchos::RCP<const Epetra_Vector> get_x_init() const;
1182 
1184  virtual Teuchos::RCP<const Epetra_Vector> get_x_dot_init() const;
1185 
1187  virtual Teuchos::RCP<const Epetra_Vector> get_x_dotdot_init() const;
1188 
1190  virtual Teuchos::RCP<const Epetra_Vector> get_p_init(int l) const;
1191 
1193  virtual double get_t_init() const;
1194 
1196 
1199 
1204  virtual double getInfBound() const;
1205 
1207  virtual Teuchos::RCP<const Epetra_Vector> get_x_lower_bounds() const;
1208 
1210  virtual Teuchos::RCP<const Epetra_Vector> get_x_upper_bounds() const;
1211 
1213  virtual Teuchos::RCP<const Epetra_Vector> get_p_lower_bounds(int l) const;
1214 
1216  virtual Teuchos::RCP<const Epetra_Vector> get_p_upper_bounds(int l) const;
1217 
1219  virtual double get_t_lower_bound() const;
1220 
1222  virtual double get_t_upper_bound() const;
1223 
1225 
1228 
1235  virtual Teuchos::RCP<Epetra_Operator> create_W() const;
1236  virtual Teuchos::RCP<EpetraExt::ModelEvaluator::Preconditioner> create_WPrec() const;
1237 
1239  virtual Teuchos::RCP<Epetra_Operator> create_DfDp_op(int l) const;
1240 
1242  virtual Teuchos::RCP<Epetra_Operator> create_DgDx_dot_op(int j) const;
1243 
1245  virtual Teuchos::RCP<Epetra_Operator> create_DgDx_dotdot_op(int j) const;
1246 
1248  virtual Teuchos::RCP<Epetra_Operator> create_DgDx_op(int j) const;
1249 
1251  virtual Teuchos::RCP<Epetra_Operator> create_DgDp_op( int j, int l ) const;
1252 
1254 
1257 
1259  virtual InArgs createInArgs() const = 0;
1260 
1262  virtual OutArgs createOutArgs() const = 0;
1263 
1265  virtual void evalModel( const InArgs& inArgs, const OutArgs& outArgs ) const = 0;
1266 
1267 #ifdef HAVE_PYTRILINOS
1268 
1269  friend InArgs convertInArgsFromPython(PyObject * source);
1270 
1272  friend OutArgs convertOutArgsFromPython(PyObject * source);
1273 #endif
1274 
1275 
1276 protected:
1277 
1280 
1282  class InArgsSetup : public InArgs {
1283  public:
1285  void setModelEvalDescription( const std::string &modelEvalDescription );
1287  void set_Np(int Np);
1289  void setSupports( EInArgsMembers arg, bool supports = true );
1291  void setSupports( EInArgs_p_sg arg, int l, bool supports );
1293  void setSupports( EInArgs_p_mp arg, int l, bool supports );
1294  };
1295 
1297  class OutArgsSetup : public OutArgs {
1298  public:
1300  void setModelEvalDescription( const std::string &modelEvalDescription );
1302  void set_Np_Ng(int Np, int Ng);
1304  void setSupports( EOutArgsMembers arg, bool supports = true );
1306  void setSupports(EOutArgsDfDp arg, int l, const DerivativeSupport& );
1308  void setSupports(EOutArgsDgDx_dot arg, int j, const DerivativeSupport& );
1309  void setSupports(EOutArgsDgDx_dotdot arg, int j, const DerivativeSupport& );
1311  void setSupports(EOutArgsDgDx arg, int j, const DerivativeSupport& );
1313  void setSupports(EOutArgsDgDp arg, int j, int l, const DerivativeSupport& );
1315  void setSupports( EOutArgs_g_sg arg, int j, bool supports );
1317  void setSupports(EOutArgsDfDp_sg arg, int l, const DerivativeSupport& );
1319  void setSupports(EOutArgsDgDx_dot_sg arg, int j, const DerivativeSupport& );
1320  void setSupports(EOutArgsDgDx_dotdot_sg arg, int j, const DerivativeSupport& );
1322  void setSupports(EOutArgsDgDx_sg arg, int j, const DerivativeSupport& );
1324  void setSupports(EOutArgsDgDp_sg arg, int j, int l, const DerivativeSupport& );
1326  void setSupports( EOutArgs_g_mp arg, int j, bool supports );
1328  void setSupports(EOutArgsDfDp_mp arg, int l, const DerivativeSupport& );
1330  void setSupports(EOutArgsDgDx_dot_mp arg, int j, const DerivativeSupport& );
1331  void setSupports(EOutArgsDgDx_dotdot_mp arg, int j, const DerivativeSupport& );
1333  void setSupports(EOutArgsDgDx_mp arg, int j, const DerivativeSupport& );
1335  void setSupports(EOutArgsDgDp_mp arg, int j, int l, const DerivativeSupport& );
1337  void set_W_properties( const DerivativeProperties &properties );
1338  void set_WPrec_properties( const DerivativeProperties &properties );
1340  void set_DfDp_properties( int l, const DerivativeProperties &properties );
1342  void set_DgDx_dot_properties( int j, const DerivativeProperties &properties );
1343  void set_DgDx_dotdot_properties( int j, const DerivativeProperties &properties );
1345  void set_DgDx_properties( int j, const DerivativeProperties &properties );
1347  void set_DgDp_properties( int j, int l, const DerivativeProperties &properties );
1349  void set_DfDp_sg_properties( int l, const DerivativeProperties &properties );
1351  void set_DgDx_dot_sg_properties( int j, const DerivativeProperties &properties );
1352  void set_DgDx_dotdot_sg_properties( int j, const DerivativeProperties &properties );
1354  void set_DgDx_sg_properties( int j, const DerivativeProperties &properties );
1356  void set_DgDp_sg_properties( int j, int l, const DerivativeProperties &properties );
1358  void set_DfDp_mp_properties( int l, const DerivativeProperties &properties );
1360  void set_DgDx_dot_mp_properties( int j, const DerivativeProperties &properties );
1361  void set_DgDx_dotdot_mp_properties( int j, const DerivativeProperties &properties );
1363  void set_DgDx_mp_properties( int j, const DerivativeProperties &properties );
1365  void set_DgDp_mp_properties( int j, int l, const DerivativeProperties &properties );
1366  };
1367 
1369 
1370 };
1371 
1372 // ////////////////////////////
1373 // Helper functions
1374 
1377 
1379 std::string toString( ModelEvaluator::EInArgsMembers inArg );
1380 
1382 std::string toString( ModelEvaluator::EOutArgsMembers outArg );
1383 
1385 Teuchos::RCP<Epetra_Operator>
1386 getLinearOp(
1387  const std::string &modelEvalDescription,
1388  const ModelEvaluator::Derivative &deriv,
1389  const std::string &derivName
1390  );
1391 
1393 Teuchos::RCP<Epetra_MultiVector>
1395  const std::string &modelEvalDescription,
1396  const ModelEvaluator::Derivative &deriv,
1397  const std::string &derivName,
1399  );
1400 
1402 Teuchos::RCP<Epetra_Operator>
1403 get_DfDp_op(
1404  const int l
1405  ,const ModelEvaluator::OutArgs &outArgs
1406  );
1407 
1409 Teuchos::RCP<Epetra_MultiVector>
1410 get_DfDp_mv(
1411  const int l
1412  ,const ModelEvaluator::OutArgs &outArgs
1413  );
1414 
1416 Teuchos::RCP<Epetra_MultiVector>
1418  const int j
1419  ,const ModelEvaluator::OutArgs &outArgs
1421  );
1422 
1424 Teuchos::RCP<Epetra_MultiVector>
1426  const int j
1427  ,const ModelEvaluator::OutArgs &outArgs
1429  );
1430 
1432 Teuchos::RCP<Epetra_MultiVector>
1433 get_DgDx_mv(
1434  const int j
1435  ,const ModelEvaluator::OutArgs &outArgs
1437  );
1438 
1440 Teuchos::RCP<Epetra_MultiVector>
1441 get_DgDp_mv(
1442  const int j
1443  ,const int l
1444  ,const ModelEvaluator::OutArgs &outArgs
1446  );
1447 
1448 // ///////////////////////////
1449 // Inline Functions
1450 
1451 //
1452 // ModelEvaluator::InArgs
1453 //
1454 
1455 inline
1456 std::string ModelEvaluator::InArgs::modelEvalDescription() const
1457 { return modelEvalDescription_; }
1458 
1459 inline
1460 int ModelEvaluator::InArgs::Np() const
1461 { return p_.size(); }
1462 
1463 inline
1464 void ModelEvaluator::InArgs::set_x_dot( const Teuchos::RCP<const Epetra_Vector> &x_dot )
1465 { assert_supports(IN_ARG_x_dot); x_dot_ = x_dot; }
1466 
1467 inline
1468 void ModelEvaluator::InArgs::set_x_dotdot( const Teuchos::RCP<const Epetra_Vector> &x_dotdot )
1469 { assert_supports(IN_ARG_x_dotdot); x_dotdot_ = x_dotdot; }
1470 
1471 inline
1472 Teuchos::RCP<const Epetra_Vector> ModelEvaluator::InArgs::get_x_dot() const
1473 { assert_supports(IN_ARG_x_dot); return x_dot_; }
1474 
1475 inline
1476 Teuchos::RCP<const Epetra_Vector> ModelEvaluator::InArgs::get_x_dotdot() const
1477 { assert_supports(IN_ARG_x_dotdot); return x_dotdot_; }
1478 
1479 inline
1480 void ModelEvaluator::InArgs::set_x( const Teuchos::RCP<const Epetra_Vector> &x )
1481 { assert_supports(IN_ARG_x); x_ = x; }
1482 
1483 inline
1484 Teuchos::RCP<const Epetra_Vector> ModelEvaluator::InArgs::get_x() const
1485 { assert_supports(IN_ARG_x); return x_; }
1486 
1487 inline
1488 void ModelEvaluator::InArgs::set_x_dot_poly( const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_dot_poly )
1489 { assert_supports(IN_ARG_x_dot_poly); x_dot_poly_ = x_dot_poly; }
1490 
1491 inline
1492 void ModelEvaluator::InArgs::set_x_dotdot_poly( const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_dotdot_poly )
1493 { assert_supports(IN_ARG_x_dotdot_poly); x_dotdot_poly_ = x_dotdot_poly; }
1494 
1495 inline
1496 Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> >
1497 ModelEvaluator::InArgs::get_x_dot_poly() const
1498 { assert_supports(IN_ARG_x_dot_poly); return x_dot_poly_; }
1499 
1500 inline
1501 Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> >
1502 ModelEvaluator::InArgs::get_x_dotdot_poly() const
1503 { assert_supports(IN_ARG_x_dotdot_poly); return x_dotdot_poly_; }
1504 
1505 inline
1506 void ModelEvaluator::InArgs::set_x_poly( const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_poly )
1507 { assert_supports(IN_ARG_x_poly); x_poly_ = x_poly; }
1508 
1509 inline
1510 Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> >
1511 ModelEvaluator::InArgs::get_x_poly() const
1512 { assert_supports(IN_ARG_x_poly); return x_poly_; }
1513 
1514 inline
1515 void ModelEvaluator::InArgs::set_x_dot_sg( const ModelEvaluator::InArgs::sg_const_vector_t &x_dot_sg )
1516 { assert_supports(IN_ARG_x_dot_sg); x_dot_sg_ = x_dot_sg; }
1517 
1518 inline
1519 void ModelEvaluator::InArgs::set_x_dotdot_sg( const ModelEvaluator::InArgs::sg_const_vector_t &x_dotdot_sg )
1520 { assert_supports(IN_ARG_x_dotdot_sg); x_dotdot_sg_ = x_dotdot_sg; }
1521 
1522 inline
1524 ModelEvaluator::InArgs::get_x_dot_sg() const
1525 { assert_supports(IN_ARG_x_dot_sg); return x_dot_sg_; }
1526 
1527 inline
1529 ModelEvaluator::InArgs::get_x_dotdot_sg() const
1530 { assert_supports(IN_ARG_x_dotdot_sg); return x_dotdot_sg_; }
1531 
1532 inline
1533 void ModelEvaluator::InArgs::set_x_dot_mp( const ModelEvaluator::mp_const_vector_t &x_dot_mp )
1534 { assert_supports(IN_ARG_x_dot_mp); x_dot_mp_ = x_dot_mp; }
1535 
1536 inline
1537 void ModelEvaluator::InArgs::set_x_dotdot_mp( const ModelEvaluator::mp_const_vector_t &x_dotdot_mp )
1538 { assert_supports(IN_ARG_x_dotdot_mp); x_dotdot_mp_ = x_dotdot_mp; }
1539 
1540 inline
1542 ModelEvaluator::InArgs::get_x_dot_mp() const
1543 { assert_supports(IN_ARG_x_dot_mp); return x_dot_mp_; }
1544 
1545 inline
1547 ModelEvaluator::InArgs::get_x_dotdot_mp() const
1548 { assert_supports(IN_ARG_x_dotdot_mp); return x_dotdot_mp_; }
1549 
1550 inline
1551 void ModelEvaluator::InArgs::set_x_sg( const ModelEvaluator::InArgs::sg_const_vector_t &x_sg )
1552 { assert_supports(IN_ARG_x_sg); x_sg_ = x_sg; }
1553 
1554 inline
1556 ModelEvaluator::InArgs::get_x_sg() const
1557 { assert_supports(IN_ARG_x_sg); return x_sg_; }
1558 
1559 inline
1560 void ModelEvaluator::InArgs::set_x_mp( const ModelEvaluator::mp_const_vector_t &x_mp )
1561 { assert_supports(IN_ARG_x_mp); x_mp_ = x_mp; }
1562 
1563 inline
1565 ModelEvaluator::InArgs::get_x_mp() const
1566 { assert_supports(IN_ARG_x_mp); return x_mp_; }
1567 
1568 inline
1569 void ModelEvaluator::InArgs::set_p( int l, const Teuchos::RCP<const Epetra_Vector> &p_l )
1570 { assert_l(l); p_[l] = p_l; }
1571 
1572 inline
1573 Teuchos::RCP<const Epetra_Vector> ModelEvaluator::InArgs::get_p(int l) const
1574 { assert_l(l); return p_[l]; }
1575 
1576 inline
1577 void ModelEvaluator::InArgs::set_p_sg( int l,
1579 { assert_supports(IN_ARG_p_sg, l); p_sg_[l] = p_sg_l; }
1580 
1581 inline
1583 ModelEvaluator::InArgs::get_p_sg(int l) const
1584 { assert_supports(IN_ARG_p_sg, l); return p_sg_[l]; }
1585 
1586 inline
1587 void ModelEvaluator::InArgs::set_p_mp( int l,
1588  const ModelEvaluator::mp_const_vector_t &p_mp_l )
1589 { assert_supports(IN_ARG_p_mp, l); p_mp_[l] = p_mp_l; }
1590 
1591 inline
1593 ModelEvaluator::InArgs::get_p_mp(int l) const
1594 { assert_supports(IN_ARG_p_mp, l); return p_mp_[l]; }
1595 
1596 inline
1597 void ModelEvaluator::InArgs::set_t( double t )
1598 { assert_supports(IN_ARG_t); t_ = t; }
1599 
1600 inline
1601 double ModelEvaluator::InArgs::get_t() const
1602 { assert_supports(IN_ARG_t); return t_; }
1603 
1604 inline
1605 void ModelEvaluator::InArgs::set_alpha( double alpha )
1606 { assert_supports(IN_ARG_alpha); alpha_ = alpha; }
1607 
1608 inline
1609 double ModelEvaluator::InArgs::get_alpha() const
1610 { assert_supports(IN_ARG_alpha); return alpha_; }
1611 
1612 inline
1613 void ModelEvaluator::InArgs::set_omega( double omega )
1614 { assert_supports(IN_ARG_omega); omega_ = omega; }
1615 
1616 inline
1617 double ModelEvaluator::InArgs::get_omega() const
1618 { assert_supports(IN_ARG_omega); return omega_; }
1619 
1620 inline
1621 void ModelEvaluator::InArgs::set_beta( double beta )
1622 { assert_supports(IN_ARG_beta); beta_ = beta; }
1623 
1624 inline
1625 double ModelEvaluator::InArgs::get_beta() const
1626 { assert_supports(IN_ARG_beta); return beta_; }
1627 
1628 inline
1629 void ModelEvaluator::InArgs::set_sg_basis( const Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> >& basis )
1630 { assert_supports(IN_ARG_sg_basis); sg_basis_ = basis; }
1631 
1632 inline
1633 Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> >
1634 ModelEvaluator::InArgs::get_sg_basis() const
1635 { assert_supports(IN_ARG_sg_basis); return sg_basis_; }
1636 
1637 inline
1638 void ModelEvaluator::InArgs::set_sg_quadrature( const Teuchos::RCP<const Stokhos::Quadrature<int,double> >& quad )
1639 { assert_supports(IN_ARG_sg_quadrature); sg_quad_ = quad; }
1640 
1641 inline
1642 Teuchos::RCP<const Stokhos::Quadrature<int,double> >
1643 ModelEvaluator::InArgs::get_sg_quadrature() const
1644 { assert_supports(IN_ARG_sg_quadrature); return sg_quad_; }
1645 
1646 inline
1647 void ModelEvaluator::InArgs::set_sg_expansion( const Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > >& exp )
1648 { assert_supports(IN_ARG_sg_expansion); sg_exp_ = exp; }
1649 
1650 inline
1651 Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > >
1652 ModelEvaluator::InArgs::get_sg_expansion() const
1653 { assert_supports(IN_ARG_sg_expansion); return sg_exp_; }
1654 
1655 inline
1656 void ModelEvaluator::InArgs::_setModelEvalDescription( const std::string &new_modelEvalDescription )
1657 {
1658  modelEvalDescription_ = new_modelEvalDescription;
1659 }
1660 
1661 inline
1662 void ModelEvaluator::InArgs::_set_Np(int new_Np)
1663 {
1664  p_.resize(new_Np);
1665  p_sg_.resize(new_Np);
1666  p_mp_.resize(new_Np);
1667  supports_p_sg_.resize(new_Np);
1668  supports_p_mp_.resize(new_Np);
1669 }
1670 
1671 //
1672 // ModelEvaluator::OutArgs
1673 //
1674 
1675 inline
1676 std::string ModelEvaluator::OutArgs::modelEvalDescription() const
1677 { return modelEvalDescription_; }
1678 
1679 inline
1680 int ModelEvaluator::OutArgs::Np() const
1681 {
1682  return DfDp_.size();
1683 }
1684 
1685 inline
1686 int ModelEvaluator::OutArgs::Ng() const
1687 {
1688  return g_.size();
1689 }
1690 
1691 inline
1692 void ModelEvaluator::OutArgs::set_f( const Evaluation<Epetra_Vector> &f ) { f_ = f; }
1693 
1694 inline
1696 ModelEvaluator::OutArgs::get_f() const { return f_; }
1697 
1698 inline
1699 void ModelEvaluator::OutArgs::set_g( int j, const Evaluation<Epetra_Vector> &g_j )
1700 {
1701  assert_j(j);
1702  g_[j] = g_j;
1703 }
1704 
1705 inline
1707 ModelEvaluator::OutArgs::get_g(int j) const
1708 {
1709  assert_j(j);
1710  return g_[j];
1711 }
1712 
1713 inline
1714 void ModelEvaluator::OutArgs::set_g_sg( int j, const sg_vector_t &g_sg_j )
1715 {
1716  assert_supports(OUT_ARG_g_sg, j);
1717  g_sg_[j] = g_sg_j;
1718 }
1719 
1720 inline
1722 ModelEvaluator::OutArgs::get_g_sg(int j) const
1723 {
1724  assert_supports(OUT_ARG_g_sg, j);
1725  return g_sg_[j];
1726 }
1727 
1728 inline
1729 void ModelEvaluator::OutArgs::set_g_mp( int j, const mp_vector_t &g_mp_j )
1730 {
1731  assert_supports(OUT_ARG_g_mp, j);
1732  g_mp_[j] = g_mp_j;
1733 }
1734 
1735 inline
1737 ModelEvaluator::OutArgs::get_g_mp(int j) const
1738 {
1739  assert_supports(OUT_ARG_g_mp, j);
1740  return g_mp_[j];
1741 }
1742 
1743 inline
1744 void ModelEvaluator::OutArgs::set_W( const Teuchos::RCP<Epetra_Operator> &W ) { W_ = W; }
1745 inline
1746 void ModelEvaluator::OutArgs::set_WPrec( const Teuchos::RCP<Epetra_Operator> &WPrec ) { WPrec_ = WPrec; }
1747 
1748 inline
1749 Teuchos::RCP<Epetra_Operator> ModelEvaluator::OutArgs::get_W() const { return W_; }
1750 inline
1751 Teuchos::RCP<Epetra_Operator> ModelEvaluator::OutArgs::get_WPrec() const { return WPrec_; }
1752 
1753 inline
1754 ModelEvaluator::DerivativeProperties ModelEvaluator::OutArgs::get_W_properties() const
1755 { return W_properties_; }
1756 inline
1757 ModelEvaluator::DerivativeProperties ModelEvaluator::OutArgs::get_WPrec_properties() const
1758 { return WPrec_properties_; }
1759 
1760 inline
1761 void ModelEvaluator::OutArgs::set_DfDp( int l, const Derivative &DfDp_l )
1762 {
1763  assert_supports(OUT_ARG_DfDp,l);
1764  DfDp_[l] = DfDp_l;
1765 }
1766 
1767 inline
1769 ModelEvaluator::OutArgs::get_DfDp(int l) const
1770 {
1771  assert_supports(OUT_ARG_DfDp,l);
1772  return DfDp_[l];
1773 }
1774 
1775 inline
1777 ModelEvaluator::OutArgs::get_DfDp_properties(int l) const
1778 {
1779  assert_supports(OUT_ARG_DfDp,l);
1780  return DfDp_properties_[l];
1781 }
1782 
1783 inline
1784 void ModelEvaluator::OutArgs::set_DfDp_sg( int l, const SGDerivative &DfDp_sg_l )
1785 {
1786  assert_supports(OUT_ARG_DfDp_sg,l);
1787  DfDp_sg_[l] = DfDp_sg_l;
1788 }
1789 
1790 inline
1792 ModelEvaluator::OutArgs::get_DfDp_sg(int l) const
1793 {
1794  assert_supports(OUT_ARG_DfDp_sg,l);
1795  return DfDp_sg_[l];
1796 }
1797 
1798 inline
1800 ModelEvaluator::OutArgs::get_DfDp_sg_properties(int l) const
1801 {
1802  assert_supports(OUT_ARG_DfDp_sg,l);
1803  return DfDp_sg_properties_[l];
1804 }
1805 
1806 inline
1807 void ModelEvaluator::OutArgs::set_DfDp_mp( int l, const MPDerivative &DfDp_mp_l )
1808 {
1809  assert_supports(OUT_ARG_DfDp_mp,l);
1810  DfDp_mp_[l] = DfDp_mp_l;
1811 }
1812 
1813 inline
1815 ModelEvaluator::OutArgs::get_DfDp_mp(int l) const
1816 {
1817  assert_supports(OUT_ARG_DfDp_mp,l);
1818  return DfDp_mp_[l];
1819 }
1820 
1821 inline
1823 ModelEvaluator::OutArgs::get_DfDp_mp_properties(int l) const
1824 {
1825  assert_supports(OUT_ARG_DfDp_mp,l);
1826  return DfDp_mp_properties_[l];
1827 }
1828 
1829 inline
1830 void ModelEvaluator::OutArgs::set_DgDx_dot( int j, const Derivative &DgDx_dot_j )
1831 {
1832  assert_supports(OUT_ARG_DgDx_dot,j);
1833  DgDx_dot_[j] = DgDx_dot_j;
1834 }
1835 
1836 inline
1838 ModelEvaluator::OutArgs::get_DgDx_dot(int j) const
1839 {
1840  assert_supports(OUT_ARG_DgDx_dot,j);
1841  return DgDx_dot_[j];
1842 }
1843 
1844 inline
1846 ModelEvaluator::OutArgs::get_DgDx_dot_properties(int j) const
1847 {
1848  assert_supports(OUT_ARG_DgDx_dot,j);
1849  return DgDx_dot_properties_[j];
1850 }
1851 
1852 inline
1853 void ModelEvaluator::OutArgs::set_DgDx_dot_sg( int j, const SGDerivative &DgDx_dot_sg_j )
1854 {
1855  assert_supports(OUT_ARG_DgDx_dot_sg,j);
1856  DgDx_dot_sg_[j] = DgDx_dot_sg_j;
1857 }
1858 
1859 inline
1861 ModelEvaluator::OutArgs::get_DgDx_dot_sg(int j) const
1862 {
1863  assert_supports(OUT_ARG_DgDx_dot_sg,j);
1864  return DgDx_dot_sg_[j];
1865 }
1866 
1867 inline
1869 ModelEvaluator::OutArgs::get_DgDx_dot_sg_properties(int j) const
1870 {
1871  assert_supports(OUT_ARG_DgDx_dot_sg,j);
1872  return DgDx_dot_sg_properties_[j];
1873 }
1874 
1875 inline
1876 void ModelEvaluator::OutArgs::set_DgDx_dot_mp( int j, const MPDerivative &DgDx_dot_mp_j )
1877 {
1878  assert_supports(OUT_ARG_DgDx_dot_mp,j);
1879  DgDx_dot_mp_[j] = DgDx_dot_mp_j;
1880 }
1881 
1882 inline
1884 ModelEvaluator::OutArgs::get_DgDx_dot_mp(int j) const
1885 {
1886  assert_supports(OUT_ARG_DgDx_dot_mp,j);
1887  return DgDx_dot_mp_[j];
1888 }
1889 
1890 inline
1892 ModelEvaluator::OutArgs::get_DgDx_dot_mp_properties(int j) const
1893 {
1894  assert_supports(OUT_ARG_DgDx_dot_mp,j);
1895  return DgDx_dot_mp_properties_[j];
1896 }
1897 
1898 inline
1899 void ModelEvaluator::OutArgs::set_DgDx_dotdot( int j, const Derivative &DgDx_dotdot_j )
1900 {
1901  assert_supports(OUT_ARG_DgDx_dotdot,j);
1902  DgDx_dotdot_[j] = DgDx_dotdot_j;
1903 }
1904 
1905 inline
1907 ModelEvaluator::OutArgs::get_DgDx_dotdot(int j) const
1908 {
1909  assert_supports(OUT_ARG_DgDx_dotdot,j);
1910  return DgDx_dotdot_[j];
1911 }
1912 
1913 inline
1915 ModelEvaluator::OutArgs::get_DgDx_dotdot_properties(int j) const
1916 {
1917  assert_supports(OUT_ARG_DgDx_dotdot,j);
1918  return DgDx_dotdot_properties_[j];
1919 }
1920 
1921 inline
1922 void ModelEvaluator::OutArgs::set_DgDx_dotdot_sg( int j, const SGDerivative &DgDx_dotdot_sg_j )
1923 {
1924  assert_supports(OUT_ARG_DgDx_dotdot_sg,j);
1925  DgDx_dotdot_sg_[j] = DgDx_dotdot_sg_j;
1926 }
1927 
1928 inline
1930 ModelEvaluator::OutArgs::get_DgDx_dotdot_sg(int j) const
1931 {
1932  assert_supports(OUT_ARG_DgDx_dotdot_sg,j);
1933  return DgDx_dotdot_sg_[j];
1934 }
1935 
1936 inline
1938 ModelEvaluator::OutArgs::get_DgDx_dotdot_sg_properties(int j) const
1939 {
1940  assert_supports(OUT_ARG_DgDx_dotdot_sg,j);
1941  return DgDx_dotdot_sg_properties_[j];
1942 }
1943 
1944 inline
1945 void ModelEvaluator::OutArgs::set_DgDx_dotdot_mp( int j, const MPDerivative &DgDx_dotdot_mp_j )
1946 {
1947  assert_supports(OUT_ARG_DgDx_dotdot_mp,j);
1948  DgDx_dotdot_mp_[j] = DgDx_dotdot_mp_j;
1949 }
1950 
1951 inline
1953 ModelEvaluator::OutArgs::get_DgDx_dotdot_mp(int j) const
1954 {
1955  assert_supports(OUT_ARG_DgDx_dotdot_mp,j);
1956  return DgDx_dotdot_mp_[j];
1957 }
1958 
1959 inline
1961 ModelEvaluator::OutArgs::get_DgDx_dotdot_mp_properties(int j) const
1962 {
1963  assert_supports(OUT_ARG_DgDx_dotdot_mp,j);
1964  return DgDx_dotdot_mp_properties_[j];
1965 }
1966 
1967 inline
1968 void ModelEvaluator::OutArgs::set_DgDx( int j, const Derivative &DgDx_j )
1969 {
1970  assert_supports(OUT_ARG_DgDx,j);
1971  DgDx_[j] = DgDx_j;
1972 }
1973 
1974 inline
1976 ModelEvaluator::OutArgs::get_DgDx(int j) const
1977 {
1978  assert_supports(OUT_ARG_DgDx,j);
1979  return DgDx_[j];
1980 }
1981 
1982 inline
1984 ModelEvaluator::OutArgs::get_DgDx_properties(int j) const
1985 {
1986  assert_supports(OUT_ARG_DgDx,j);
1987  return DgDx_properties_[j];
1988 }
1989 
1990 inline
1991 void ModelEvaluator::OutArgs::set_DgDx_sg( int j, const SGDerivative &DgDx_sg_j )
1992 {
1993  assert_supports(OUT_ARG_DgDx_sg,j);
1994  DgDx_sg_[j] = DgDx_sg_j;
1995 }
1996 
1997 inline
1999 ModelEvaluator::OutArgs::get_DgDx_sg(int j) const
2000 {
2001  assert_supports(OUT_ARG_DgDx_sg,j);
2002  return DgDx_sg_[j];
2003 }
2004 
2005 inline
2007 ModelEvaluator::OutArgs::get_DgDx_sg_properties(int j) const
2008 {
2009  assert_supports(OUT_ARG_DgDx_sg,j);
2010  return DgDx_sg_properties_[j];
2011 }
2012 
2013 inline
2014 void ModelEvaluator::OutArgs::set_DgDx_mp( int j, const MPDerivative &DgDx_mp_j )
2015 {
2016  assert_supports(OUT_ARG_DgDx_mp,j);
2017  DgDx_mp_[j] = DgDx_mp_j;
2018 }
2019 
2020 inline
2022 ModelEvaluator::OutArgs::get_DgDx_mp(int j) const
2023 {
2024  assert_supports(OUT_ARG_DgDx_mp,j);
2025  return DgDx_mp_[j];
2026 }
2027 
2028 inline
2030 ModelEvaluator::OutArgs::get_DgDx_mp_properties(int j) const
2031 {
2032  assert_supports(OUT_ARG_DgDx_mp,j);
2033  return DgDx_mp_properties_[j];
2034 }
2035 
2036 inline
2037 void ModelEvaluator::OutArgs::set_DgDp( int j, int l, const Derivative &DgDp_j_l )
2038 {
2039  assert_supports(OUT_ARG_DgDp,j,l);
2040  DgDp_[ j*Np() + l ] = DgDp_j_l;
2041 }
2042 
2043 inline
2045 ModelEvaluator::OutArgs::get_DgDp(int j, int l) const
2046 {
2047  assert_supports(OUT_ARG_DgDp,j,l);
2048  return DgDp_[ j*Np() + l ];
2049 }
2050 
2051 inline
2053 ModelEvaluator::OutArgs::get_DgDp_properties(int j, int l) const
2054 {
2055  assert_supports(OUT_ARG_DgDp,j,l);
2056  return DgDp_properties_[ j*Np() + l ];
2057 }
2058 
2059 inline
2060 void ModelEvaluator::OutArgs::set_DgDp_sg( int j, int l, const SGDerivative &DgDp_sg_j_l )
2061 {
2062  assert_supports(OUT_ARG_DgDp_sg,j,l);
2063  DgDp_sg_[ j*Np() + l ] = DgDp_sg_j_l;
2064 }
2065 
2066 inline
2068 ModelEvaluator::OutArgs::get_DgDp_sg(int j, int l) const
2069 {
2070  assert_supports(OUT_ARG_DgDp_sg,j,l);
2071  return DgDp_sg_[ j*Np() + l ];
2072 }
2073 
2074 inline
2076 ModelEvaluator::OutArgs::get_DgDp_sg_properties(int j, int l) const
2077 {
2078  assert_supports(OUT_ARG_DgDp_sg,j,l);
2079  return DgDp_sg_properties_[ j*Np() + l ];
2080 }
2081 
2082 inline
2083 void ModelEvaluator::OutArgs::set_DgDp_mp( int j, int l, const MPDerivative &DgDp_mp_j_l )
2084 {
2085  assert_supports(OUT_ARG_DgDp_mp,j,l);
2086  DgDp_mp_[ j*Np() + l ] = DgDp_mp_j_l;
2087 }
2088 
2089 inline
2091 ModelEvaluator::OutArgs::get_DgDp_mp(int j, int l) const
2092 {
2093  assert_supports(OUT_ARG_DgDp_mp,j,l);
2094  return DgDp_mp_[ j*Np() + l ];
2095 }
2096 
2097 inline
2099 ModelEvaluator::OutArgs::get_DgDp_mp_properties(int j, int l) const
2100 {
2101  assert_supports(OUT_ARG_DgDp_mp,j,l);
2102  return DgDp_mp_properties_[ j*Np() + l ];
2103 }
2104 
2105 inline
2106 void ModelEvaluator::OutArgs::set_f_poly( const Teuchos::RCP<Teuchos::Polynomial<Epetra_Vector> > &f_poly )
2107 { f_poly_ = f_poly; }
2108 
2109 inline
2110 Teuchos::RCP<Teuchos::Polynomial<Epetra_Vector> >
2111 ModelEvaluator::OutArgs::get_f_poly() const
2112 { return f_poly_; }
2113 
2114 inline
2115 void ModelEvaluator::OutArgs::set_f_sg( const ModelEvaluator::OutArgs::sg_vector_t& f_sg )
2116 { f_sg_ = f_sg; }
2117 
2118 inline
2120 ModelEvaluator::OutArgs::get_f_sg() const
2121 { return f_sg_; }
2122 
2123 inline
2124 void ModelEvaluator::OutArgs::set_W_sg( const ModelEvaluator::OutArgs::sg_operator_t& W_sg ) { W_sg_ = W_sg; }
2125 
2126 inline
2127 ModelEvaluator::OutArgs::sg_operator_t ModelEvaluator::OutArgs::get_W_sg() const { return W_sg_; }
2128 
2129 inline
2130 void ModelEvaluator::OutArgs::set_f_mp( const ModelEvaluator::mp_vector_t& f_mp )
2131 { f_mp_ = f_mp; }
2132 
2133 inline
2135 ModelEvaluator::OutArgs::get_f_mp() const
2136 { return f_mp_; }
2137 
2138 inline
2139 void ModelEvaluator::OutArgs::set_W_mp( const ModelEvaluator::mp_operator_t& W_mp ) { W_mp_ = W_mp; }
2140 
2141 inline
2142 ModelEvaluator::mp_operator_t ModelEvaluator::OutArgs::get_W_mp() const { return W_mp_; }
2143 
2144 //
2145 // ModelEvaluator::InArgsSetup
2146 //
2147 
2148 inline
2149 void ModelEvaluator::InArgsSetup::setModelEvalDescription( const std::string &new_modelEvalDescription )
2150 {
2151  this->_setModelEvalDescription(new_modelEvalDescription);
2152 }
2153 
2154 inline
2155 void ModelEvaluator::InArgsSetup::set_Np(int new_Np)
2156 { this->_set_Np(new_Np); }
2157 
2158 inline
2159 void ModelEvaluator::InArgsSetup::setSupports( EInArgsMembers arg, bool new_supports )
2160 { this->_setSupports(arg,new_supports); }
2161 
2162 inline
2163 void ModelEvaluator::InArgsSetup::setSupports( EInArgs_p_sg arg, int l, bool new_supports )
2164 { this->_setSupports(arg,l,new_supports); }
2165 
2166 inline
2167 void ModelEvaluator::InArgsSetup::setSupports( EInArgs_p_mp arg, int l, bool new_supports )
2168 { this->_setSupports(arg,l,new_supports); }
2169 
2170 //
2171 // ModelEvaluator::OutArgsSetup
2172 //
2173 
2174 inline
2175 void ModelEvaluator::OutArgsSetup::setModelEvalDescription( const std::string &new_modelEvalDescription )
2176 {
2177  this->_setModelEvalDescription(new_modelEvalDescription);
2178 }
2179 
2180 inline
2181 void ModelEvaluator::OutArgsSetup::set_Np_Ng(int new_Np, int new_Ng)
2182 { this->_set_Np_Ng(new_Np,new_Ng); }
2183 
2184 inline
2185 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsMembers arg, bool new_supports )
2186 { this->_setSupports(arg,new_supports); }
2187 
2188 inline
2189 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDfDp arg, int l, const DerivativeSupport& new_supports )
2190 { this->_setSupports(arg,l,new_supports); }
2191 
2192 inline
2193 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx_dot arg, int j, const DerivativeSupport& new_supports )
2194 { this->_setSupports(arg,j,new_supports); }
2195 
2196 inline
2197 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx_dotdot arg, int j, const DerivativeSupport& new_supports )
2198 { this->_setSupports(arg,j,new_supports); }
2199 
2200 inline
2201 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx arg, int j, const DerivativeSupport& new_supports )
2202 { this->_setSupports(arg,j,new_supports); }
2203 
2204 inline
2205 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDp arg, int j, int l, const DerivativeSupport& new_supports )
2206 { this->_setSupports(arg,j,l,new_supports); }
2207 
2208 inline
2209 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgs_g_sg arg, int j, bool new_supports )
2210 { this->_setSupports(arg,j,new_supports); }
2211 
2212 inline
2213 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDfDp_sg arg, int l, const DerivativeSupport& new_supports )
2214 { this->_setSupports(arg,l,new_supports); }
2215 
2216 inline
2217 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx_dot_sg arg, int j, const DerivativeSupport& new_supports )
2218 { this->_setSupports(arg,j,new_supports); }
2219 
2220 inline
2221 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx_dotdot_sg arg, int j, const DerivativeSupport& new_supports )
2222 { this->_setSupports(arg,j,new_supports); }
2223 
2224 inline
2225 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx_sg arg, int j, const DerivativeSupport& new_supports )
2226 { this->_setSupports(arg,j,new_supports); }
2227 
2228 inline
2229 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDp_sg arg, int j, int l, const DerivativeSupport& new_supports )
2230 { this->_setSupports(arg,j,l,new_supports); }
2231 
2232 inline
2233 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgs_g_mp arg, int j, bool new_supports )
2234 { this->_setSupports(arg,j,new_supports); }
2235 
2236 inline
2237 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDfDp_mp arg, int l, const DerivativeSupport& new_supports )
2238 { this->_setSupports(arg,l,new_supports); }
2239 
2240 inline
2241 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx_dot_mp arg, int j, const DerivativeSupport& new_supports )
2242 { this->_setSupports(arg,j,new_supports); }
2243 
2244 inline
2245 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx_dotdot_mp arg, int j, const DerivativeSupport& new_supports )
2246 { this->_setSupports(arg,j,new_supports); }
2247 
2248 inline
2249 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx_mp arg, int j, const DerivativeSupport& new_supports )
2250 { this->_setSupports(arg,j,new_supports); }
2251 
2252 inline
2253 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDp_mp arg, int j, int l, const DerivativeSupport& new_supports )
2254 { this->_setSupports(arg,j,l,new_supports); }
2255 
2256 inline
2257 void ModelEvaluator::OutArgsSetup::set_W_properties( const DerivativeProperties &properties )
2258 { this->_set_W_properties(properties); }
2259 inline
2260 void ModelEvaluator::OutArgsSetup::set_WPrec_properties( const DerivativeProperties &properties )
2261 { this->_set_WPrec_properties(properties); }
2262 
2263 inline
2264 void ModelEvaluator::OutArgsSetup::set_DfDp_properties( int l, const DerivativeProperties &properties )
2265 {
2266  this->_set_DfDp_properties(l,properties);
2267 }
2268 
2269 inline
2270 void ModelEvaluator::OutArgsSetup::set_DgDx_dot_properties( int j, const DerivativeProperties &properties )
2271 {
2272  this->_set_DgDx_dot_properties(j,properties);
2273 }
2274 
2275 inline
2276 void ModelEvaluator::OutArgsSetup::set_DgDx_dotdot_properties( int j, const DerivativeProperties &properties )
2277 {
2278  this->_set_DgDx_dotdot_properties(j,properties);
2279 }
2280 
2281 inline
2282 void ModelEvaluator::OutArgsSetup::set_DgDx_properties( int j, const DerivativeProperties &properties )
2283 {
2284  this->_set_DgDx_properties(j,properties);
2285 }
2286 
2287 inline
2288 void ModelEvaluator::OutArgsSetup::set_DgDp_properties( int j, int l, const DerivativeProperties &properties )
2289 {
2290  this->_set_DgDp_properties(j,l,properties);
2291 }
2292 
2293 inline
2294 void ModelEvaluator::OutArgsSetup::set_DfDp_sg_properties( int l, const DerivativeProperties &properties )
2295 {
2296  this->_set_DfDp_sg_properties(l,properties);
2297 }
2298 
2299 inline
2300 void ModelEvaluator::OutArgsSetup::set_DgDx_dot_sg_properties( int j, const DerivativeProperties &properties )
2301 {
2302  this->_set_DgDx_dot_sg_properties(j,properties);
2303 }
2304 
2305 inline
2306 void ModelEvaluator::OutArgsSetup::set_DgDx_dotdot_sg_properties( int j, const DerivativeProperties &properties )
2307 {
2308  this->_set_DgDx_dotdot_sg_properties(j,properties);
2309 }
2310 
2311 inline
2312 void ModelEvaluator::OutArgsSetup::set_DgDx_sg_properties( int j, const DerivativeProperties &properties )
2313 {
2314  this->_set_DgDx_sg_properties(j,properties);
2315 }
2316 
2317 inline
2318 void ModelEvaluator::OutArgsSetup::set_DgDp_sg_properties( int j, int l, const DerivativeProperties &properties )
2319 {
2320  this->_set_DgDp_sg_properties(j,l,properties);
2321 }
2322 
2323 inline
2324 void ModelEvaluator::OutArgsSetup::set_DfDp_mp_properties( int l, const DerivativeProperties &properties )
2325 {
2326  this->_set_DfDp_mp_properties(l,properties);
2327 }
2328 
2329 inline
2330 void ModelEvaluator::OutArgsSetup::set_DgDx_dot_mp_properties( int j, const DerivativeProperties &properties )
2331 {
2332  this->_set_DgDx_dot_mp_properties(j,properties);
2333 }
2334 
2335 inline
2336 void ModelEvaluator::OutArgsSetup::set_DgDx_dotdot_mp_properties( int j, const DerivativeProperties &properties )
2337 {
2338  this->_set_DgDx_dotdot_mp_properties(j,properties);
2339 }
2340 
2341 inline
2342 void ModelEvaluator::OutArgsSetup::set_DgDx_mp_properties( int j, const DerivativeProperties &properties )
2343 {
2344  this->_set_DgDx_mp_properties(j,properties);
2345 }
2346 
2347 inline
2348 void ModelEvaluator::OutArgsSetup::set_DgDp_mp_properties( int j, int l, const DerivativeProperties &properties )
2349 {
2350  this->_set_DgDp_mp_properties(j,l,properties);
2351 }
2352 
2353 } // namespace EpetraExt
2354 
2355 #endif // EPETRA_EXT_MODEL_EVALUATOR_HPP
Simple aggregate class that stores a derivative object as a general linear operator or as a multi-vec...
DerivativeMultiVector getDerivativeMultiVector() const
EDerivativeMultiVectorOrientation getMultiVectorOrientation() const
MPDerivativeMultiVector(const mp_multivector_t &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL, const Teuchos::Array< int > &paramIndexes=Teuchos::Array< int >())
Preconditioner()
Default constructor of null Operatir.
Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > sg_operator_t
Short-hand for stochastic Galerkin operator type.
Preconditioner(const Teuchos::RCP< Epetra_Operator > &PrecOp_, bool isAlreadyInverted_)
Usable constructor to set the (Epetra_Operator,bool) pair.
Teuchos::RCP< Epetra_Operator > getLinearOp(const std::string &modelEvalDescription, const ModelEvaluator::Derivative &deriv, const std::string &derivName)
Teuchos::RCP< Epetra_MultiVector > get_DgDp_mv(const int j, const int l, const ModelEvaluator::OutArgs &outArgs, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
SGDerivativeMultiVector(const Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL, const Teuchos::Array< int > &paramIndexes=Teuchos::Array< int >())
std::string toString(ModelEvaluator::EOutArgsMembers outArg)
Teuchos::RCP< Epetra_MultiVector > get_DgDx_dot_mv(const int j, const ModelEvaluator::OutArgs &outArgs, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
Teuchos::RCP< Stokhos::ProductEpetraMultiVector > mp_multivector_t
Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const
Teuchos::RCP< Stokhos::ProductEpetraOperator > mp_operator_t
Teuchos::RCP< const Stokhos::ProductEpetraMultiVector > mp_const_multivector_t
SGDerivativeMultiVector getDerivativeMultiVector() const
Teuchos::RCP< Epetra_Operator > PrecOp
Accessor for the Epetra_Operator.
DerivativeSupport(EDerivativeMultiVectorOrientation mvOrientation)
const Teuchos::Array< int > & getParamIndexes() const
Teuchos::RCP< Epetra_Operator > getLinearOp() const
bool supports(EDerivativeMultiVectorOrientation mvOrientation) const
Simple aggregate class that stores a derivative object as a general linear operator or as a multi-vec...
EDerivativeMultiVectorOrientation getOrientation() const
Teuchos::RCP< Epetra_MultiVector > getMultiVector(const std::string &modelEvalDescription, const ModelEvaluator::Derivative &deriv, const std::string &derivName, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
void changeOrientation(const EDerivativeMultiVectorOrientation orientation)
EpetraExt::BlockCrsMatrix: A class for constructing a distributed block matrix.
Simple aggregate class that stores a derivative object as a general linear operator or as a multi-vec...
Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > getLinearOp() const
Simple aggregate class for a derivative object represented as a column-wise multi-vector or its trans...
MPDerivativeMultiVector getDerivativeMultiVector() const
Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > sg_vector_t
Short-hand for stochastic Galerkin vector type.
Teuchos::RCP< Epetra_MultiVector > getMultiVector() const
Evaluation(const Teuchos::RCP< ObjType > &obj)
Teuchos::RCP< const Stokhos::EpetraVectorOrthogPoly > sg_const_vector_t
Short-hand for stochastic Galerkin vector type.
Teuchos::RCP< Epetra_MultiVector > get_DfDp_mv(const int l, const ModelEvaluator::OutArgs &outArgs)
Derivative(const DerivativeMultiVector &dmv)
Simple aggregate class for a derivative object represented as a column-wise multi-vector or its trans...
Teuchos::RCP< Epetra_MultiVector > getMultiVector() const
const Teuchos::Array< int > & getParamIndexes() const
Teuchos::RCP< Epetra_Operator > get_DfDp_op(const int l, const ModelEvaluator::OutArgs &outArgs)
MPDerivative(const MPDerivativeMultiVector &dmv)
DerivativeSupport & plus(EDerivativeMultiVectorOrientation mvOrientation)
MPDerivative(const mp_multivector_t &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL)
Teuchos::RCP< const Stokhos::ProductEpetraVector > mp_const_vector_t
EDerivativeMultiVectorOrientation getOrientation() const
Teuchos::RCP< Epetra_MultiVector > get_DgDx_mv(const int j, const ModelEvaluator::OutArgs &outArgs, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
Derivative(const Teuchos::RCP< Epetra_Operator > &lo)
DerivativeProperties(EDerivativeLinearity in_linearity, ERankStatus in_rank, bool in_supportsAdjoint)
SGDerivative(const Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > &lo)
Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const
EDerivativeMultiVectorOrientation getMultiVectorOrientation() const
Derivative(const Teuchos::RCP< Epetra_MultiVector > &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL)
DerivativeMultiVector(const Teuchos::RCP< Epetra_MultiVector > &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL, const Teuchos::Array< int > &paramIndexes=Teuchos::Array< int >())
void changeOrientation(const EDerivativeMultiVectorOrientation orientation)
void reset(const Teuchos::RCP< ObjType > &obj, EEvalType evalType)
Simple aggregate struct that stores a preconditioner as an Epetra_Operator and a bool, about whether it is inverted or not.
EDerivativeMultiVectorOrientation getOrientation() const
Teuchos::RCP< Epetra_MultiVector > get_DgDx_dotdot_mv(const int j, const ModelEvaluator::OutArgs &outArgs, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
SGDerivative(const Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL)
DerivativeSupport(EDerivativeLinearOp, EDerivativeMultiVectorOrientation mvOrientation)
EDerivativeMultiVectorOrientation getMultiVectorOrientation() const
Teuchos::RCP< Stokhos::ProductEpetraVector > mp_vector_t
Simple aggregate class for a derivative object represented as a column-wise multi-vector or its trans...
SGDerivative(const SGDerivativeMultiVector &dmv)
const Teuchos::Array< int > & getParamIndexes() const
void changeOrientation(const EDerivativeMultiVectorOrientation orientation)
DerivativeSupport(EDerivativeMultiVectorOrientation mvOrientation1, EDerivativeMultiVectorOrientation mvOrientation2)
DerivativeSupport & plus(EDerivativeLinearOp)
Base interface for evaluating a stateless "model".
Teuchos::RCP< const Stokhos::ProductEpetraOperator > mp_const_operator_t
Evaluation(const Teuchos::RCP< ObjType > &obj, EEvalType evalType)