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_RefCountPtr.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_sg_basis
111  ,IN_ARG_sg_quadrature
112  ,IN_ARG_sg_expansion
113  };
114  static const int NUM_E_IN_ARGS_MEMBERS=14;
115 
118  IN_ARG_p_sg
119  };
120 
123  IN_ARG_p_mp
124  };
125 
127  class InArgs {
128  public:
129 
131  typedef Teuchos::RefCountPtr<const Stokhos::EpetraVectorOrthogPoly> sg_const_vector_t;
132 
134  InArgs();
136  std::string modelEvalDescription() const;
138  int Np() const;
140  void set_x_dot( const Teuchos::RefCountPtr<const Epetra_Vector> &x_dot );
142  Teuchos::RefCountPtr<const Epetra_Vector> get_x_dot() const;
144  void set_x( const Teuchos::RefCountPtr<const Epetra_Vector> &x );
146  Teuchos::RefCountPtr<const Epetra_Vector> get_x() const;
147  void set_x_poly(
148  const Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > &x_poly
149  );
151  Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > get_x_poly() const;
153  void set_x_dot_poly(
154  const Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > &x_dot_poly
155  );
157  Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > get_x_dot_poly() const;
159  void set_x_sg(const sg_const_vector_t &x_sg);
161  sg_const_vector_t get_x_sg() const;
163  void set_x_dot_sg(const sg_const_vector_t &x_dot_sg);
165  sg_const_vector_t get_x_dot_sg() const;
167  void set_x_mp(const mp_const_vector_t &x_mp);
169  mp_const_vector_t get_x_mp() const;
171  void set_x_dot_mp(const mp_const_vector_t &x_dot_mp);
173  mp_const_vector_t get_x_dot_mp() const;
175  void set_p( int l, const Teuchos::RefCountPtr<const Epetra_Vector> &p_l );
177  Teuchos::RefCountPtr<const Epetra_Vector> get_p(int l) const;
179  void set_p_sg( int l, const sg_const_vector_t &p_sg_l );
181  sg_const_vector_t get_p_sg(int l) const;
183  void set_p_mp( int l, const mp_const_vector_t &p_mp_l );
185  mp_const_vector_t get_p_mp(int l) const;
187  void set_t( double t );
189  double get_alpha() const;
191  void set_alpha( double alpha );
193  double get_beta() const;
195  void set_beta( double beta );
197  double get_t() const;
199  Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> > get_sg_basis() const;
201  void set_sg_basis( const Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> >& basis );
203  Teuchos::RCP<const Stokhos::Quadrature<int,double> > get_sg_quadrature() const;
205  void set_sg_quadrature( const Teuchos::RCP<const Stokhos::Quadrature<int,double> >& quad );
207  Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > > get_sg_expansion() const;
209  void set_sg_expansion( const Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > >& exp );
211  bool supports(EInArgsMembers arg) const;
213  bool supports(EInArgs_p_sg arg, int l) const;
215  bool supports(EInArgs_p_mp arg, int l) const;
216  protected:
218  void _setModelEvalDescription( const std::string &modelEvalDescription );
220  void _set_Np(int Np);
222  void _setSupports( EInArgsMembers arg, bool supports );
224  void _setSupports( EInArgs_p_sg arg, int l, bool supports );
226  void _setSupports( EInArgs_p_mp arg, int l, bool supports );
227  private:
228  // types
229  typedef Teuchos::Array<Teuchos::RefCountPtr<const Epetra_Vector> > p_t;
230  typedef Teuchos::Array<sg_const_vector_t > p_sg_t;
231  typedef Teuchos::Array<mp_const_vector_t > p_mp_t;
232  typedef Teuchos::Array<bool> supports_p_sg_t;
233  // data
234  std::string modelEvalDescription_;
235  Teuchos::RefCountPtr<const Epetra_Vector> x_dot_;
236  Teuchos::RefCountPtr<const Epetra_Vector> x_;
237  Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > x_dot_poly_;
238  Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > x_poly_;
239  sg_const_vector_t x_dot_sg_;
240  sg_const_vector_t x_sg_;
241  mp_const_vector_t x_dot_mp_;
242  mp_const_vector_t x_mp_;
243  p_t p_;
244  p_sg_t p_sg_;
245  p_mp_t p_mp_;
246  double t_;
247  double alpha_;
248  double beta_;
249  Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> > sg_basis_;
250  Teuchos::RCP<const Stokhos::Quadrature<int,double> > sg_quad_;
251  Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > > sg_exp_;
252  bool supports_[NUM_E_IN_ARGS_MEMBERS];
253  supports_p_sg_t supports_p_sg_; // Np
254  supports_p_sg_t supports_p_mp_; // Np
255  // functions
256  void assert_supports(EInArgsMembers arg) const;
257  void assert_supports(EInArgs_p_sg arg, int l) const;
258  void assert_supports(EInArgs_p_mp arg, int l) const;
259  void assert_l(int l) const;
260  };
261 
263  enum EEvalType {
264  EVAL_TYPE_EXACT
265  ,EVAL_TYPE_APPROX_DERIV
266  ,EVAL_TYPE_VERY_APPROX_DERIV
267  };
268 
270  template<class ObjType>
271  class Evaluation : public Teuchos::RefCountPtr<ObjType> {
272  public:
274  Evaluation() : evalType_(EVAL_TYPE_EXACT) {}
276  Evaluation( const Teuchos::RefCountPtr<ObjType> &obj )
277  : Teuchos::RefCountPtr<ObjType>(obj), evalType_(EVAL_TYPE_EXACT) {}
279  Evaluation( const Teuchos::RefCountPtr<ObjType> &obj, EEvalType evalType )
280  : Teuchos::RefCountPtr<ObjType>(obj), evalType_(evalType) {}
282  EEvalType getType() const { return evalType_; }
284  void reset( const Teuchos::RefCountPtr<ObjType> &obj, EEvalType evalType )
285  { this->operator=(obj); evalType_ = evalType; }
286  private:
287  EEvalType evalType_;
288  };
289 
292  DERIV_MV_BY_COL
293  ,DERIV_TRANS_MV_BY_ROW
294  };
295 
297  enum EDerivativeLinearOp { DERIV_LINEAR_OP };
298 
301  public:
304  :supportsLinearOp_(false), supportsMVByCol_(false), supportsTransMVByRow_(false)
305  {}
308  :supportsLinearOp_(true), supportsMVByCol_(false), supportsTransMVByRow_(false)
309  {}
312  :supportsLinearOp_(false), supportsMVByCol_(mvOrientation==DERIV_MV_BY_COL)
313  ,supportsTransMVByRow_(mvOrientation==DERIV_TRANS_MV_BY_ROW)
314  {}
318  :supportsLinearOp_(true), supportsMVByCol_(mvOrientation==DERIV_MV_BY_COL)
319  ,supportsTransMVByRow_(mvOrientation==DERIV_TRANS_MV_BY_ROW)
320  {}
323  EDerivativeMultiVectorOrientation mvOrientation1,
324  EDerivativeMultiVectorOrientation mvOrientation2
325  )
326  :supportsLinearOp_(false)
327  ,supportsMVByCol_(
328  mvOrientation1==DERIV_MV_BY_COL||mvOrientation2==DERIV_MV_BY_COL )
329  ,supportsTransMVByRow_(
330  mvOrientation1==DERIV_TRANS_MV_BY_ROW||mvOrientation2==DERIV_TRANS_MV_BY_ROW )
331  {}
334  { supportsLinearOp_ = true; return *this; }
337  {
338  switch(mvOrientation) {
339  case DERIV_MV_BY_COL: supportsMVByCol_ = true; break;
340  case DERIV_TRANS_MV_BY_ROW: supportsTransMVByRow_ = true; break;
341  default: TEUCHOS_TEST_FOR_EXCEPT(true);
342  }
343  return *this;
344  }
346  bool none() const
347  { return ( !supportsLinearOp_ && !supportsMVByCol_ && !supportsTransMVByRow_ ); }
350  { return supportsLinearOp_; }
352  bool supports(EDerivativeMultiVectorOrientation mvOrientation) const
353  {
354  switch(mvOrientation) {
355  case DERIV_MV_BY_COL: return supportsMVByCol_;
356  case DERIV_TRANS_MV_BY_ROW: return supportsTransMVByRow_;
357  default: TEUCHOS_TEST_FOR_EXCEPT(true);
358  }
359  return false; // Will never be called!
360  }
361  private:
362  bool supportsLinearOp_;
363  bool supportsMVByCol_;
364  bool supportsTransMVByRow_;
365  public:
366  };
367 
370  DERIV_LINEARITY_UNKNOWN
371  ,DERIV_LINEARITY_CONST
372  ,DERIV_LINEARITY_NONCONST
373  };
375  enum ERankStatus {
376  DERIV_RANK_UNKNOWN
377  ,DERIV_RANK_FULL
378  ,DERIV_RANK_DEFICIENT
379  };
380 
391  :linearity(DERIV_LINEARITY_UNKNOWN),rank(DERIV_RANK_UNKNOWN),supportsAdjoint(false) {}
394  EDerivativeLinearity in_linearity, ERankStatus in_rank, bool in_supportsAdjoint
395  ):linearity(in_linearity),rank(in_rank),supportsAdjoint(in_supportsAdjoint) {}
396  };
397 
402  public:
407  const Teuchos::RefCountPtr<Epetra_MultiVector> &mv
408  ,const EDerivativeMultiVectorOrientation orientation = DERIV_MV_BY_COL
409  ,const Teuchos::Array<int> &paramIndexes = Teuchos::Array<int>()
410  ) : mv_(mv), orientation_(orientation), paramIndexes_(paramIndexes) {}
413  { orientation_ = orientation; };
415  Teuchos::RefCountPtr<Epetra_MultiVector> getMultiVector() const
416  { return mv_; }
419  { return orientation_; }
421  const Teuchos::Array<int>& getParamIndexes() const
422  { return paramIndexes_; }
423  private:
424  Teuchos::RefCountPtr<Epetra_MultiVector> mv_;
426  Teuchos::Array<int> paramIndexes_;
427  };
428 
432  class Derivative {
433  public:
437  Derivative( const Teuchos::RefCountPtr<Epetra_Operator> &lo )
438  : lo_(lo) {}
441  const Teuchos::RefCountPtr<Epetra_MultiVector> &mv
442  ,const EDerivativeMultiVectorOrientation orientation = DERIV_MV_BY_COL
443  ) : dmv_(mv,orientation) {}
446  : dmv_(dmv) {}
448  Teuchos::RefCountPtr<Epetra_Operator> getLinearOp() const
449  { return lo_; }
451  Teuchos::RefCountPtr<Epetra_MultiVector> getMultiVector() const
452  { return dmv_.getMultiVector(); }
455  { return dmv_.getOrientation(); }
458  { return dmv_; }
460  bool isEmpty() const
461  { return !lo_.get() && !dmv_.getMultiVector().get(); }
462  private:
463  Teuchos::RefCountPtr<Epetra_Operator> lo_;
465  };
466 
470  struct Preconditioner {
472  Preconditioner() : PrecOp(Teuchos::null), isAlreadyInverted(false) {}
474  Preconditioner(const Teuchos::RCP<Epetra_Operator>& PrecOp_,
475  bool isAlreadyInverted_ )
476  : PrecOp(PrecOp_), isAlreadyInverted(isAlreadyInverted_) {}
478  Teuchos::RCP<Epetra_Operator> PrecOp;
484  };
485 
490  public:
495  const Teuchos::RefCountPtr< Stokhos::EpetraMultiVectorOrthogPoly > &mv
496  ,const EDerivativeMultiVectorOrientation orientation = DERIV_MV_BY_COL
497  ,const Teuchos::Array<int> &paramIndexes = Teuchos::Array<int>()
498  ) : mv_(mv), orientation_(orientation), paramIndexes_(paramIndexes) {}
501  { orientation_ = orientation; };
503  Teuchos::RefCountPtr< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const
504  { return mv_; }
507  { return orientation_; }
509  const Teuchos::Array<int>& getParamIndexes() const
510  { return paramIndexes_; }
511  private:
512  Teuchos::RefCountPtr< Stokhos::EpetraMultiVectorOrthogPoly > mv_;
514  Teuchos::Array<int> paramIndexes_;
515  };
516 
520  class SGDerivative {
521  public:
525  SGDerivative( const Teuchos::RefCountPtr< Stokhos::EpetraOperatorOrthogPoly > &lo )
526  : lo_(lo) {}
529  const Teuchos::RefCountPtr< Stokhos::EpetraMultiVectorOrthogPoly > &mv
530  ,const EDerivativeMultiVectorOrientation orientation = DERIV_MV_BY_COL
531  ) : dmv_(mv,orientation) {}
534  : dmv_(dmv) {}
536  Teuchos::RefCountPtr< Stokhos::EpetraOperatorOrthogPoly > getLinearOp() const
537  { return lo_; }
539  Teuchos::RefCountPtr< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const
540  { return dmv_.getMultiVector(); }
543  { return dmv_.getOrientation(); }
546  { return dmv_; }
548  bool isEmpty() const
549  { return !lo_.get() && !dmv_.getMultiVector().get(); }
550  private:
551  Teuchos::RefCountPtr< Stokhos::EpetraOperatorOrthogPoly > lo_;
553  };
554 
559  public:
560 
565  const mp_multivector_t &mv
566  ,const EDerivativeMultiVectorOrientation orientation = DERIV_MV_BY_COL
567  ,const Teuchos::Array<int> &paramIndexes = Teuchos::Array<int>()
568  ) : mv_(mv), orientation_(orientation), paramIndexes_(paramIndexes) {}
571  { orientation_ = orientation; };
573  mp_multivector_t getMultiVector() const
574  { return mv_; }
577  { return orientation_; }
579  const Teuchos::Array<int>& getParamIndexes() const
580  { return paramIndexes_; }
581  private:
582  mp_multivector_t mv_;
584  Teuchos::Array<int> paramIndexes_;
585  };
586 
590  class MPDerivative {
591  public:
592 
596  MPDerivative( const mp_operator_t &lo )
597  : lo_(lo) {}
600  const mp_multivector_t &mv
601  ,const EDerivativeMultiVectorOrientation orientation = DERIV_MV_BY_COL
602  ) : dmv_(mv,orientation) {}
605  : dmv_(dmv) {}
607  mp_operator_t getLinearOp() const
608  { return lo_; }
610  mp_multivector_t getMultiVector() const
611  { return dmv_.getMultiVector(); }
614  { return dmv_.getOrientation(); }
617  { return dmv_; }
619  bool isEmpty() const
620  { return !lo_.get() && !dmv_.getMultiVector().get(); }
621  private:
622  mp_operator_t lo_;
624  };
625 
628  OUT_ARG_f
629  ,OUT_ARG_W
630  ,OUT_ARG_f_poly
631  ,OUT_ARG_f_sg
632  ,OUT_ARG_W_sg
633  ,OUT_ARG_f_mp
634  ,OUT_ARG_W_mp
635  ,OUT_ARG_WPrec
636  };
637  static const int NUM_E_OUT_ARGS_MEMBERS=9;
638 
641  OUT_ARG_DfDp
642  };
643 
646  OUT_ARG_DgDx_dot
647  };
648 
651  OUT_ARG_DgDx
652  };
653 
656  OUT_ARG_DgDp
657  };
658 
661  OUT_ARG_DfDp_sg
662  };
663 
666  OUT_ARG_g_sg
667  };
668 
671  OUT_ARG_DgDx_dot_sg
672  };
673 
676  OUT_ARG_DgDx_sg
677  };
678 
681  OUT_ARG_DgDp_sg
682  };
683 
686  OUT_ARG_DfDp_mp
687  };
688 
691  OUT_ARG_g_mp
692  };
693 
696  OUT_ARG_DgDx_dot_mp
697  };
698 
701  OUT_ARG_DgDx_mp
702  };
703 
706  OUT_ARG_DgDp_mp
707  };
708 
710  class OutArgs {
711  public:
712 
714  typedef Teuchos::RefCountPtr<Stokhos::EpetraVectorOrthogPoly> sg_vector_t;
715 
717  typedef Teuchos::RefCountPtr<Stokhos::EpetraOperatorOrthogPoly > sg_operator_t;
718 
720  OutArgs();
722  std::string modelEvalDescription() const;
724  int Np() const;
726  int Ng() const;
728  bool supports(EOutArgsMembers arg) const;
730  const DerivativeSupport& supports(EOutArgsDfDp arg, int l) const;
732  const DerivativeSupport& supports(EOutArgsDgDx_dot arg, int j) const;
734  const DerivativeSupport& supports(EOutArgsDgDx arg, int j) const;
736  const DerivativeSupport& supports(EOutArgsDgDp arg, int j, int l) const;
738  bool supports(EOutArgs_g_sg arg, int j) const;
740  const DerivativeSupport& supports(EOutArgsDfDp_sg arg, int l) const;
742  const DerivativeSupport& supports(EOutArgsDgDx_dot_sg arg, int j) const;
744  const DerivativeSupport& supports(EOutArgsDgDx_sg arg, int j) const;
746  const DerivativeSupport& supports(EOutArgsDgDp_sg arg, int j, int l) const;
748  const DerivativeSupport& supports(EOutArgsDfDp_mp arg, int l) const;
750  bool supports(EOutArgs_g_mp arg, int j) const;
752  const DerivativeSupport& supports(EOutArgsDgDx_dot_mp arg, int j) const;
754  const DerivativeSupport& supports(EOutArgsDgDx_mp arg, int j) const;
756  const DerivativeSupport& supports(EOutArgsDgDp_mp arg, int j, int l) const;
758  void set_f( const Evaluation<Epetra_Vector> &f );
760  Evaluation<Epetra_Vector> get_f() const;
762  void set_f_sg( const sg_vector_t& f_sg );
764  sg_vector_t get_f_sg() const;
766  void set_f_mp( const mp_vector_t& f_sg );
768  mp_vector_t get_f_mp() const;
770  void set_g( int j, const Evaluation<Epetra_Vector> &g_j );
772  Evaluation<Epetra_Vector> get_g(int j) const;
775  void set_g_sg( int j, const sg_vector_t &g_sg_j );
778  sg_vector_t get_g_sg(int j) const;
781  void set_g_mp( int j, const mp_vector_t &g_mp_j );
784  mp_vector_t get_g_mp(int j) const;
786  void set_W( const Teuchos::RefCountPtr<Epetra_Operator> &W );
787  void set_WPrec( const Teuchos::RefCountPtr<Epetra_Operator> &WPrec );
789  Teuchos::RefCountPtr<Epetra_Operator> get_W() const;
790  Teuchos::RefCountPtr<Epetra_Operator> get_WPrec() const;
792  DerivativeProperties get_W_properties() const;
793  DerivativeProperties get_WPrec_properties() const;
795  void set_W_sg( const sg_operator_t& W_sg );
797  sg_operator_t get_W_sg() const;
799  void set_W_mp( const mp_operator_t& W_sg );
801  mp_operator_t get_W_mp() const;
803  void set_DfDp(int l, const Derivative &DfDp_l);
805  Derivative get_DfDp(int l) const;
807  DerivativeProperties get_DfDp_properties(int l) const;
809  void set_DfDp_sg(int l, const SGDerivative &DfDp_sg_l);
811  SGDerivative get_DfDp_sg(int l) const;
813  DerivativeProperties get_DfDp_sg_properties(int l) const;
815  void set_DfDp_mp(int l, const MPDerivative &DfDp_mp_l);
817  MPDerivative get_DfDp_mp(int l) const;
819  DerivativeProperties get_DfDp_mp_properties(int l) const;
821  void set_DgDx_dot(int j, const Derivative &DgDx_dot_j);
823  Derivative get_DgDx_dot(int j) const;
825  DerivativeProperties get_DgDx_dot_properties(int j) const;
827  void set_DgDx_dot_sg(int j, const SGDerivative &DgDx_dot_j);
829  SGDerivative get_DgDx_dot_sg(int j) const;
831  DerivativeProperties get_DgDx_dot_sg_properties(int j) const;
833  void set_DgDx_dot_mp(int j, const MPDerivative &DgDx_dot_j);
835  MPDerivative get_DgDx_dot_mp(int j) const;
837  DerivativeProperties get_DgDx_dot_mp_properties(int j) const;
839  void set_DgDx(int j, const Derivative &DgDx_j);
841  Derivative get_DgDx(int j) const;
843  DerivativeProperties get_DgDx_properties(int j) const;
845  void set_DgDx_sg(int j, const SGDerivative &DgDx_j);
847  SGDerivative get_DgDx_sg(int j) const;
849  DerivativeProperties get_DgDx_sg_properties(int j) const;
851  void set_DgDx_mp(int j, const MPDerivative &DgDx_j);
853  MPDerivative get_DgDx_mp(int j) const;
855  DerivativeProperties get_DgDx_mp_properties(int j) const;
857  void set_DgDp( int j, int l, const Derivative &DgDp_j_l );
859  Derivative get_DgDp(int j, int l) const;
861  DerivativeProperties get_DgDp_properties(int j, int l) const;
863  void set_DgDp_sg( int j, int l, const SGDerivative &DgDp_sg_j_l );
865  SGDerivative get_DgDp_sg(int j, int l) const;
867  DerivativeProperties get_DgDp_sg_properties(int j, int l) const;
869  void set_DgDp_mp( int j, int l, const MPDerivative &DgDp_mp_j_l );
871  MPDerivative get_DgDp_mp(int j, int l) const;
873  DerivativeProperties get_DgDp_mp_properties(int j, int l) const;
874 
876  void set_f_poly( const Teuchos::RefCountPtr<Teuchos::Polynomial<Epetra_Vector> > &f_poly );
878  Teuchos::RefCountPtr<Teuchos::Polynomial<Epetra_Vector> > get_f_poly() const;
879 
880 
882  bool funcOrDerivesAreSet(EOutArgsMembers arg) const;
883 
889  void setFailed() const;
895  bool isFailed() const;
896 
897  protected:
899  void _setModelEvalDescription( const std::string &modelEvalDescription );
901  void _set_Np_Ng(int Np, int Ng);
903  void _setSupports( EOutArgsMembers arg, bool supports );
905  void _setSupports( EOutArgsDfDp arg, int l, const DerivativeSupport& );
907  void _setSupports( EOutArgsDgDx_dot arg, int j, const DerivativeSupport& );
909  void _setSupports( EOutArgsDgDx arg, int j, const DerivativeSupport& );
911  void _setSupports( EOutArgsDgDp arg, int j, int l, const DerivativeSupport& );
913  void _setSupports( EOutArgs_g_sg arg, int j, bool supports );
915  void _setSupports( EOutArgsDfDp_sg arg, int l, const DerivativeSupport& );
917  void _setSupports( EOutArgsDgDx_dot_sg arg, int j, const DerivativeSupport& );
919  void _setSupports( EOutArgsDgDx_sg arg, int j, const DerivativeSupport& );
921  void _setSupports( EOutArgsDgDp_sg arg, int j, int l, const DerivativeSupport& );
922 
924  void _setSupports( EOutArgs_g_mp arg, int j, bool supports );
926  void _setSupports( EOutArgsDfDp_mp arg, int l, const DerivativeSupport& );
928  void _setSupports( EOutArgsDgDx_dot_mp arg, int j, const DerivativeSupport& );
930  void _setSupports( EOutArgsDgDx_mp arg, int j, const DerivativeSupport& );
932  void _setSupports( EOutArgsDgDp_mp arg, int j, int l, const DerivativeSupport& );
934  void _set_W_properties( const DerivativeProperties &W_properties );
935  void _set_WPrec_properties( const DerivativeProperties &WPrec_properties );
937  void _set_DfDp_properties( int l, const DerivativeProperties &properties );
939  void _set_DgDx_dot_properties( int j, const DerivativeProperties &properties );
941  void _set_DgDx_properties( int j, const DerivativeProperties &properties );
943  void _set_DgDp_properties( int j, int l, const DerivativeProperties &properties );
945  void _set_DfDp_sg_properties( int l, const DerivativeProperties &properties );
947  void _set_DgDx_dot_sg_properties( int j, const DerivativeProperties &properties );
949  void _set_DgDx_sg_properties( int j, const DerivativeProperties &properties );
951  void _set_DgDp_sg_properties( int j, int l, const DerivativeProperties &properties );
952 
954  void _set_DfDp_mp_properties( int l, const DerivativeProperties &properties );
956  void _set_DgDx_dot_mp_properties( int j, const DerivativeProperties &properties );
958  void _set_DgDx_mp_properties( int j, const DerivativeProperties &properties );
960  void _set_DgDp_mp_properties( int j, int l, const DerivativeProperties &properties );
961  private:
962  // types
963  typedef Teuchos::Array<Evaluation<Epetra_Vector> > g_t;
964  typedef Teuchos::Array<sg_vector_t > g_sg_t;
965  typedef Teuchos::Array<mp_vector_t > g_mp_t;
966  typedef Teuchos::Array<Derivative> deriv_t;
967  typedef Teuchos::Array<SGDerivative> sg_deriv_t;
968  typedef Teuchos::Array<MPDerivative> mp_deriv_t;
969  typedef Teuchos::Array<DerivativeProperties> deriv_properties_t;
970  typedef Teuchos::Array<DerivativeSupport> supports_t;
971  typedef Teuchos::Array<bool> supports_g_sg_t;
972  // data
973  std::string modelEvalDescription_;
974  mutable bool isFailed_;
975  bool supports_[NUM_E_OUT_ARGS_MEMBERS];
976  supports_t supports_DfDp_; // Np
977  supports_t supports_DgDx_dot_; // Ng
978  supports_t supports_DgDx_; // Ng
979  supports_t supports_DgDp_; // Ng x Np
980  supports_g_sg_t supports_g_sg_; // Ng
981  supports_t supports_DfDp_sg_; // Np
982  supports_t supports_DgDx_dot_sg_; // Ng
983  supports_t supports_DgDx_sg_; // Ng
984  supports_t supports_DgDp_sg_; // Ng x Np
985  supports_g_sg_t supports_g_mp_; // Ng
986  supports_t supports_DfDp_mp_; // Np_mp
987  supports_t supports_DgDx_dot_mp_; // Ng_mp
988  supports_t supports_DgDx_mp_; // Ng_mp
989  supports_t supports_DgDp_mp_; // Ng_mp x Np_mp
991  g_t g_;
992  g_sg_t g_sg_;
993  g_mp_t g_mp_;
994  Teuchos::RefCountPtr<Epetra_Operator> W_;
995  Teuchos::RefCountPtr<Epetra_Operator> WPrec_;
996  DerivativeProperties W_properties_;
997  DerivativeProperties WPrec_properties_;
998  deriv_t DfDp_; // Np
999  deriv_properties_t DfDp_properties_; // Np
1000  deriv_t DgDx_dot_; // Ng
1001  deriv_t DgDx_; // Ng
1002  deriv_properties_t DgDx_dot_properties_; // Ng
1003  deriv_properties_t DgDx_properties_; // Ng
1004  deriv_t DgDp_; // Ng x Np
1005  deriv_properties_t DgDp_properties_; // Ng x Np
1006  Teuchos::RefCountPtr<Teuchos::Polynomial<Epetra_Vector> > f_poly_;
1007  sg_vector_t f_sg_;
1008  sg_operator_t W_sg_;
1009  sg_deriv_t DfDp_sg_; // Np
1010  deriv_properties_t DfDp_sg_properties_; // Np
1011  sg_deriv_t DgDx_dot_sg_; // Ng
1012  sg_deriv_t DgDx_sg_; // Ng
1013  deriv_properties_t DgDx_dot_sg_properties_; // Ng
1014  deriv_properties_t DgDx_sg_properties_; // Ng
1015  sg_deriv_t DgDp_sg_; // Ng x Np
1016  deriv_properties_t DgDp_sg_properties_; // Ng x Np
1017  mp_vector_t f_mp_;
1018  mp_operator_t W_mp_;
1019  mp_deriv_t DfDp_mp_; // Np
1020  deriv_properties_t DfDp_mp_properties_; // Np
1021  mp_deriv_t DgDx_dot_mp_; // Ng
1022  mp_deriv_t DgDx_mp_; // Ng
1023  deriv_properties_t DgDx_dot_mp_properties_; // Ng
1024  deriv_properties_t DgDx_mp_properties_; // Ng
1025  mp_deriv_t DgDp_mp_; // Ng x Np
1026  deriv_properties_t DgDp_mp_properties_; // Ng x Np
1027  // functions
1028  void assert_supports(EOutArgsMembers arg) const;
1029  void assert_supports(EOutArgsDfDp arg, int l) const;
1030  void assert_supports(EOutArgsDgDx_dot arg, int j) const;
1031  void assert_supports(EOutArgsDgDx arg, int j) const;
1032  void assert_supports(EOutArgsDgDp arg, int j, int l) const;
1033  void assert_supports(EOutArgs_g_sg arg, int j) const;
1034  void assert_supports(EOutArgsDfDp_sg arg, int l) const;
1035  void assert_supports(EOutArgsDgDx_dot_sg arg, int j) const;
1036  void assert_supports(EOutArgsDgDx_sg arg, int j) const;
1037  void assert_supports(EOutArgsDgDp_sg arg, int j, int l) const;
1038  void assert_supports(EOutArgs_g_mp arg, int j) const;
1039  void assert_supports(EOutArgsDfDp_mp arg, int l) const;
1040  void assert_supports(EOutArgsDgDx_dot_mp arg, int j) const;
1041  void assert_supports(EOutArgsDgDx_mp arg, int j) const;
1042  void assert_supports(EOutArgsDgDp_mp arg, int j, int l) const;
1043  void assert_l(int l) const;
1044  void assert_j(int j) const;
1045  };
1046 
1048 
1051 
1053  virtual ~ModelEvaluator();
1054 
1056 
1059 
1061  virtual Teuchos::RefCountPtr<const Epetra_Map> get_x_map() const = 0;
1062 
1064  virtual Teuchos::RefCountPtr<const Epetra_Map> get_f_map() const = 0;
1065 
1067  virtual Teuchos::RefCountPtr<const Epetra_Map> get_p_map(int l) const;
1068 
1083  virtual Teuchos::RefCountPtr<const Teuchos::Array<std::string> > get_p_names(int l) const;
1084 
1086  virtual Teuchos::RefCountPtr<const Epetra_Map> get_g_map(int j) const;
1087 
1089 
1092 
1094  virtual Teuchos::RefCountPtr<const Epetra_Vector> get_x_init() const;
1095 
1097  virtual Teuchos::RefCountPtr<const Epetra_Vector> get_x_dot_init() const;
1098 
1100  virtual Teuchos::RefCountPtr<const Epetra_Vector> get_p_init(int l) const;
1101 
1103  virtual double get_t_init() const;
1104 
1106 
1109 
1114  virtual double getInfBound() const;
1115 
1117  virtual Teuchos::RefCountPtr<const Epetra_Vector> get_x_lower_bounds() const;
1118 
1120  virtual Teuchos::RefCountPtr<const Epetra_Vector> get_x_upper_bounds() const;
1121 
1123  virtual Teuchos::RefCountPtr<const Epetra_Vector> get_p_lower_bounds(int l) const;
1124 
1126  virtual Teuchos::RefCountPtr<const Epetra_Vector> get_p_upper_bounds(int l) const;
1127 
1129  virtual double get_t_lower_bound() const;
1130 
1132  virtual double get_t_upper_bound() const;
1133 
1135 
1138 
1145  virtual Teuchos::RefCountPtr<Epetra_Operator> create_W() const;
1146  virtual Teuchos::RefCountPtr<EpetraExt::ModelEvaluator::Preconditioner> create_WPrec() const;
1147 
1149  virtual Teuchos::RefCountPtr<Epetra_Operator> create_DfDp_op(int l) const;
1150 
1152  virtual Teuchos::RefCountPtr<Epetra_Operator> create_DgDx_dot_op(int j) const;
1153 
1155  virtual Teuchos::RefCountPtr<Epetra_Operator> create_DgDx_op(int j) const;
1156 
1158  virtual Teuchos::RefCountPtr<Epetra_Operator> create_DgDp_op( int j, int l ) const;
1159 
1161 
1164 
1166  virtual InArgs createInArgs() const = 0;
1167 
1169  virtual OutArgs createOutArgs() const = 0;
1170 
1172  virtual void evalModel( const InArgs& inArgs, const OutArgs& outArgs ) const = 0;
1173 
1174 #ifdef HAVE_PYTRILINOS
1175 
1176  friend InArgs convertInArgsFromPython(PyObject * source);
1177 
1179  friend OutArgs convertOutArgsFromPython(PyObject * source);
1180 #endif
1181 
1182 
1183 protected:
1184 
1187 
1189  class InArgsSetup : public InArgs {
1190  public:
1192  void setModelEvalDescription( const std::string &modelEvalDescription );
1194  void set_Np(int Np);
1196  void setSupports( EInArgsMembers arg, bool supports = true );
1198  void setSupports( EInArgs_p_sg arg, int l, bool supports );
1200  void setSupports( EInArgs_p_mp arg, int l, bool supports );
1201  };
1202 
1204  class OutArgsSetup : public OutArgs {
1205  public:
1207  void setModelEvalDescription( const std::string &modelEvalDescription );
1209  void set_Np_Ng(int Np, int Ng);
1211  void setSupports( EOutArgsMembers arg, bool supports = true );
1213  void setSupports(EOutArgsDfDp arg, int l, const DerivativeSupport& );
1215  void setSupports(EOutArgsDgDx_dot arg, int j, const DerivativeSupport& );
1217  void setSupports(EOutArgsDgDx arg, int j, const DerivativeSupport& );
1219  void setSupports(EOutArgsDgDp arg, int j, int l, const DerivativeSupport& );
1221  void setSupports( EOutArgs_g_sg arg, int j, bool supports );
1223  void setSupports(EOutArgsDfDp_sg arg, int l, const DerivativeSupport& );
1225  void setSupports(EOutArgsDgDx_dot_sg arg, int j, const DerivativeSupport& );
1227  void setSupports(EOutArgsDgDx_sg arg, int j, const DerivativeSupport& );
1229  void setSupports(EOutArgsDgDp_sg arg, int j, int l, const DerivativeSupport& );
1231  void setSupports( EOutArgs_g_mp arg, int j, bool supports );
1233  void setSupports(EOutArgsDfDp_mp arg, int l, const DerivativeSupport& );
1235  void setSupports(EOutArgsDgDx_dot_mp arg, int j, const DerivativeSupport& );
1237  void setSupports(EOutArgsDgDx_mp arg, int j, const DerivativeSupport& );
1239  void setSupports(EOutArgsDgDp_mp arg, int j, int l, const DerivativeSupport& );
1241  void set_W_properties( const DerivativeProperties &properties );
1242  void set_WPrec_properties( const DerivativeProperties &properties );
1244  void set_DfDp_properties( int l, const DerivativeProperties &properties );
1246  void set_DgDx_dot_properties( int j, const DerivativeProperties &properties );
1248  void set_DgDx_properties( int j, const DerivativeProperties &properties );
1250  void set_DgDp_properties( int j, int l, const DerivativeProperties &properties );
1252  void set_DfDp_sg_properties( int l, const DerivativeProperties &properties );
1254  void set_DgDx_dot_sg_properties( int j, const DerivativeProperties &properties );
1256  void set_DgDx_sg_properties( int j, const DerivativeProperties &properties );
1258  void set_DgDp_sg_properties( int j, int l, const DerivativeProperties &properties );
1260  void set_DfDp_mp_properties( int l, const DerivativeProperties &properties );
1262  void set_DgDx_dot_mp_properties( int j, const DerivativeProperties &properties );
1264  void set_DgDx_mp_properties( int j, const DerivativeProperties &properties );
1266  void set_DgDp_mp_properties( int j, int l, const DerivativeProperties &properties );
1267  };
1268 
1270 
1271 };
1272 
1273 // ////////////////////////////
1274 // Helper functions
1275 
1278 
1280 std::string toString( ModelEvaluator::EInArgsMembers inArg );
1281 
1283 std::string toString( ModelEvaluator::EOutArgsMembers outArg );
1284 
1286 Teuchos::RefCountPtr<Epetra_Operator>
1287 getLinearOp(
1288  const std::string &modelEvalDescription,
1289  const ModelEvaluator::Derivative &deriv,
1290  const std::string &derivName
1291  );
1292 
1294 Teuchos::RefCountPtr<Epetra_MultiVector>
1296  const std::string &modelEvalDescription,
1297  const ModelEvaluator::Derivative &deriv,
1298  const std::string &derivName,
1300  );
1301 
1303 Teuchos::RefCountPtr<Epetra_Operator>
1304 get_DfDp_op(
1305  const int l
1306  ,const ModelEvaluator::OutArgs &outArgs
1307  );
1308 
1310 Teuchos::RefCountPtr<Epetra_MultiVector>
1311 get_DfDp_mv(
1312  const int l
1313  ,const ModelEvaluator::OutArgs &outArgs
1314  );
1315 
1317 Teuchos::RefCountPtr<Epetra_MultiVector>
1319  const int j
1320  ,const ModelEvaluator::OutArgs &outArgs
1322  );
1323 
1325 Teuchos::RefCountPtr<Epetra_MultiVector>
1326 get_DgDx_mv(
1327  const int j
1328  ,const ModelEvaluator::OutArgs &outArgs
1330  );
1331 
1333 Teuchos::RefCountPtr<Epetra_MultiVector>
1334 get_DgDp_mv(
1335  const int j
1336  ,const int l
1337  ,const ModelEvaluator::OutArgs &outArgs
1339  );
1340 
1341 // ///////////////////////////
1342 // Inline Functions
1343 
1344 //
1345 // ModelEvaluator::InArgs
1346 //
1347 
1348 inline
1349 std::string ModelEvaluator::InArgs::modelEvalDescription() const
1350 { return modelEvalDescription_; }
1351 
1352 inline
1353 int ModelEvaluator::InArgs::Np() const
1354 { return p_.size(); }
1355 
1356 inline
1357 void ModelEvaluator::InArgs::set_x_dot( const Teuchos::RefCountPtr<const Epetra_Vector> &x_dot )
1358 { assert_supports(IN_ARG_x_dot); x_dot_ = x_dot; }
1359 
1360 inline
1361 Teuchos::RefCountPtr<const Epetra_Vector> ModelEvaluator::InArgs::get_x_dot() const
1362 { assert_supports(IN_ARG_x_dot); return x_dot_; }
1363 
1364 inline
1365 void ModelEvaluator::InArgs::set_x( const Teuchos::RefCountPtr<const Epetra_Vector> &x )
1366 { assert_supports(IN_ARG_x); x_ = x; }
1367 
1368 inline
1369 Teuchos::RefCountPtr<const Epetra_Vector> ModelEvaluator::InArgs::get_x() const
1370 { assert_supports(IN_ARG_x); return x_; }
1371 
1372 inline
1373 void ModelEvaluator::InArgs::set_x_dot_poly( const Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > &x_dot_poly )
1374 { assert_supports(IN_ARG_x_dot_poly); x_dot_poly_ = x_dot_poly; }
1375 
1376 inline
1377 Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> >
1378 ModelEvaluator::InArgs::get_x_dot_poly() const
1379 { assert_supports(IN_ARG_x_dot_poly); return x_dot_poly_; }
1380 
1381 inline
1382 void ModelEvaluator::InArgs::set_x_poly( const Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> > &x_poly )
1383 { assert_supports(IN_ARG_x_poly); x_poly_ = x_poly; }
1384 
1385 inline
1386 Teuchos::RefCountPtr<const Teuchos::Polynomial<Epetra_Vector> >
1387 ModelEvaluator::InArgs::get_x_poly() const
1388 { assert_supports(IN_ARG_x_poly); return x_poly_; }
1389 
1390 inline
1391 void ModelEvaluator::InArgs::set_x_dot_sg( const ModelEvaluator::InArgs::sg_const_vector_t &x_dot_sg )
1392 { assert_supports(IN_ARG_x_dot_sg); x_dot_sg_ = x_dot_sg; }
1393 
1394 inline
1396 ModelEvaluator::InArgs::get_x_dot_sg() const
1397 { assert_supports(IN_ARG_x_dot_sg); return x_dot_sg_; }
1398 
1399 inline
1400 void ModelEvaluator::InArgs::set_x_dot_mp( const ModelEvaluator::mp_const_vector_t &x_dot_mp )
1401 { assert_supports(IN_ARG_x_dot_mp); x_dot_mp_ = x_dot_mp; }
1402 
1403 inline
1405 ModelEvaluator::InArgs::get_x_dot_mp() const
1406 { assert_supports(IN_ARG_x_dot_mp); return x_dot_mp_; }
1407 
1408 inline
1409 void ModelEvaluator::InArgs::set_x_sg( const ModelEvaluator::InArgs::sg_const_vector_t &x_sg )
1410 { assert_supports(IN_ARG_x_sg); x_sg_ = x_sg; }
1411 
1412 inline
1414 ModelEvaluator::InArgs::get_x_sg() const
1415 { assert_supports(IN_ARG_x_sg); return x_sg_; }
1416 
1417 inline
1418 void ModelEvaluator::InArgs::set_x_mp( const ModelEvaluator::mp_const_vector_t &x_mp )
1419 { assert_supports(IN_ARG_x_mp); x_mp_ = x_mp; }
1420 
1421 inline
1423 ModelEvaluator::InArgs::get_x_mp() const
1424 { assert_supports(IN_ARG_x_mp); return x_mp_; }
1425 
1426 inline
1427 void ModelEvaluator::InArgs::set_p( int l, const Teuchos::RefCountPtr<const Epetra_Vector> &p_l )
1428 { assert_l(l); p_[l] = p_l; }
1429 
1430 inline
1431 Teuchos::RefCountPtr<const Epetra_Vector> ModelEvaluator::InArgs::get_p(int l) const
1432 { assert_l(l); return p_[l]; }
1433 
1434 inline
1435 void ModelEvaluator::InArgs::set_p_sg( int l,
1437 { assert_supports(IN_ARG_p_sg, l); p_sg_[l] = p_sg_l; }
1438 
1439 inline
1441 ModelEvaluator::InArgs::get_p_sg(int l) const
1442 { assert_supports(IN_ARG_p_sg, l); return p_sg_[l]; }
1443 
1444 inline
1445 void ModelEvaluator::InArgs::set_p_mp( int l,
1446  const ModelEvaluator::mp_const_vector_t &p_mp_l )
1447 { assert_supports(IN_ARG_p_mp, l); p_mp_[l] = p_mp_l; }
1448 
1449 inline
1451 ModelEvaluator::InArgs::get_p_mp(int l) const
1452 { assert_supports(IN_ARG_p_mp, l); return p_mp_[l]; }
1453 
1454 inline
1455 void ModelEvaluator::InArgs::set_t( double t )
1456 { assert_supports(IN_ARG_t); t_ = t; }
1457 
1458 inline
1459 double ModelEvaluator::InArgs::get_t() const
1460 { assert_supports(IN_ARG_t); return t_; }
1461 
1462 inline
1463 void ModelEvaluator::InArgs::set_alpha( double alpha )
1464 { assert_supports(IN_ARG_alpha); alpha_ = alpha; }
1465 
1466 inline
1467 double ModelEvaluator::InArgs::get_alpha() const
1468 { assert_supports(IN_ARG_alpha); return alpha_; }
1469 
1470 inline
1471 void ModelEvaluator::InArgs::set_beta( double beta )
1472 { assert_supports(IN_ARG_beta); beta_ = beta; }
1473 
1474 inline
1475 double ModelEvaluator::InArgs::get_beta() const
1476 { assert_supports(IN_ARG_beta); return beta_; }
1477 
1478 inline
1479 void ModelEvaluator::InArgs::set_sg_basis( const Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> >& basis )
1480 { assert_supports(IN_ARG_sg_basis); sg_basis_ = basis; }
1481 
1482 inline
1483 Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> >
1484 ModelEvaluator::InArgs::get_sg_basis() const
1485 { assert_supports(IN_ARG_sg_basis); return sg_basis_; }
1486 
1487 inline
1488 void ModelEvaluator::InArgs::set_sg_quadrature( const Teuchos::RCP<const Stokhos::Quadrature<int,double> >& quad )
1489 { assert_supports(IN_ARG_sg_quadrature); sg_quad_ = quad; }
1490 
1491 inline
1492 Teuchos::RCP<const Stokhos::Quadrature<int,double> >
1493 ModelEvaluator::InArgs::get_sg_quadrature() const
1494 { assert_supports(IN_ARG_sg_quadrature); return sg_quad_; }
1495 
1496 inline
1497 void ModelEvaluator::InArgs::set_sg_expansion( const Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > >& exp )
1498 { assert_supports(IN_ARG_sg_expansion); sg_exp_ = exp; }
1499 
1500 inline
1501 Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > >
1502 ModelEvaluator::InArgs::get_sg_expansion() const
1503 { assert_supports(IN_ARG_sg_expansion); return sg_exp_; }
1504 
1505 inline
1506 void ModelEvaluator::InArgs::_setModelEvalDescription( const std::string &new_modelEvalDescription )
1507 {
1508  modelEvalDescription_ = new_modelEvalDescription;
1509 }
1510 
1511 inline
1512 void ModelEvaluator::InArgs::_set_Np(int new_Np)
1513 {
1514  p_.resize(new_Np);
1515  p_sg_.resize(new_Np);
1516  p_mp_.resize(new_Np);
1517  supports_p_sg_.resize(new_Np);
1518  supports_p_mp_.resize(new_Np);
1519 }
1520 
1521 //
1522 // ModelEvaluator::OutArgs
1523 //
1524 
1525 inline
1526 std::string ModelEvaluator::OutArgs::modelEvalDescription() const
1527 { return modelEvalDescription_; }
1528 
1529 inline
1530 int ModelEvaluator::OutArgs::Np() const
1531 {
1532  return DfDp_.size();
1533 }
1534 
1535 inline
1536 int ModelEvaluator::OutArgs::Ng() const
1537 {
1538  return g_.size();
1539 }
1540 
1541 inline
1542 void ModelEvaluator::OutArgs::set_f( const Evaluation<Epetra_Vector> &f ) { f_ = f; }
1543 
1544 inline
1546 ModelEvaluator::OutArgs::get_f() const { return f_; }
1547 
1548 inline
1549 void ModelEvaluator::OutArgs::set_g( int j, const Evaluation<Epetra_Vector> &g_j )
1550 {
1551  assert_j(j);
1552  g_[j] = g_j;
1553 }
1554 
1555 inline
1557 ModelEvaluator::OutArgs::get_g(int j) const
1558 {
1559  assert_j(j);
1560  return g_[j];
1561 }
1562 
1563 inline
1564 void ModelEvaluator::OutArgs::set_g_sg( int j, const sg_vector_t &g_sg_j )
1565 {
1566  assert_supports(OUT_ARG_g_sg, j);
1567  g_sg_[j] = g_sg_j;
1568 }
1569 
1570 inline
1572 ModelEvaluator::OutArgs::get_g_sg(int j) const
1573 {
1574  assert_supports(OUT_ARG_g_sg, j);
1575  return g_sg_[j];
1576 }
1577 
1578 inline
1579 void ModelEvaluator::OutArgs::set_g_mp( int j, const mp_vector_t &g_mp_j )
1580 {
1581  assert_supports(OUT_ARG_g_mp, j);
1582  g_mp_[j] = g_mp_j;
1583 }
1584 
1585 inline
1587 ModelEvaluator::OutArgs::get_g_mp(int j) const
1588 {
1589  assert_supports(OUT_ARG_g_mp, j);
1590  return g_mp_[j];
1591 }
1592 
1593 inline
1594 void ModelEvaluator::OutArgs::set_W( const Teuchos::RefCountPtr<Epetra_Operator> &W ) { W_ = W; }
1595 inline
1596 void ModelEvaluator::OutArgs::set_WPrec( const Teuchos::RefCountPtr<Epetra_Operator> &WPrec ) { WPrec_ = WPrec; }
1597 
1598 inline
1599 Teuchos::RefCountPtr<Epetra_Operator> ModelEvaluator::OutArgs::get_W() const { return W_; }
1600 inline
1601 Teuchos::RefCountPtr<Epetra_Operator> ModelEvaluator::OutArgs::get_WPrec() const { return WPrec_; }
1602 
1603 inline
1604 ModelEvaluator::DerivativeProperties ModelEvaluator::OutArgs::get_W_properties() const
1605 { return W_properties_; }
1606 inline
1607 ModelEvaluator::DerivativeProperties ModelEvaluator::OutArgs::get_WPrec_properties() const
1608 { return WPrec_properties_; }
1609 
1610 inline
1611 void ModelEvaluator::OutArgs::set_DfDp( int l, const Derivative &DfDp_l )
1612 {
1613  assert_supports(OUT_ARG_DfDp,l);
1614  DfDp_[l] = DfDp_l;
1615 }
1616 
1617 inline
1619 ModelEvaluator::OutArgs::get_DfDp(int l) const
1620 {
1621  assert_supports(OUT_ARG_DfDp,l);
1622  return DfDp_[l];
1623 }
1624 
1625 inline
1627 ModelEvaluator::OutArgs::get_DfDp_properties(int l) const
1628 {
1629  assert_supports(OUT_ARG_DfDp,l);
1630  return DfDp_properties_[l];
1631 }
1632 
1633 inline
1634 void ModelEvaluator::OutArgs::set_DfDp_sg( int l, const SGDerivative &DfDp_sg_l )
1635 {
1636  assert_supports(OUT_ARG_DfDp_sg,l);
1637  DfDp_sg_[l] = DfDp_sg_l;
1638 }
1639 
1640 inline
1642 ModelEvaluator::OutArgs::get_DfDp_sg(int l) const
1643 {
1644  assert_supports(OUT_ARG_DfDp_sg,l);
1645  return DfDp_sg_[l];
1646 }
1647 
1648 inline
1650 ModelEvaluator::OutArgs::get_DfDp_sg_properties(int l) const
1651 {
1652  assert_supports(OUT_ARG_DfDp_sg,l);
1653  return DfDp_sg_properties_[l];
1654 }
1655 
1656 inline
1657 void ModelEvaluator::OutArgs::set_DfDp_mp( int l, const MPDerivative &DfDp_mp_l )
1658 {
1659  assert_supports(OUT_ARG_DfDp_mp,l);
1660  DfDp_mp_[l] = DfDp_mp_l;
1661 }
1662 
1663 inline
1665 ModelEvaluator::OutArgs::get_DfDp_mp(int l) const
1666 {
1667  assert_supports(OUT_ARG_DfDp_mp,l);
1668  return DfDp_mp_[l];
1669 }
1670 
1671 inline
1673 ModelEvaluator::OutArgs::get_DfDp_mp_properties(int l) const
1674 {
1675  assert_supports(OUT_ARG_DfDp_mp,l);
1676  return DfDp_mp_properties_[l];
1677 }
1678 
1679 inline
1680 void ModelEvaluator::OutArgs::set_DgDx_dot( int j, const Derivative &DgDx_dot_j )
1681 {
1682  assert_supports(OUT_ARG_DgDx_dot,j);
1683  DgDx_dot_[j] = DgDx_dot_j;
1684 }
1685 
1686 inline
1688 ModelEvaluator::OutArgs::get_DgDx_dot(int j) const
1689 {
1690  assert_supports(OUT_ARG_DgDx_dot,j);
1691  return DgDx_dot_[j];
1692 }
1693 
1694 inline
1696 ModelEvaluator::OutArgs::get_DgDx_dot_properties(int j) const
1697 {
1698  assert_supports(OUT_ARG_DgDx_dot,j);
1699  return DgDx_dot_properties_[j];
1700 }
1701 
1702 inline
1703 void ModelEvaluator::OutArgs::set_DgDx_dot_sg( int j, const SGDerivative &DgDx_dot_sg_j )
1704 {
1705  assert_supports(OUT_ARG_DgDx_dot_sg,j);
1706  DgDx_dot_sg_[j] = DgDx_dot_sg_j;
1707 }
1708 
1709 inline
1711 ModelEvaluator::OutArgs::get_DgDx_dot_sg(int j) const
1712 {
1713  assert_supports(OUT_ARG_DgDx_dot_sg,j);
1714  return DgDx_dot_sg_[j];
1715 }
1716 
1717 inline
1719 ModelEvaluator::OutArgs::get_DgDx_dot_sg_properties(int j) const
1720 {
1721  assert_supports(OUT_ARG_DgDx_dot_sg,j);
1722  return DgDx_dot_sg_properties_[j];
1723 }
1724 
1725 inline
1726 void ModelEvaluator::OutArgs::set_DgDx_dot_mp( int j, const MPDerivative &DgDx_dot_mp_j )
1727 {
1728  assert_supports(OUT_ARG_DgDx_dot_mp,j);
1729  DgDx_dot_mp_[j] = DgDx_dot_mp_j;
1730 }
1731 
1732 inline
1734 ModelEvaluator::OutArgs::get_DgDx_dot_mp(int j) const
1735 {
1736  assert_supports(OUT_ARG_DgDx_dot_mp,j);
1737  return DgDx_dot_mp_[j];
1738 }
1739 
1740 inline
1742 ModelEvaluator::OutArgs::get_DgDx_dot_mp_properties(int j) const
1743 {
1744  assert_supports(OUT_ARG_DgDx_dot_mp,j);
1745  return DgDx_dot_mp_properties_[j];
1746 }
1747 
1748 inline
1749 void ModelEvaluator::OutArgs::set_DgDx( int j, const Derivative &DgDx_j )
1750 {
1751  assert_supports(OUT_ARG_DgDx,j);
1752  DgDx_[j] = DgDx_j;
1753 }
1754 
1755 inline
1757 ModelEvaluator::OutArgs::get_DgDx(int j) const
1758 {
1759  assert_supports(OUT_ARG_DgDx,j);
1760  return DgDx_[j];
1761 }
1762 
1763 inline
1765 ModelEvaluator::OutArgs::get_DgDx_properties(int j) const
1766 {
1767  assert_supports(OUT_ARG_DgDx,j);
1768  return DgDx_properties_[j];
1769 }
1770 
1771 inline
1772 void ModelEvaluator::OutArgs::set_DgDx_sg( int j, const SGDerivative &DgDx_sg_j )
1773 {
1774  assert_supports(OUT_ARG_DgDx_sg,j);
1775  DgDx_sg_[j] = DgDx_sg_j;
1776 }
1777 
1778 inline
1780 ModelEvaluator::OutArgs::get_DgDx_sg(int j) const
1781 {
1782  assert_supports(OUT_ARG_DgDx_sg,j);
1783  return DgDx_sg_[j];
1784 }
1785 
1786 inline
1788 ModelEvaluator::OutArgs::get_DgDx_sg_properties(int j) const
1789 {
1790  assert_supports(OUT_ARG_DgDx_sg,j);
1791  return DgDx_sg_properties_[j];
1792 }
1793 
1794 inline
1795 void ModelEvaluator::OutArgs::set_DgDx_mp( int j, const MPDerivative &DgDx_mp_j )
1796 {
1797  assert_supports(OUT_ARG_DgDx_mp,j);
1798  DgDx_mp_[j] = DgDx_mp_j;
1799 }
1800 
1801 inline
1803 ModelEvaluator::OutArgs::get_DgDx_mp(int j) const
1804 {
1805  assert_supports(OUT_ARG_DgDx_mp,j);
1806  return DgDx_mp_[j];
1807 }
1808 
1809 inline
1811 ModelEvaluator::OutArgs::get_DgDx_mp_properties(int j) const
1812 {
1813  assert_supports(OUT_ARG_DgDx_mp,j);
1814  return DgDx_mp_properties_[j];
1815 }
1816 
1817 inline
1818 void ModelEvaluator::OutArgs::set_DgDp( int j, int l, const Derivative &DgDp_j_l )
1819 {
1820  assert_supports(OUT_ARG_DgDp,j,l);
1821  DgDp_[ j*Np() + l ] = DgDp_j_l;
1822 }
1823 
1824 inline
1826 ModelEvaluator::OutArgs::get_DgDp(int j, int l) const
1827 {
1828  assert_supports(OUT_ARG_DgDp,j,l);
1829  return DgDp_[ j*Np() + l ];
1830 }
1831 
1832 inline
1834 ModelEvaluator::OutArgs::get_DgDp_properties(int j, int l) const
1835 {
1836  assert_supports(OUT_ARG_DgDp,j,l);
1837  return DgDp_properties_[ j*Np() + l ];
1838 }
1839 
1840 inline
1841 void ModelEvaluator::OutArgs::set_DgDp_sg( int j, int l, const SGDerivative &DgDp_sg_j_l )
1842 {
1843  assert_supports(OUT_ARG_DgDp_sg,j,l);
1844  DgDp_sg_[ j*Np() + l ] = DgDp_sg_j_l;
1845 }
1846 
1847 inline
1849 ModelEvaluator::OutArgs::get_DgDp_sg(int j, int l) const
1850 {
1851  assert_supports(OUT_ARG_DgDp_sg,j,l);
1852  return DgDp_sg_[ j*Np() + l ];
1853 }
1854 
1855 inline
1857 ModelEvaluator::OutArgs::get_DgDp_sg_properties(int j, int l) const
1858 {
1859  assert_supports(OUT_ARG_DgDp_sg,j,l);
1860  return DgDp_sg_properties_[ j*Np() + l ];
1861 }
1862 
1863 inline
1864 void ModelEvaluator::OutArgs::set_DgDp_mp( int j, int l, const MPDerivative &DgDp_mp_j_l )
1865 {
1866  assert_supports(OUT_ARG_DgDp_mp,j,l);
1867  DgDp_mp_[ j*Np() + l ] = DgDp_mp_j_l;
1868 }
1869 
1870 inline
1872 ModelEvaluator::OutArgs::get_DgDp_mp(int j, int l) const
1873 {
1874  assert_supports(OUT_ARG_DgDp_mp,j,l);
1875  return DgDp_mp_[ j*Np() + l ];
1876 }
1877 
1878 inline
1880 ModelEvaluator::OutArgs::get_DgDp_mp_properties(int j, int l) const
1881 {
1882  assert_supports(OUT_ARG_DgDp_mp,j,l);
1883  return DgDp_mp_properties_[ j*Np() + l ];
1884 }
1885 
1886 inline
1887 void ModelEvaluator::OutArgs::set_f_poly( const Teuchos::RefCountPtr<Teuchos::Polynomial<Epetra_Vector> > &f_poly )
1888 { f_poly_ = f_poly; }
1889 
1890 inline
1891 Teuchos::RefCountPtr<Teuchos::Polynomial<Epetra_Vector> >
1892 ModelEvaluator::OutArgs::get_f_poly() const
1893 { return f_poly_; }
1894 
1895 inline
1896 void ModelEvaluator::OutArgs::set_f_sg( const ModelEvaluator::OutArgs::sg_vector_t& f_sg )
1897 { f_sg_ = f_sg; }
1898 
1899 inline
1901 ModelEvaluator::OutArgs::get_f_sg() const
1902 { return f_sg_; }
1903 
1904 inline
1905 void ModelEvaluator::OutArgs::set_W_sg( const ModelEvaluator::OutArgs::sg_operator_t& W_sg ) { W_sg_ = W_sg; }
1906 
1907 inline
1908 ModelEvaluator::OutArgs::sg_operator_t ModelEvaluator::OutArgs::get_W_sg() const { return W_sg_; }
1909 
1910 inline
1911 void ModelEvaluator::OutArgs::set_f_mp( const ModelEvaluator::mp_vector_t& f_mp )
1912 { f_mp_ = f_mp; }
1913 
1914 inline
1916 ModelEvaluator::OutArgs::get_f_mp() const
1917 { return f_mp_; }
1918 
1919 inline
1920 void ModelEvaluator::OutArgs::set_W_mp( const ModelEvaluator::mp_operator_t& W_mp ) { W_mp_ = W_mp; }
1921 
1922 inline
1923 ModelEvaluator::mp_operator_t ModelEvaluator::OutArgs::get_W_mp() const { return W_mp_; }
1924 
1925 //
1926 // ModelEvaluator::InArgsSetup
1927 //
1928 
1929 inline
1930 void ModelEvaluator::InArgsSetup::setModelEvalDescription( const std::string &new_modelEvalDescription )
1931 {
1932  this->_setModelEvalDescription(new_modelEvalDescription);
1933 }
1934 
1935 inline
1936 void ModelEvaluator::InArgsSetup::set_Np(int new_Np)
1937 { this->_set_Np(new_Np); }
1938 
1939 inline
1940 void ModelEvaluator::InArgsSetup::setSupports( EInArgsMembers arg, bool new_supports )
1941 { this->_setSupports(arg,new_supports); }
1942 
1943 inline
1944 void ModelEvaluator::InArgsSetup::setSupports( EInArgs_p_sg arg, int l, bool new_supports )
1945 { this->_setSupports(arg,l,new_supports); }
1946 
1947 inline
1948 void ModelEvaluator::InArgsSetup::setSupports( EInArgs_p_mp arg, int l, bool new_supports )
1949 { this->_setSupports(arg,l,new_supports); }
1950 
1951 //
1952 // ModelEvaluator::OutArgsSetup
1953 //
1954 
1955 inline
1956 void ModelEvaluator::OutArgsSetup::setModelEvalDescription( const std::string &new_modelEvalDescription )
1957 {
1958  this->_setModelEvalDescription(new_modelEvalDescription);
1959 }
1960 
1961 inline
1962 void ModelEvaluator::OutArgsSetup::set_Np_Ng(int new_Np, int new_Ng)
1963 { this->_set_Np_Ng(new_Np,new_Ng); }
1964 
1965 inline
1966 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsMembers arg, bool new_supports )
1967 { this->_setSupports(arg,new_supports); }
1968 
1969 inline
1970 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDfDp arg, int l, const DerivativeSupport& new_supports )
1971 { this->_setSupports(arg,l,new_supports); }
1972 
1973 inline
1974 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx_dot arg, int j, const DerivativeSupport& new_supports )
1975 { this->_setSupports(arg,j,new_supports); }
1976 
1977 inline
1978 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx arg, int j, const DerivativeSupport& new_supports )
1979 { this->_setSupports(arg,j,new_supports); }
1980 
1981 inline
1982 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDp arg, int j, int l, const DerivativeSupport& new_supports )
1983 { this->_setSupports(arg,j,l,new_supports); }
1984 
1985 inline
1986 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgs_g_sg arg, int j, bool new_supports )
1987 { this->_setSupports(arg,j,new_supports); }
1988 
1989 inline
1990 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDfDp_sg arg, int l, const DerivativeSupport& new_supports )
1991 { this->_setSupports(arg,l,new_supports); }
1992 
1993 inline
1994 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx_dot_sg arg, int j, const DerivativeSupport& new_supports )
1995 { this->_setSupports(arg,j,new_supports); }
1996 
1997 inline
1998 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx_sg arg, int j, const DerivativeSupport& new_supports )
1999 { this->_setSupports(arg,j,new_supports); }
2000 
2001 inline
2002 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDp_sg arg, int j, int l, const DerivativeSupport& new_supports )
2003 { this->_setSupports(arg,j,l,new_supports); }
2004 
2005 inline
2006 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgs_g_mp arg, int j, bool new_supports )
2007 { this->_setSupports(arg,j,new_supports); }
2008 
2009 inline
2010 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDfDp_mp arg, int l, const DerivativeSupport& new_supports )
2011 { this->_setSupports(arg,l,new_supports); }
2012 
2013 inline
2014 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx_dot_mp arg, int j, const DerivativeSupport& new_supports )
2015 { this->_setSupports(arg,j,new_supports); }
2016 
2017 inline
2018 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDx_mp arg, int j, const DerivativeSupport& new_supports )
2019 { this->_setSupports(arg,j,new_supports); }
2020 
2021 inline
2022 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDp_mp arg, int j, int l, const DerivativeSupport& new_supports )
2023 { this->_setSupports(arg,j,l,new_supports); }
2024 
2025 inline
2026 void ModelEvaluator::OutArgsSetup::set_W_properties( const DerivativeProperties &properties )
2027 { this->_set_W_properties(properties); }
2028 inline
2029 void ModelEvaluator::OutArgsSetup::set_WPrec_properties( const DerivativeProperties &properties )
2030 { this->_set_WPrec_properties(properties); }
2031 
2032 inline
2033 void ModelEvaluator::OutArgsSetup::set_DfDp_properties( int l, const DerivativeProperties &properties )
2034 {
2035  this->_set_DfDp_properties(l,properties);
2036 }
2037 
2038 inline
2039 void ModelEvaluator::OutArgsSetup::set_DgDx_dot_properties( int j, const DerivativeProperties &properties )
2040 {
2041  this->_set_DgDx_dot_properties(j,properties);
2042 }
2043 
2044 inline
2045 void ModelEvaluator::OutArgsSetup::set_DgDx_properties( int j, const DerivativeProperties &properties )
2046 {
2047  this->_set_DgDx_properties(j,properties);
2048 }
2049 
2050 inline
2051 void ModelEvaluator::OutArgsSetup::set_DgDp_properties( int j, int l, const DerivativeProperties &properties )
2052 {
2053  this->_set_DgDp_properties(j,l,properties);
2054 }
2055 
2056 inline
2057 void ModelEvaluator::OutArgsSetup::set_DfDp_sg_properties( int l, const DerivativeProperties &properties )
2058 {
2059  this->_set_DfDp_sg_properties(l,properties);
2060 }
2061 
2062 inline
2063 void ModelEvaluator::OutArgsSetup::set_DgDx_dot_sg_properties( int j, const DerivativeProperties &properties )
2064 {
2065  this->_set_DgDx_dot_sg_properties(j,properties);
2066 }
2067 
2068 inline
2069 void ModelEvaluator::OutArgsSetup::set_DgDx_sg_properties( int j, const DerivativeProperties &properties )
2070 {
2071  this->_set_DgDx_sg_properties(j,properties);
2072 }
2073 
2074 inline
2075 void ModelEvaluator::OutArgsSetup::set_DgDp_sg_properties( int j, int l, const DerivativeProperties &properties )
2076 {
2077  this->_set_DgDp_sg_properties(j,l,properties);
2078 }
2079 
2080 inline
2081 void ModelEvaluator::OutArgsSetup::set_DfDp_mp_properties( int l, const DerivativeProperties &properties )
2082 {
2083  this->_set_DfDp_mp_properties(l,properties);
2084 }
2085 
2086 inline
2087 void ModelEvaluator::OutArgsSetup::set_DgDx_dot_mp_properties( int j, const DerivativeProperties &properties )
2088 {
2089  this->_set_DgDx_dot_mp_properties(j,properties);
2090 }
2091 
2092 inline
2093 void ModelEvaluator::OutArgsSetup::set_DgDx_mp_properties( int j, const DerivativeProperties &properties )
2094 {
2095  this->_set_DgDx_mp_properties(j,properties);
2096 }
2097 
2098 inline
2099 void ModelEvaluator::OutArgsSetup::set_DgDp_mp_properties( int j, int l, const DerivativeProperties &properties )
2100 {
2101  this->_set_DgDp_mp_properties(j,l,properties);
2102 }
2103 
2104 } // namespace EpetraExt
2105 
2106 #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
Teuchos::RefCountPtr< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const
Teuchos::RefCountPtr< Epetra_MultiVector > get_DgDx_dot_mv(const int j, const ModelEvaluator::OutArgs &outArgs, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
MPDerivativeMultiVector(const mp_multivector_t &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL, const Teuchos::Array< int > &paramIndexes=Teuchos::Array< int >())
Derivative(const Teuchos::RefCountPtr< Epetra_MultiVector > &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL)
Evaluation(const Teuchos::RefCountPtr< ObjType > &obj)
Preconditioner()
Default constructor of null Operatir.
Teuchos::RefCountPtr< Stokhos::EpetraOperatorOrthogPoly > sg_operator_t
Short-hand for stochastic Galerkin operator type.
Teuchos::RefCountPtr< const Stokhos::EpetraVectorOrthogPoly > sg_const_vector_t
Short-hand for stochastic Galerkin vector type.
Teuchos::RefCountPtr< Epetra_MultiVector > getMultiVector() const
Teuchos::RefCountPtr< Epetra_MultiVector > getMultiVector() const
Preconditioner(const Teuchos::RCP< Epetra_Operator > &PrecOp_, bool isAlreadyInverted_)
Usable constructor to set the (Epetra_Operator,bool) pair.
Evaluation(const Teuchos::RefCountPtr< ObjType > &obj, EEvalType evalType)
std::string toString(ModelEvaluator::EOutArgsMembers outArg)
Teuchos::RefCountPtr< Stokhos::EpetraVectorOrthogPoly > sg_vector_t
Short-hand for stochastic Galerkin vector type.
Teuchos::RCP< Stokhos::ProductEpetraMultiVector > mp_multivector_t
Teuchos::RCP< Stokhos::ProductEpetraOperator > mp_operator_t
Teuchos::RefCountPtr< Epetra_MultiVector > get_DgDp_mv(const int j, const int l, const ModelEvaluator::OutArgs &outArgs, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
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
bool supports(EDerivativeMultiVectorOrientation mvOrientation) const
Teuchos::RefCountPtr< Epetra_MultiVector > getMultiVector(const std::string &modelEvalDescription, const ModelEvaluator::Derivative &deriv, const std::string &derivName, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
Derivative(const Teuchos::RefCountPtr< Epetra_Operator > &lo)
Simple aggregate class that stores a derivative object as a general linear operator or as a multi-vec...
EDerivativeMultiVectorOrientation getOrientation() const
DerivativeMultiVector(const Teuchos::RefCountPtr< Epetra_MultiVector > &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL, const Teuchos::Array< int > &paramIndexes=Teuchos::Array< int >())
SGDerivative(const Teuchos::RefCountPtr< Stokhos::EpetraMultiVectorOrthogPoly > &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL)
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...
Simple aggregate class for a derivative object represented as a column-wise multi-vector or its trans...
MPDerivativeMultiVector getDerivativeMultiVector() const
Derivative(const DerivativeMultiVector &dmv)
Teuchos::RefCountPtr< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const
Simple aggregate class for a derivative object represented as a column-wise multi-vector or its trans...
const Teuchos::Array< int > & getParamIndexes() const
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
SGDerivativeMultiVector(const Teuchos::RefCountPtr< Stokhos::EpetraMultiVectorOrthogPoly > &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL, const Teuchos::Array< int > &paramIndexes=Teuchos::Array< int >())
DerivativeProperties(EDerivativeLinearity in_linearity, ERankStatus in_rank, bool in_supportsAdjoint)
EDerivativeMultiVectorOrientation getMultiVectorOrientation() const
void changeOrientation(const EDerivativeMultiVectorOrientation orientation)
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::RefCountPtr< Epetra_MultiVector > get_DfDp_mv(const int l, const ModelEvaluator::OutArgs &outArgs)
Teuchos::RefCountPtr< Epetra_Operator > get_DfDp_op(const int l, const ModelEvaluator::OutArgs &outArgs)
DerivativeSupport(EDerivativeLinearOp, EDerivativeMultiVectorOrientation mvOrientation)
Teuchos::RefCountPtr< Epetra_Operator > getLinearOp(const std::string &modelEvalDescription, const ModelEvaluator::Derivative &deriv, const std::string &derivName)
EDerivativeMultiVectorOrientation getMultiVectorOrientation() const
Teuchos::RefCountPtr< Epetra_Operator > getLinearOp() 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...
void reset(const Teuchos::RefCountPtr< ObjType > &obj, EEvalType evalType)
SGDerivative(const SGDerivativeMultiVector &dmv)
const Teuchos::Array< int > & getParamIndexes() const
Teuchos::RefCountPtr< Stokhos::EpetraOperatorOrthogPoly > getLinearOp() const
void changeOrientation(const EDerivativeMultiVectorOrientation orientation)
DerivativeSupport(EDerivativeMultiVectorOrientation mvOrientation1, EDerivativeMultiVectorOrientation mvOrientation2)
DerivativeSupport & plus(EDerivativeLinearOp)
Teuchos::RefCountPtr< Epetra_MultiVector > get_DgDx_mv(const int j, const ModelEvaluator::OutArgs &outArgs, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
Base interface for evaluating a stateless "model".
SGDerivative(const Teuchos::RefCountPtr< Stokhos::EpetraOperatorOrthogPoly > &lo)
Teuchos::RCP< const Stokhos::ProductEpetraOperator > mp_const_operator_t