EpetraExt Package Browser (Single Doxygen Collection)  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 
116  ,IN_ARG_omega // < Coeff of second derivative term d(x_dotdot)/dx
120  };
121  static const int NUM_E_IN_ARGS_MEMBERS=21;
122 
126  };
127 
131  };
132 
134  class InArgs {
135  public:
136 
138  typedef Teuchos::RCP<const Stokhos::EpetraVectorOrthogPoly> sg_const_vector_t;
139 
141  InArgs();
143  std::string modelEvalDescription() const;
145  int Np() const;
147  void set_x_dot( const Teuchos::RCP<const Epetra_Vector> &x_dot );
149  void set_x_dotdot( const Teuchos::RCP<const Epetra_Vector> &x_dotdot );
151  Teuchos::RCP<const Epetra_Vector> get_x_dot() const;
153  Teuchos::RCP<const Epetra_Vector> get_x_dotdot() const;
155  void set_x( const Teuchos::RCP<const Epetra_Vector> &x );
157  Teuchos::RCP<const Epetra_Vector> get_x() const;
158  void set_x_poly(
159  const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_poly
160  );
162  Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > get_x_poly() const;
164  void set_x_dot_poly(
165  const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_dot_poly
166  );
167  void set_x_dotdot_poly(
168  const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_dotdot_poly
169  );
171  Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > get_x_dot_poly() const;
172  Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > get_x_dotdot_poly() const;
174  void set_x_sg(const sg_const_vector_t &x_sg);
176  sg_const_vector_t get_x_sg() const;
178  void set_x_dot_sg(const sg_const_vector_t &x_dot_sg);
179  void set_x_dotdot_sg(const sg_const_vector_t &x_dotdot_sg);
184  void set_x_mp(const mp_const_vector_t &x_mp);
186  mp_const_vector_t get_x_mp() const;
188  void set_x_dot_mp(const mp_const_vector_t &x_dot_mp);
189  void set_x_dotdot_mp(const mp_const_vector_t &x_dotdot_mp);
194  void set_p( int l, const Teuchos::RCP<const Epetra_Vector> &p_l );
196  Teuchos::RCP<const Epetra_Vector> get_p(int l) const;
198  void set_p_sg( int l, const sg_const_vector_t &p_sg_l );
200  sg_const_vector_t get_p_sg(int l) const;
202  void set_p_mp( int l, const mp_const_vector_t &p_mp_l );
204  mp_const_vector_t get_p_mp(int l) const;
206  void set_t( double t );
208  double get_alpha() const;
210  void set_alpha( double alpha );
213  double get_omega() const;
215  void set_omega( double omega );
216  double get_beta() const;
218  void set_beta( double beta );
220  double get_t() const;
221  double get_step_size() const;
222  void set_step_size(double step_size);
223  int get_stage_number() const;
224  void set_stage_number(int stage_number);
226  Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> > get_sg_basis() const;
228  void set_sg_basis( const Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> >& basis );
230  Teuchos::RCP<const Stokhos::Quadrature<int,double> > get_sg_quadrature() const;
232  void set_sg_quadrature( const Teuchos::RCP<const Stokhos::Quadrature<int,double> >& quad );
234  Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > > get_sg_expansion() const;
236  void set_sg_expansion( const Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > >& exp );
238  bool supports(EInArgsMembers arg) const;
240  bool supports(EInArgs_p_sg arg, int l) const;
242  bool supports(EInArgs_p_mp arg, int l) const;
243  protected:
245  void _setModelEvalDescription( const std::string &modelEvalDescription );
247  void _set_Np(int Np);
249  void _setSupports( EInArgsMembers arg, bool supports );
251  void _setSupports( EInArgs_p_sg arg, int l, bool supports );
253  void _setSupports( EInArgs_p_mp arg, int l, bool supports );
254  private:
255  // types
256  typedef Teuchos::Array<Teuchos::RCP<const Epetra_Vector> > p_t;
257  typedef Teuchos::Array<sg_const_vector_t > p_sg_t;
258  typedef Teuchos::Array<mp_const_vector_t > p_mp_t;
259  typedef Teuchos::Array<bool> supports_p_sg_t;
260  // data
262  Teuchos::RCP<const Epetra_Vector> x_dot_;
263  Teuchos::RCP<const Epetra_Vector> x_dotdot_;
264  Teuchos::RCP<const Epetra_Vector> x_;
265  Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > x_dot_poly_;
266  Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > x_dotdot_poly_;
267  Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > x_poly_;
277  double t_;
278  double alpha_;
279  double omega_;
280  double beta_;
281  double step_size_;
283  Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> > sg_basis_;
284  Teuchos::RCP<const Stokhos::Quadrature<int,double> > sg_quad_;
285  Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > > sg_exp_;
289  // functions
290  void assert_supports(EInArgsMembers arg) const;
291  void assert_supports(EInArgs_p_sg arg, int l) const;
292  void assert_supports(EInArgs_p_mp arg, int l) const;
293  void assert_l(int l) const;
294  };
295 
297  enum EEvalType {
301  };
302 
304  template<class ObjType>
305  class Evaluation : public Teuchos::RCP<ObjType> {
306  public:
310  Evaluation( const Teuchos::RCP<ObjType> &obj )
311  : Teuchos::RCP<ObjType>(obj), evalType_(EVAL_TYPE_EXACT) {}
313  Evaluation( const Teuchos::RCP<ObjType> &obj, EEvalType evalType )
314  : Teuchos::RCP<ObjType>(obj), evalType_(evalType) {}
316  EEvalType getType() const { return evalType_; }
318  void reset( const Teuchos::RCP<ObjType> &obj, EEvalType evalType )
319  { this->operator=(obj); evalType_ = evalType; }
320  private:
322  };
323 
328  };
329 
332 
335  public:
339  {}
343  {}
346  :supportsLinearOp_(false), supportsMVByCol_(mvOrientation==DERIV_MV_BY_COL)
348  {}
352  :supportsLinearOp_(true), supportsMVByCol_(mvOrientation==DERIV_MV_BY_COL)
354  {}
357  EDerivativeMultiVectorOrientation mvOrientation1,
358  EDerivativeMultiVectorOrientation mvOrientation2
359  )
360  :supportsLinearOp_(false)
362  mvOrientation1==DERIV_MV_BY_COL||mvOrientation2==DERIV_MV_BY_COL )
364  mvOrientation1==DERIV_TRANS_MV_BY_ROW||mvOrientation2==DERIV_TRANS_MV_BY_ROW )
365  {}
368  { supportsLinearOp_ = true; return *this; }
371  {
372  switch(mvOrientation) {
373  case DERIV_MV_BY_COL: supportsMVByCol_ = true; break;
374  case DERIV_TRANS_MV_BY_ROW: supportsTransMVByRow_ = true; break;
375  default: TEUCHOS_TEST_FOR_EXCEPT(true);
376  }
377  return *this;
378  }
380  bool none() const
384  { return supportsLinearOp_; }
386  bool supports(EDerivativeMultiVectorOrientation mvOrientation) const
387  {
388  switch(mvOrientation) {
389  case DERIV_MV_BY_COL: return supportsMVByCol_;
391  default: TEUCHOS_TEST_FOR_EXCEPT(true);
392  }
393  return false; // Will never be called!
394  }
395  private:
399  public:
400  };
401 
407  };
409  enum ERankStatus {
413  };
414 
428  EDerivativeLinearity in_linearity, ERankStatus in_rank, bool in_supportsAdjoint
429  ):linearity(in_linearity),rank(in_rank),supportsAdjoint(in_supportsAdjoint) {}
430  };
431 
436  public:
441  const Teuchos::RCP<Epetra_MultiVector> &mv
443  ,const Teuchos::Array<int> &paramIndexes = Teuchos::Array<int>()
444  ) : mv_(mv), orientation_(orientation), paramIndexes_(paramIndexes) {}
447  { orientation_ = orientation; };
449  Teuchos::RCP<Epetra_MultiVector> getMultiVector() const
450  { return mv_; }
453  { return orientation_; }
455  const Teuchos::Array<int>& getParamIndexes() const
456  { return paramIndexes_; }
457  private:
458  Teuchos::RCP<Epetra_MultiVector> mv_;
460  Teuchos::Array<int> paramIndexes_;
461  };
462 
466  class Derivative {
467  public:
471  Derivative( const Teuchos::RCP<Epetra_Operator> &lo )
472  : lo_(lo) {}
475  const Teuchos::RCP<Epetra_MultiVector> &mv
477  ) : dmv_(mv,orientation) {}
480  : dmv_(dmv) {}
482  Teuchos::RCP<Epetra_Operator> getLinearOp() const
483  { return lo_; }
485  Teuchos::RCP<Epetra_MultiVector> getMultiVector() const
486  { return dmv_.getMultiVector(); }
489  { return dmv_.getOrientation(); }
492  { return dmv_; }
494  bool isEmpty() const
495  { return !lo_.get() && !dmv_.getMultiVector().get(); }
496  private:
497  Teuchos::RCP<Epetra_Operator> lo_;
499  };
500 
504  struct Preconditioner {
508  Preconditioner(const Teuchos::RCP<Epetra_Operator>& PrecOp_,
509  bool isAlreadyInverted_ )
510  : PrecOp(PrecOp_), isAlreadyInverted(isAlreadyInverted_) {}
512  Teuchos::RCP<Epetra_Operator> PrecOp;
518  };
519 
524  public:
529  const Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > &mv
531  ,const Teuchos::Array<int> &paramIndexes = Teuchos::Array<int>()
532  ) : mv_(mv), orientation_(orientation), paramIndexes_(paramIndexes) {}
535  { orientation_ = orientation; };
537  Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const
538  { return mv_; }
541  { return orientation_; }
543  const Teuchos::Array<int>& getParamIndexes() const
544  { return paramIndexes_; }
545  private:
546  Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > mv_;
548  Teuchos::Array<int> paramIndexes_;
549  };
550 
554  class SGDerivative {
555  public:
559  SGDerivative( const Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > &lo )
560  : lo_(lo) {}
563  const Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > &mv
565  ) : dmv_(mv,orientation) {}
568  : dmv_(dmv) {}
570  Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > getLinearOp() const
571  { return lo_; }
573  Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const
574  { return dmv_.getMultiVector(); }
577  { return dmv_.getOrientation(); }
580  { return dmv_; }
582  bool isEmpty() const
583  { return !lo_.get() && !dmv_.getMultiVector().get(); }
584  private:
585  Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > lo_;
587  };
588 
593  public:
594 
599  const mp_multivector_t &mv
601  ,const Teuchos::Array<int> &paramIndexes = Teuchos::Array<int>()
602  ) : mv_(mv), orientation_(orientation), paramIndexes_(paramIndexes) {}
605  { orientation_ = orientation; };
608  { return mv_; }
611  { return orientation_; }
613  const Teuchos::Array<int>& getParamIndexes() const
614  { return paramIndexes_; }
615  private:
618  Teuchos::Array<int> paramIndexes_;
619  };
620 
624  class MPDerivative {
625  public:
626 
631  : lo_(lo) {}
634  const mp_multivector_t &mv
636  ) : dmv_(mv,orientation) {}
639  : dmv_(dmv) {}
642  { return lo_; }
645  { return dmv_.getMultiVector(); }
648  { return dmv_.getOrientation(); }
651  { return dmv_; }
653  bool isEmpty() const
654  { return !lo_.get() && !dmv_.getMultiVector().get(); }
655  private:
658  };
659 
670  };
671  static const int NUM_E_OUT_ARGS_MEMBERS=9;
672 
676  };
677 
681  };
682 
686  };
687 
691  };
692 
696  };
697 
701  };
702 
706  };
707 
711  };
712 
716  };
717 
721  };
722 
726  };
727 
731  };
732 
736  };
737 
741  };
742 
746  };
747 
751  };
752 
756  };
757 
759  class OutArgs {
760  public:
761 
763  typedef Teuchos::RCP<Stokhos::EpetraVectorOrthogPoly> sg_vector_t;
764 
766  typedef Teuchos::RCP<Stokhos::EpetraOperatorOrthogPoly > sg_operator_t;
767 
769  OutArgs();
771  std::string modelEvalDescription() const;
773  int Np() const;
775  int Ng() const;
777  bool supports(EOutArgsMembers arg) const;
779  const DerivativeSupport& supports(EOutArgsDfDp arg, int l) const;
781  const DerivativeSupport& supports(EOutArgsDgDx_dot arg, int j) const;
782  const DerivativeSupport& supports(EOutArgsDgDx_dotdot arg, int j) const;
784  const DerivativeSupport& supports(EOutArgsDgDx arg, int j) const;
786  const DerivativeSupport& supports(EOutArgsDgDp arg, int j, int l) const;
788  bool supports(EOutArgs_g_sg arg, int j) const;
790  const DerivativeSupport& supports(EOutArgsDfDp_sg arg, int l) const;
792  const DerivativeSupport& supports(EOutArgsDgDx_dot_sg arg, int j) const;
793  const DerivativeSupport& supports(EOutArgsDgDx_dotdot_sg arg, int j) const;
795  const DerivativeSupport& supports(EOutArgsDgDx_sg arg, int j) const;
797  const DerivativeSupport& supports(EOutArgsDgDp_sg arg, int j, int l) const;
799  const DerivativeSupport& supports(EOutArgsDfDp_mp arg, int l) const;
801  bool supports(EOutArgs_g_mp arg, int j) const;
803  const DerivativeSupport& supports(EOutArgsDgDx_dot_mp arg, int j) const;
804  const DerivativeSupport& supports(EOutArgsDgDx_dotdot_mp arg, int j) const;
806  const DerivativeSupport& supports(EOutArgsDgDx_mp arg, int j) const;
808  const DerivativeSupport& supports(EOutArgsDgDp_mp arg, int j, int l) const;
810  void set_f( const Evaluation<Epetra_Vector> &f );
814  void set_f_sg( const sg_vector_t& f_sg );
816  sg_vector_t get_f_sg() const;
818  void set_f_mp( const mp_vector_t& f_mp );
820  mp_vector_t get_f_mp() const;
822  void set_g( int j, const Evaluation<Epetra_Vector> &g_j );
824  Evaluation<Epetra_Vector> get_g(int j) const;
827  void set_g_sg( int j, const sg_vector_t &g_sg_j );
830  sg_vector_t get_g_sg(int j) const;
833  void set_g_mp( int j, const mp_vector_t &g_mp_j );
836  mp_vector_t get_g_mp(int j) const;
838  void set_W( const Teuchos::RCP<Epetra_Operator> &W );
839  void set_WPrec( const Teuchos::RCP<Epetra_Operator> &WPrec );
841  Teuchos::RCP<Epetra_Operator> get_W() const;
842  Teuchos::RCP<Epetra_Operator> get_WPrec() const;
847  void set_W_sg( const sg_operator_t& W_sg );
849  sg_operator_t get_W_sg() const;
851  void set_W_mp( const mp_operator_t& W_sg );
853  mp_operator_t get_W_mp() const;
855  void set_DfDp(int l, const Derivative &DfDp_l);
857  Derivative get_DfDp(int l) const;
861  void set_DfDp_sg(int l, const SGDerivative &DfDp_sg_l);
863  SGDerivative get_DfDp_sg(int l) const;
867  void set_DfDp_mp(int l, const MPDerivative &DfDp_mp_l);
869  MPDerivative get_DfDp_mp(int l) const;
873  void set_DgDx_dot(int j, const Derivative &DgDx_dot_j);
874  void set_DgDx_dotdot(int j, const Derivative &DgDx_dotdot_j);
876  Derivative get_DgDx_dot(int j) const;
877  Derivative get_DgDx_dotdot(int j) const;
882  void set_DgDx_dot_sg(int j, const SGDerivative &DgDx_dot_j);
883  void set_DgDx_dotdot_sg(int j, const SGDerivative &DgDx_dotdot_j);
885  SGDerivative get_DgDx_dot_sg(int j) const;
886  SGDerivative get_DgDx_dotdot_sg(int j) const;
891  void set_DgDx_dot_mp(int j, const MPDerivative &DgDx_dot_j);
892  void set_DgDx_dotdot_mp(int j, const MPDerivative &DgDx_dotdot_j);
894  MPDerivative get_DgDx_dot_mp(int j) const;
895  MPDerivative get_DgDx_dotdot_mp(int j) const;
900  void set_DgDx(int j, const Derivative &DgDx_j);
902  Derivative get_DgDx(int j) const;
906  void set_DgDx_sg(int j, const SGDerivative &DgDx_j);
908  SGDerivative get_DgDx_sg(int j) const;
912  void set_DgDx_mp(int j, const MPDerivative &DgDx_j);
914  MPDerivative get_DgDx_mp(int j) const;
918  void set_DgDp( int j, int l, const Derivative &DgDp_j_l );
920  Derivative get_DgDp(int j, int l) const;
922  DerivativeProperties get_DgDp_properties(int j, int l) const;
924  void set_DgDp_sg( int j, int l, const SGDerivative &DgDp_sg_j_l );
926  SGDerivative get_DgDp_sg(int j, int l) const;
928  DerivativeProperties get_DgDp_sg_properties(int j, int l) const;
930  void set_DgDp_mp( int j, int l, const MPDerivative &DgDp_mp_j_l );
932  MPDerivative get_DgDp_mp(int j, int l) const;
934  DerivativeProperties get_DgDp_mp_properties(int j, int l) const;
935 
937  void set_f_poly( const Teuchos::RCP<Teuchos::Polynomial<Epetra_Vector> > &f_poly );
939  Teuchos::RCP<Teuchos::Polynomial<Epetra_Vector> > get_f_poly() const;
940 
941 
943  bool funcOrDerivesAreSet(EOutArgsMembers arg) const;
944 
950  void setFailed() const;
956  bool isFailed() const;
957 
958  protected:
960  void _setModelEvalDescription( const std::string &modelEvalDescription );
962  void _set_Np_Ng(int Np, int Ng);
964  void _setSupports( EOutArgsMembers arg, bool supports );
966  void _setSupports( EOutArgsDfDp arg, int l, const DerivativeSupport& );
968  void _setSupports( EOutArgsDgDx_dot arg, int j, const DerivativeSupport& );
969  void _setSupports( EOutArgsDgDx_dotdot arg, int j, const DerivativeSupport& );
971  void _setSupports( EOutArgsDgDx arg, int j, const DerivativeSupport& );
973  void _setSupports( EOutArgsDgDp arg, int j, int l, const DerivativeSupport& );
975  void _setSupports( EOutArgs_g_sg arg, int j, bool supports );
977  void _setSupports( EOutArgsDfDp_sg arg, int l, const DerivativeSupport& );
979  void _setSupports( EOutArgsDgDx_dot_sg arg, int j, const DerivativeSupport& );
980  void _setSupports( EOutArgsDgDx_dotdot_sg arg, int j, const DerivativeSupport& );
982  void _setSupports( EOutArgsDgDx_sg arg, int j, const DerivativeSupport& );
984  void _setSupports( EOutArgsDgDp_sg arg, int j, int l, const DerivativeSupport& );
985 
987  void _setSupports( EOutArgs_g_mp arg, int j, bool supports );
989  void _setSupports( EOutArgsDfDp_mp arg, int l, const DerivativeSupport& );
991  void _setSupports( EOutArgsDgDx_dot_mp arg, int j, const DerivativeSupport& );
992  void _setSupports( EOutArgsDgDx_dotdot_mp arg, int j, const DerivativeSupport& );
994  void _setSupports( EOutArgsDgDx_mp arg, int j, const DerivativeSupport& );
996  void _setSupports( EOutArgsDgDp_mp arg, int j, int l, const DerivativeSupport& );
998  void _set_W_properties( const DerivativeProperties &W_properties );
999  void _set_WPrec_properties( const DerivativeProperties &WPrec_properties );
1001  void _set_DfDp_properties( int l, const DerivativeProperties &properties );
1003  void _set_DgDx_dot_properties( int j, const DerivativeProperties &properties );
1004  void _set_DgDx_dotdot_properties( int j, const DerivativeProperties &properties );
1006  void _set_DgDx_properties( int j, const DerivativeProperties &properties );
1008  void _set_DgDp_properties( int j, int l, const DerivativeProperties &properties );
1010  void _set_DfDp_sg_properties( int l, const DerivativeProperties &properties );
1012  void _set_DgDx_dot_sg_properties( int j, const DerivativeProperties &properties );
1013  void _set_DgDx_dotdot_sg_properties( int j, const DerivativeProperties &properties );
1015  void _set_DgDx_sg_properties( int j, const DerivativeProperties &properties );
1017  void _set_DgDp_sg_properties( int j, int l, const DerivativeProperties &properties );
1018 
1020  void _set_DfDp_mp_properties( int l, const DerivativeProperties &properties );
1022  void _set_DgDx_dot_mp_properties( int j, const DerivativeProperties &properties );
1023  void _set_DgDx_dotdot_mp_properties( int j, const DerivativeProperties &properties );
1025  void _set_DgDx_mp_properties( int j, const DerivativeProperties &properties );
1027  void _set_DgDp_mp_properties( int j, int l, const DerivativeProperties &properties );
1028  private:
1029  // types
1030  typedef Teuchos::Array<Evaluation<Epetra_Vector> > g_t;
1031  typedef Teuchos::Array<sg_vector_t > g_sg_t;
1032  typedef Teuchos::Array<mp_vector_t > g_mp_t;
1033  typedef Teuchos::Array<Derivative> deriv_t;
1034  typedef Teuchos::Array<SGDerivative> sg_deriv_t;
1035  typedef Teuchos::Array<MPDerivative> mp_deriv_t;
1036  typedef Teuchos::Array<DerivativeProperties> deriv_properties_t;
1037  typedef Teuchos::Array<DerivativeSupport> supports_t;
1038  typedef Teuchos::Array<bool> supports_g_sg_t;
1039  // data
1041  mutable bool isFailed_;
1059  supports_t supports_DgDp_mp_; // Ng_mp x Np_mp
1064  Teuchos::RCP<Epetra_Operator> W_;
1065  Teuchos::RCP<Epetra_Operator> WPrec_;
1076  deriv_t DgDp_; // Ng x Np
1078  Teuchos::RCP<Teuchos::Polynomial<Epetra_Vector> > f_poly_;
1089  sg_deriv_t DgDp_sg_; // Ng x Np
1101  mp_deriv_t DgDp_mp_; // Ng x Np
1103  // functions
1104  void assert_supports(EOutArgsMembers arg) const;
1105  void assert_supports(EOutArgsDfDp arg, int l) const;
1106  void assert_supports(EOutArgsDgDx_dot arg, int j) const;
1107  void assert_supports(EOutArgsDgDx_dotdot arg, int j) const;
1108  void assert_supports(EOutArgsDgDx arg, int j) const;
1109  void assert_supports(EOutArgsDgDp arg, int j, int l) const;
1110  void assert_supports(EOutArgs_g_sg arg, int j) const;
1111  void assert_supports(EOutArgsDfDp_sg arg, int l) const;
1112  void assert_supports(EOutArgsDgDx_dot_sg arg, int j) const;
1113  void assert_supports(EOutArgsDgDx_dotdot_sg arg, int j) const;
1114  void assert_supports(EOutArgsDgDx_sg arg, int j) const;
1115  void assert_supports(EOutArgsDgDp_sg arg, int j, int l) const;
1116  void assert_supports(EOutArgs_g_mp arg, int j) const;
1117  void assert_supports(EOutArgsDfDp_mp arg, int l) const;
1118  void assert_supports(EOutArgsDgDx_dot_mp arg, int j) const;
1119  void assert_supports(EOutArgsDgDx_dotdot_mp arg, int j) const;
1120  void assert_supports(EOutArgsDgDx_mp arg, int j) const;
1121  void assert_supports(EOutArgsDgDp_mp arg, int j, int l) const;
1122  void assert_l(int l) const;
1123  void assert_j(int j) const;
1124  };
1125 
1127 
1130 
1132  virtual ~ModelEvaluator();
1133 
1135 
1138 
1140  virtual Teuchos::RCP<const Epetra_Map> get_x_map() const = 0;
1141 
1143  virtual Teuchos::RCP<const Epetra_Map> get_f_map() const = 0;
1144 
1146  virtual Teuchos::RCP<const Epetra_Map> get_p_map(int l) const;
1147 
1162  virtual Teuchos::RCP<const Teuchos::Array<std::string> > get_p_names(int l) const;
1163 
1165  virtual Teuchos::RCP<const Epetra_Map> get_g_map(int j) const;
1166 
1181  virtual Teuchos::ArrayView<const std::string> get_g_names(int j) const;
1182 
1184 
1187 
1189  virtual Teuchos::RCP<const Epetra_Vector> get_x_init() const;
1190 
1192  virtual Teuchos::RCP<const Epetra_Vector> get_x_dot_init() const;
1193 
1195  virtual Teuchos::RCP<const Epetra_Vector> get_x_dotdot_init() const;
1196 
1198  virtual Teuchos::RCP<const Epetra_Vector> get_p_init(int l) const;
1199 
1201  virtual double get_t_init() const;
1202 
1204 
1207 
1212  virtual double getInfBound() const;
1213 
1215  virtual Teuchos::RCP<const Epetra_Vector> get_x_lower_bounds() const;
1216 
1218  virtual Teuchos::RCP<const Epetra_Vector> get_x_upper_bounds() const;
1219 
1221  virtual Teuchos::RCP<const Epetra_Vector> get_p_lower_bounds(int l) const;
1222 
1224  virtual Teuchos::RCP<const Epetra_Vector> get_p_upper_bounds(int l) const;
1225 
1227  virtual double get_t_lower_bound() const;
1228 
1230  virtual double get_t_upper_bound() const;
1231 
1233 
1236 
1243  virtual Teuchos::RCP<Epetra_Operator> create_W() const;
1244  virtual Teuchos::RCP<EpetraExt::ModelEvaluator::Preconditioner> create_WPrec() const;
1245 
1247  virtual Teuchos::RCP<Epetra_Operator> create_DfDp_op(int l) const;
1248 
1250  virtual Teuchos::RCP<Epetra_Operator> create_DgDx_dot_op(int j) const;
1251 
1253  virtual Teuchos::RCP<Epetra_Operator> create_DgDx_dotdot_op(int j) const;
1254 
1256  virtual Teuchos::RCP<Epetra_Operator> create_DgDx_op(int j) const;
1257 
1259  virtual Teuchos::RCP<Epetra_Operator> create_DgDp_op( int j, int l ) const;
1260 
1262 
1265 
1267  virtual InArgs createInArgs() const = 0;
1268 
1270  virtual OutArgs createOutArgs() const = 0;
1271 
1273  virtual void evalModel( const InArgs& inArgs, const OutArgs& outArgs ) const = 0;
1274 
1275 #ifdef HAVE_PYTRILINOS
1276 
1277  friend InArgs convertInArgsFromPython(PyObject * source);
1278 
1280  friend OutArgs convertOutArgsFromPython(PyObject * source);
1281 #endif
1282 
1283 
1284 protected:
1285 
1288 
1290  class InArgsSetup : public InArgs {
1291  public:
1293  void setModelEvalDescription( const std::string &modelEvalDescription );
1295  void set_Np(int Np);
1297  void setSupports( EInArgsMembers arg, bool supports = true );
1299  void setSupports( EInArgs_p_sg arg, int l, bool supports );
1301  void setSupports( EInArgs_p_mp arg, int l, bool supports );
1302  };
1303 
1305  class OutArgsSetup : public OutArgs {
1306  public:
1308  void setModelEvalDescription( const std::string &modelEvalDescription );
1310  void set_Np_Ng(int Np, int Ng);
1312  void setSupports( EOutArgsMembers arg, bool supports = true );
1314  void setSupports(EOutArgsDfDp arg, int l, const DerivativeSupport& );
1316  void setSupports(EOutArgsDgDx_dot arg, int j, const DerivativeSupport& );
1317  void setSupports(EOutArgsDgDx_dotdot arg, int j, const DerivativeSupport& );
1319  void setSupports(EOutArgsDgDx arg, int j, const DerivativeSupport& );
1321  void setSupports(EOutArgsDgDp arg, int j, int l, const DerivativeSupport& );
1323  void setSupports( EOutArgs_g_sg arg, int j, bool supports );
1325  void setSupports(EOutArgsDfDp_sg arg, int l, const DerivativeSupport& );
1327  void setSupports(EOutArgsDgDx_dot_sg arg, int j, const DerivativeSupport& );
1328  void setSupports(EOutArgsDgDx_dotdot_sg arg, int j, const DerivativeSupport& );
1330  void setSupports(EOutArgsDgDx_sg arg, int j, const DerivativeSupport& );
1332  void setSupports(EOutArgsDgDp_sg arg, int j, int l, const DerivativeSupport& );
1334  void setSupports( EOutArgs_g_mp arg, int j, bool supports );
1336  void setSupports(EOutArgsDfDp_mp arg, int l, const DerivativeSupport& );
1338  void setSupports(EOutArgsDgDx_dot_mp arg, int j, const DerivativeSupport& );
1339  void setSupports(EOutArgsDgDx_dotdot_mp arg, int j, const DerivativeSupport& );
1341  void setSupports(EOutArgsDgDx_mp arg, int j, const DerivativeSupport& );
1343  void setSupports(EOutArgsDgDp_mp arg, int j, int l, const DerivativeSupport& );
1345  void set_W_properties( const DerivativeProperties &properties );
1346  void set_WPrec_properties( const DerivativeProperties &properties );
1348  void set_DfDp_properties( int l, const DerivativeProperties &properties );
1350  void set_DgDx_dot_properties( int j, const DerivativeProperties &properties );
1351  void set_DgDx_dotdot_properties( int j, const DerivativeProperties &properties );
1353  void set_DgDx_properties( int j, const DerivativeProperties &properties );
1355  void set_DgDp_properties( int j, int l, const DerivativeProperties &properties );
1357  void set_DfDp_sg_properties( int l, const DerivativeProperties &properties );
1359  void set_DgDx_dot_sg_properties( int j, const DerivativeProperties &properties );
1360  void set_DgDx_dotdot_sg_properties( int j, const DerivativeProperties &properties );
1362  void set_DgDx_sg_properties( int j, const DerivativeProperties &properties );
1364  void set_DgDp_sg_properties( int j, int l, const DerivativeProperties &properties );
1366  void set_DfDp_mp_properties( int l, const DerivativeProperties &properties );
1368  void set_DgDx_dot_mp_properties( int j, const DerivativeProperties &properties );
1369  void set_DgDx_dotdot_mp_properties( int j, const DerivativeProperties &properties );
1371  void set_DgDx_mp_properties( int j, const DerivativeProperties &properties );
1373  void set_DgDp_mp_properties( int j, int l, const DerivativeProperties &properties );
1374  };
1375 
1377 
1378 };
1379 
1380 // ////////////////////////////
1381 // Helper functions
1382 
1385 
1387 std::string toString( ModelEvaluator::EInArgsMembers inArg );
1388 
1390 std::string toString( ModelEvaluator::EOutArgsMembers outArg );
1391 
1393 Teuchos::RCP<Epetra_Operator>
1394 getLinearOp(
1395  const std::string &modelEvalDescription,
1396  const ModelEvaluator::Derivative &deriv,
1397  const std::string &derivName
1398  );
1399 
1401 Teuchos::RCP<Epetra_MultiVector>
1403  const std::string &modelEvalDescription,
1404  const ModelEvaluator::Derivative &deriv,
1405  const std::string &derivName,
1407  );
1408 
1410 Teuchos::RCP<Epetra_Operator>
1411 get_DfDp_op(
1412  const int l
1413  ,const ModelEvaluator::OutArgs &outArgs
1414  );
1415 
1417 Teuchos::RCP<Epetra_MultiVector>
1418 get_DfDp_mv(
1419  const int l
1420  ,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>
1434  const int j
1435  ,const ModelEvaluator::OutArgs &outArgs
1437  );
1438 
1440 Teuchos::RCP<Epetra_MultiVector>
1441 get_DgDx_mv(
1442  const int j
1443  ,const ModelEvaluator::OutArgs &outArgs
1445  );
1446 
1448 Teuchos::RCP<Epetra_MultiVector>
1449 get_DgDp_mv(
1450  const int j
1451  ,const int l
1452  ,const ModelEvaluator::OutArgs &outArgs
1454  );
1455 
1456 // ///////////////////////////
1457 // Inline Functions
1458 
1459 //
1460 // ModelEvaluator::InArgs
1461 //
1462 
1463 inline
1465 { return modelEvalDescription_; }
1466 
1467 inline
1469 { return p_.size(); }
1470 
1471 inline
1472 void ModelEvaluator::InArgs::set_x_dot( const Teuchos::RCP<const Epetra_Vector> &x_dot )
1473 { assert_supports(IN_ARG_x_dot); x_dot_ = x_dot; }
1474 
1475 inline
1476 void ModelEvaluator::InArgs::set_x_dotdot( const Teuchos::RCP<const Epetra_Vector> &x_dotdot )
1477 { assert_supports(IN_ARG_x_dotdot); x_dotdot_ = x_dotdot; }
1478 
1479 inline
1480 Teuchos::RCP<const Epetra_Vector> ModelEvaluator::InArgs::get_x_dot() const
1481 { assert_supports(IN_ARG_x_dot); return x_dot_; }
1482 
1483 inline
1484 Teuchos::RCP<const Epetra_Vector> ModelEvaluator::InArgs::get_x_dotdot() const
1485 { assert_supports(IN_ARG_x_dotdot); return x_dotdot_; }
1486 
1487 inline
1488 void ModelEvaluator::InArgs::set_x( const Teuchos::RCP<const Epetra_Vector> &x )
1489 { assert_supports(IN_ARG_x); x_ = x; }
1490 
1491 inline
1492 Teuchos::RCP<const Epetra_Vector> ModelEvaluator::InArgs::get_x() const
1493 { assert_supports(IN_ARG_x); return x_; }
1494 
1495 inline
1496 void ModelEvaluator::InArgs::set_x_dot_poly( const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_dot_poly )
1497 { assert_supports(IN_ARG_x_dot_poly); x_dot_poly_ = x_dot_poly; }
1498 
1499 inline
1500 void ModelEvaluator::InArgs::set_x_dotdot_poly( const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_dotdot_poly )
1501 { assert_supports(IN_ARG_x_dotdot_poly); x_dotdot_poly_ = x_dotdot_poly; }
1502 
1503 inline
1504 Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> >
1506 { assert_supports(IN_ARG_x_dot_poly); return x_dot_poly_; }
1507 
1508 inline
1509 Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> >
1511 { assert_supports(IN_ARG_x_dotdot_poly); return x_dotdot_poly_; }
1512 
1513 inline
1514 void ModelEvaluator::InArgs::set_x_poly( const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_poly )
1515 { assert_supports(IN_ARG_x_poly); x_poly_ = x_poly; }
1516 
1517 inline
1518 Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> >
1520 { assert_supports(IN_ARG_x_poly); return x_poly_; }
1521 
1522 inline
1524 { assert_supports(IN_ARG_x_dot_sg); x_dot_sg_ = x_dot_sg; }
1525 
1526 inline
1528 { assert_supports(IN_ARG_x_dotdot_sg); x_dotdot_sg_ = x_dotdot_sg; }
1529 
1530 inline
1533 { assert_supports(IN_ARG_x_dot_sg); return x_dot_sg_; }
1534 
1535 inline
1538 { assert_supports(IN_ARG_x_dotdot_sg); return x_dotdot_sg_; }
1539 
1540 inline
1542 { assert_supports(IN_ARG_x_dot_mp); x_dot_mp_ = x_dot_mp; }
1543 
1544 inline
1546 { assert_supports(IN_ARG_x_dotdot_mp); x_dotdot_mp_ = x_dotdot_mp; }
1547 
1548 inline
1551 { assert_supports(IN_ARG_x_dot_mp); return x_dot_mp_; }
1552 
1553 inline
1556 { assert_supports(IN_ARG_x_dotdot_mp); return x_dotdot_mp_; }
1557 
1558 inline
1560 { assert_supports(IN_ARG_x_sg); x_sg_ = x_sg; }
1561 
1562 inline
1565 { assert_supports(IN_ARG_x_sg); return x_sg_; }
1566 
1567 inline
1569 { assert_supports(IN_ARG_x_mp); x_mp_ = x_mp; }
1570 
1571 inline
1574 { assert_supports(IN_ARG_x_mp); return x_mp_; }
1575 
1576 inline
1577 void ModelEvaluator::InArgs::set_p( int l, const Teuchos::RCP<const Epetra_Vector> &p_l )
1578 { assert_l(l); p_[l] = p_l; }
1579 
1580 inline
1581 Teuchos::RCP<const Epetra_Vector> ModelEvaluator::InArgs::get_p(int l) const
1582 { assert_l(l); return p_[l]; }
1583 
1584 inline
1587 { assert_supports(IN_ARG_p_sg, l); p_sg_[l] = p_sg_l; }
1588 
1589 inline
1592 { assert_supports(IN_ARG_p_sg, l); return p_sg_[l]; }
1593 
1594 inline
1596  const ModelEvaluator::mp_const_vector_t &p_mp_l )
1597 { assert_supports(IN_ARG_p_mp, l); p_mp_[l] = p_mp_l; }
1598 
1599 inline
1602 { assert_supports(IN_ARG_p_mp, l); return p_mp_[l]; }
1603 
1604 inline
1606 { assert_supports(IN_ARG_t); t_ = t; }
1607 
1608 inline
1610 { assert_supports(IN_ARG_t); return t_; }
1611 
1612 inline
1614 { assert_supports(IN_ARG_alpha); alpha_ = alpha; }
1615 
1616 inline
1618 { assert_supports(IN_ARG_alpha); return alpha_; }
1619 
1620 inline
1622 { assert_supports(IN_ARG_omega); omega_ = omega; }
1623 
1624 inline
1626 { assert_supports(IN_ARG_omega); return omega_; }
1627 
1628 inline
1630 { assert_supports(IN_ARG_beta); beta_ = beta; }
1631 
1632 inline
1634 { assert_supports(IN_ARG_beta); return beta_; }
1635 
1636 inline
1638 { assert_supports(IN_ARG_step_size); step_size_ = step_size; }
1639 
1640 inline
1642 { assert_supports(IN_ARG_step_size); return step_size_; }
1643 
1644 inline
1646 { assert_supports(IN_ARG_stage_number); stage_number_ = stage_number; }
1647 
1648 inline
1650 { assert_supports(IN_ARG_stage_number); return stage_number_; }
1651 
1652  inline
1654 { assert_supports(IN_ARG_sg_basis); sg_basis_ = basis; }
1655 
1656 inline
1657 Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> >
1659 { assert_supports(IN_ARG_sg_basis); return sg_basis_; }
1660 
1661 inline
1663 { assert_supports(IN_ARG_sg_quadrature); sg_quad_ = quad; }
1664 
1665 inline
1666 Teuchos::RCP<const Stokhos::Quadrature<int,double> >
1668 { assert_supports(IN_ARG_sg_quadrature); return sg_quad_; }
1669 
1670 inline
1672 { assert_supports(IN_ARG_sg_expansion); sg_exp_ = exp; }
1673 
1674 inline
1675 Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > >
1677 { assert_supports(IN_ARG_sg_expansion); return sg_exp_; }
1678 
1679 inline
1680 void ModelEvaluator::InArgs::_setModelEvalDescription( const std::string &new_modelEvalDescription )
1681 {
1682  modelEvalDescription_ = new_modelEvalDescription;
1683 }
1684 
1685 inline
1687 {
1688  p_.resize(new_Np);
1689  p_sg_.resize(new_Np);
1690  p_mp_.resize(new_Np);
1691  supports_p_sg_.resize(new_Np);
1692  supports_p_mp_.resize(new_Np);
1693 }
1694 
1695 //
1696 // ModelEvaluator::OutArgs
1697 //
1698 
1699 inline
1701 { return modelEvalDescription_; }
1702 
1703 inline
1705 {
1706  return DfDp_.size();
1707 }
1708 
1709 inline
1711 {
1712  return g_.size();
1713 }
1714 
1715 inline
1717 
1718 inline
1720 ModelEvaluator::OutArgs::get_f() const { return f_; }
1721 
1722 inline
1724 {
1725  assert_j(j);
1726  g_[j] = g_j;
1727 }
1728 
1729 inline
1732 {
1733  assert_j(j);
1734  return g_[j];
1735 }
1736 
1737 inline
1739 {
1740  assert_supports(OUT_ARG_g_sg, j);
1741  g_sg_[j] = g_sg_j;
1742 }
1743 
1744 inline
1747 {
1748  assert_supports(OUT_ARG_g_sg, j);
1749  return g_sg_[j];
1750 }
1751 
1752 inline
1754 {
1755  assert_supports(OUT_ARG_g_mp, j);
1756  g_mp_[j] = g_mp_j;
1757 }
1758 
1759 inline
1762 {
1763  assert_supports(OUT_ARG_g_mp, j);
1764  return g_mp_[j];
1765 }
1766 
1767 inline
1768 void ModelEvaluator::OutArgs::set_W( const Teuchos::RCP<Epetra_Operator> &W ) { W_ = W; }
1769 inline
1770 void ModelEvaluator::OutArgs::set_WPrec( const Teuchos::RCP<Epetra_Operator> &WPrec ) { WPrec_ = WPrec; }
1771 
1772 inline
1773 Teuchos::RCP<Epetra_Operator> ModelEvaluator::OutArgs::get_W() const { return W_; }
1774 inline
1775 Teuchos::RCP<Epetra_Operator> ModelEvaluator::OutArgs::get_WPrec() const { return WPrec_; }
1776 
1777 inline
1779 { return W_properties_; }
1780 inline
1782 { return WPrec_properties_; }
1783 
1784 inline
1785 void ModelEvaluator::OutArgs::set_DfDp( int l, const Derivative &DfDp_l )
1786 {
1787  assert_supports(OUT_ARG_DfDp,l);
1788  DfDp_[l] = DfDp_l;
1789 }
1790 
1791 inline
1794 {
1795  assert_supports(OUT_ARG_DfDp,l);
1796  return DfDp_[l];
1797 }
1798 
1799 inline
1802 {
1803  assert_supports(OUT_ARG_DfDp,l);
1804  return DfDp_properties_[l];
1805 }
1806 
1807 inline
1809 {
1810  assert_supports(OUT_ARG_DfDp_sg,l);
1811  DfDp_sg_[l] = DfDp_sg_l;
1812 }
1813 
1814 inline
1817 {
1818  assert_supports(OUT_ARG_DfDp_sg,l);
1819  return DfDp_sg_[l];
1820 }
1821 
1822 inline
1825 {
1826  assert_supports(OUT_ARG_DfDp_sg,l);
1827  return DfDp_sg_properties_[l];
1828 }
1829 
1830 inline
1832 {
1833  assert_supports(OUT_ARG_DfDp_mp,l);
1834  DfDp_mp_[l] = DfDp_mp_l;
1835 }
1836 
1837 inline
1840 {
1841  assert_supports(OUT_ARG_DfDp_mp,l);
1842  return DfDp_mp_[l];
1843 }
1844 
1845 inline
1848 {
1849  assert_supports(OUT_ARG_DfDp_mp,l);
1850  return DfDp_mp_properties_[l];
1851 }
1852 
1853 inline
1854 void ModelEvaluator::OutArgs::set_DgDx_dot( int j, const Derivative &DgDx_dot_j )
1855 {
1856  assert_supports(OUT_ARG_DgDx_dot,j);
1857  DgDx_dot_[j] = DgDx_dot_j;
1858 }
1859 
1860 inline
1863 {
1864  assert_supports(OUT_ARG_DgDx_dot,j);
1865  return DgDx_dot_[j];
1866 }
1867 
1868 inline
1871 {
1872  assert_supports(OUT_ARG_DgDx_dot,j);
1873  return DgDx_dot_properties_[j];
1874 }
1875 
1876 inline
1877 void ModelEvaluator::OutArgs::set_DgDx_dot_sg( int j, const SGDerivative &DgDx_dot_sg_j )
1878 {
1879  assert_supports(OUT_ARG_DgDx_dot_sg,j);
1880  DgDx_dot_sg_[j] = DgDx_dot_sg_j;
1881 }
1882 
1883 inline
1886 {
1887  assert_supports(OUT_ARG_DgDx_dot_sg,j);
1888  return DgDx_dot_sg_[j];
1889 }
1890 
1891 inline
1894 {
1895  assert_supports(OUT_ARG_DgDx_dot_sg,j);
1896  return DgDx_dot_sg_properties_[j];
1897 }
1898 
1899 inline
1900 void ModelEvaluator::OutArgs::set_DgDx_dot_mp( int j, const MPDerivative &DgDx_dot_mp_j )
1901 {
1902  assert_supports(OUT_ARG_DgDx_dot_mp,j);
1903  DgDx_dot_mp_[j] = DgDx_dot_mp_j;
1904 }
1905 
1906 inline
1909 {
1910  assert_supports(OUT_ARG_DgDx_dot_mp,j);
1911  return DgDx_dot_mp_[j];
1912 }
1913 
1914 inline
1917 {
1918  assert_supports(OUT_ARG_DgDx_dot_mp,j);
1919  return DgDx_dot_mp_properties_[j];
1920 }
1921 
1922 inline
1923 void ModelEvaluator::OutArgs::set_DgDx_dotdot( int j, const Derivative &DgDx_dotdot_j )
1924 {
1925  assert_supports(OUT_ARG_DgDx_dotdot,j);
1926  DgDx_dotdot_[j] = DgDx_dotdot_j;
1927 }
1928 
1929 inline
1932 {
1933  assert_supports(OUT_ARG_DgDx_dotdot,j);
1934  return DgDx_dotdot_[j];
1935 }
1936 
1937 inline
1940 {
1941  assert_supports(OUT_ARG_DgDx_dotdot,j);
1942  return DgDx_dotdot_properties_[j];
1943 }
1944 
1945 inline
1946 void ModelEvaluator::OutArgs::set_DgDx_dotdot_sg( int j, const SGDerivative &DgDx_dotdot_sg_j )
1947 {
1948  assert_supports(OUT_ARG_DgDx_dotdot_sg,j);
1949  DgDx_dotdot_sg_[j] = DgDx_dotdot_sg_j;
1950 }
1951 
1952 inline
1955 {
1956  assert_supports(OUT_ARG_DgDx_dotdot_sg,j);
1957  return DgDx_dotdot_sg_[j];
1958 }
1959 
1960 inline
1963 {
1964  assert_supports(OUT_ARG_DgDx_dotdot_sg,j);
1965  return DgDx_dotdot_sg_properties_[j];
1966 }
1967 
1968 inline
1969 void ModelEvaluator::OutArgs::set_DgDx_dotdot_mp( int j, const MPDerivative &DgDx_dotdot_mp_j )
1970 {
1971  assert_supports(OUT_ARG_DgDx_dotdot_mp,j);
1972  DgDx_dotdot_mp_[j] = DgDx_dotdot_mp_j;
1973 }
1974 
1975 inline
1978 {
1979  assert_supports(OUT_ARG_DgDx_dotdot_mp,j);
1980  return DgDx_dotdot_mp_[j];
1981 }
1982 
1983 inline
1986 {
1987  assert_supports(OUT_ARG_DgDx_dotdot_mp,j);
1988  return DgDx_dotdot_mp_properties_[j];
1989 }
1990 
1991 inline
1992 void ModelEvaluator::OutArgs::set_DgDx( int j, const Derivative &DgDx_j )
1993 {
1994  assert_supports(OUT_ARG_DgDx,j);
1995  DgDx_[j] = DgDx_j;
1996 }
1997 
1998 inline
2001 {
2002  assert_supports(OUT_ARG_DgDx,j);
2003  return DgDx_[j];
2004 }
2005 
2006 inline
2009 {
2010  assert_supports(OUT_ARG_DgDx,j);
2011  return DgDx_properties_[j];
2012 }
2013 
2014 inline
2016 {
2017  assert_supports(OUT_ARG_DgDx_sg,j);
2018  DgDx_sg_[j] = DgDx_sg_j;
2019 }
2020 
2021 inline
2024 {
2025  assert_supports(OUT_ARG_DgDx_sg,j);
2026  return DgDx_sg_[j];
2027 }
2028 
2029 inline
2032 {
2033  assert_supports(OUT_ARG_DgDx_sg,j);
2034  return DgDx_sg_properties_[j];
2035 }
2036 
2037 inline
2039 {
2040  assert_supports(OUT_ARG_DgDx_mp,j);
2041  DgDx_mp_[j] = DgDx_mp_j;
2042 }
2043 
2044 inline
2047 {
2048  assert_supports(OUT_ARG_DgDx_mp,j);
2049  return DgDx_mp_[j];
2050 }
2051 
2052 inline
2055 {
2056  assert_supports(OUT_ARG_DgDx_mp,j);
2057  return DgDx_mp_properties_[j];
2058 }
2059 
2060 inline
2061 void ModelEvaluator::OutArgs::set_DgDp( int j, int l, const Derivative &DgDp_j_l )
2062 {
2063  assert_supports(OUT_ARG_DgDp,j,l);
2064  DgDp_[ j*Np() + l ] = DgDp_j_l;
2065 }
2066 
2067 inline
2070 {
2071  assert_supports(OUT_ARG_DgDp,j,l);
2072  return DgDp_[ j*Np() + l ];
2073 }
2074 
2075 inline
2078 {
2079  assert_supports(OUT_ARG_DgDp,j,l);
2080  return DgDp_properties_[ j*Np() + l ];
2081 }
2082 
2083 inline
2084 void ModelEvaluator::OutArgs::set_DgDp_sg( int j, int l, const SGDerivative &DgDp_sg_j_l )
2085 {
2086  assert_supports(OUT_ARG_DgDp_sg,j,l);
2087  DgDp_sg_[ j*Np() + l ] = DgDp_sg_j_l;
2088 }
2089 
2090 inline
2093 {
2094  assert_supports(OUT_ARG_DgDp_sg,j,l);
2095  return DgDp_sg_[ j*Np() + l ];
2096 }
2097 
2098 inline
2101 {
2102  assert_supports(OUT_ARG_DgDp_sg,j,l);
2103  return DgDp_sg_properties_[ j*Np() + l ];
2104 }
2105 
2106 inline
2107 void ModelEvaluator::OutArgs::set_DgDp_mp( int j, int l, const MPDerivative &DgDp_mp_j_l )
2108 {
2109  assert_supports(OUT_ARG_DgDp_mp,j,l);
2110  DgDp_mp_[ j*Np() + l ] = DgDp_mp_j_l;
2111 }
2112 
2113 inline
2116 {
2117  assert_supports(OUT_ARG_DgDp_mp,j,l);
2118  return DgDp_mp_[ j*Np() + l ];
2119 }
2120 
2121 inline
2124 {
2125  assert_supports(OUT_ARG_DgDp_mp,j,l);
2126  return DgDp_mp_properties_[ j*Np() + l ];
2127 }
2128 
2129 inline
2130 void ModelEvaluator::OutArgs::set_f_poly( const Teuchos::RCP<Teuchos::Polynomial<Epetra_Vector> > &f_poly )
2131 { f_poly_ = f_poly; }
2132 
2133 inline
2134 Teuchos::RCP<Teuchos::Polynomial<Epetra_Vector> >
2136 { return f_poly_; }
2137 
2138 inline
2140 { f_sg_ = f_sg; }
2141 
2142 inline
2145 { return f_sg_; }
2146 
2147 inline
2149 
2150 inline
2152 
2153 inline
2155 { f_mp_ = f_mp; }
2156 
2157 inline
2160 { return f_mp_; }
2161 
2162 inline
2164 
2165 inline
2167 
2168 //
2169 // ModelEvaluator::InArgsSetup
2170 //
2171 
2172 inline
2173 void ModelEvaluator::InArgsSetup::setModelEvalDescription( const std::string &new_modelEvalDescription )
2174 {
2175  this->_setModelEvalDescription(new_modelEvalDescription);
2176 }
2177 
2178 inline
2180 { this->_set_Np(new_Np); }
2181 
2182 inline
2184 { this->_setSupports(arg,new_supports); }
2185 
2186 inline
2187 void ModelEvaluator::InArgsSetup::setSupports( EInArgs_p_sg arg, int l, bool new_supports )
2188 { this->_setSupports(arg,l,new_supports); }
2189 
2190 inline
2191 void ModelEvaluator::InArgsSetup::setSupports( EInArgs_p_mp arg, int l, bool new_supports )
2192 { this->_setSupports(arg,l,new_supports); }
2193 
2194 //
2195 // ModelEvaluator::OutArgsSetup
2196 //
2197 
2198 inline
2199 void ModelEvaluator::OutArgsSetup::setModelEvalDescription( const std::string &new_modelEvalDescription )
2200 {
2201  this->_setModelEvalDescription(new_modelEvalDescription);
2202 }
2203 
2204 inline
2205 void ModelEvaluator::OutArgsSetup::set_Np_Ng(int new_Np, int new_Ng)
2206 { this->_set_Np_Ng(new_Np,new_Ng); }
2207 
2208 inline
2210 { this->_setSupports(arg,new_supports); }
2211 
2212 inline
2214 { this->_setSupports(arg,l,new_supports); }
2215 
2216 inline
2218 { this->_setSupports(arg,j,new_supports); }
2219 
2220 inline
2222 { this->_setSupports(arg,j,new_supports); }
2223 
2224 inline
2226 { this->_setSupports(arg,j,new_supports); }
2227 
2228 inline
2229 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDp 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_sg arg, int j, bool new_supports )
2234 { this->_setSupports(arg,j,new_supports); }
2235 
2236 inline
2238 { this->_setSupports(arg,l,new_supports); }
2239 
2240 inline
2242 { this->_setSupports(arg,j,new_supports); }
2243 
2244 inline
2246 { this->_setSupports(arg,j,new_supports); }
2247 
2248 inline
2250 { this->_setSupports(arg,j,new_supports); }
2251 
2252 inline
2254 { this->_setSupports(arg,j,l,new_supports); }
2255 
2256 inline
2257 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgs_g_mp arg, int j, bool new_supports )
2258 { this->_setSupports(arg,j,new_supports); }
2259 
2260 inline
2262 { this->_setSupports(arg,l,new_supports); }
2263 
2264 inline
2266 { this->_setSupports(arg,j,new_supports); }
2267 
2268 inline
2270 { this->_setSupports(arg,j,new_supports); }
2271 
2272 inline
2274 { this->_setSupports(arg,j,new_supports); }
2275 
2276 inline
2278 { this->_setSupports(arg,j,l,new_supports); }
2279 
2280 inline
2282 { this->_set_W_properties(properties); }
2283 inline
2285 { this->_set_WPrec_properties(properties); }
2286 
2287 inline
2289 {
2290  this->_set_DfDp_properties(l,properties);
2291 }
2292 
2293 inline
2295 {
2296  this->_set_DgDx_dot_properties(j,properties);
2297 }
2298 
2299 inline
2301 {
2302  this->_set_DgDx_dotdot_properties(j,properties);
2303 }
2304 
2305 inline
2307 {
2308  this->_set_DgDx_properties(j,properties);
2309 }
2310 
2311 inline
2313 {
2314  this->_set_DgDp_properties(j,l,properties);
2315 }
2316 
2317 inline
2319 {
2320  this->_set_DfDp_sg_properties(l,properties);
2321 }
2322 
2323 inline
2325 {
2326  this->_set_DgDx_dot_sg_properties(j,properties);
2327 }
2328 
2329 inline
2331 {
2332  this->_set_DgDx_dotdot_sg_properties(j,properties);
2333 }
2334 
2335 inline
2337 {
2338  this->_set_DgDx_sg_properties(j,properties);
2339 }
2340 
2341 inline
2343 {
2344  this->_set_DgDp_sg_properties(j,l,properties);
2345 }
2346 
2347 inline
2349 {
2350  this->_set_DfDp_mp_properties(l,properties);
2351 }
2352 
2353 inline
2355 {
2356  this->_set_DgDx_dot_mp_properties(j,properties);
2357 }
2358 
2359 inline
2361 {
2362  this->_set_DgDx_dotdot_mp_properties(j,properties);
2363 }
2364 
2365 inline
2367 {
2368  this->_set_DgDx_mp_properties(j,properties);
2369 }
2370 
2371 inline
2373 {
2374  this->_set_DgDp_mp_properties(j,l,properties);
2375 }
2376 
2377 } // namespace EpetraExt
2378 
2379 #endif // EPETRA_EXT_MODEL_EVALUATOR_HPP
virtual Teuchos::RCP< const Teuchos::Array< std::string > > get_p_names(int l) const
Get the names of the parameters associated with parameter subvector l if available.
Simple aggregate class that stores a derivative object as a general linear operator or as a multi-vec...
virtual double getInfBound() const
Return the value of an infinite bound.
Derivative get_DgDp(int j, int l) const
void setFailed() const
Set that the evaluation as a whole failed.
EDerivativeMultiVectorOrientation getMultiVectorOrientation() const
void set_WPrec_properties(const DerivativeProperties &properties)
Teuchos::RCP< const Epetra_Vector > x_dotdot_
MPDerivativeMultiVector(const mp_multivector_t &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL, const Teuchos::Array< int > &paramIndexes=Teuchos::Array< int >())
SGDerivative get_DgDp_sg(int j, int l) const
void set_W_properties(const DerivativeProperties &properties)
virtual InArgs createInArgs() const =0
EDerivativeMultiVectorOrientation getOrientation() const
mp_operator_t get_W_mp() const
Get multi-point W.
Teuchos::RCP< const Teuchos::Polynomial< Epetra_Vector > > x_poly_
Teuchos::RCP< const Teuchos::Polynomial< Epetra_Vector > > get_x_dot_poly() const
Get time derivative vector Taylor polynomial.
EDerivativeMultiVectorOrientation getOrientation() const
void set_DgDx(int j, const Derivative &DgDx_j)
Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > getLinearOp() const
void setSupports(EOutArgsMembers arg, bool supports=true)
A very approximate derivative (i.e. for a preconditioner)
mp_const_vector_t get_x_dot_mp() const
Get multi-point time derivative vector.
void set_x_dotdot_poly(const Teuchos::RCP< const Teuchos::Polynomial< Epetra_Vector > > &x_dotdot_poly)
DerivativeProperties get_DgDp_sg_properties(int j, int l) const
Teuchos::RCP< Epetra_MultiVector > getMultiVector() const
Preconditioner()
Default constructor of null Operatir.
DerivativeProperties get_DgDx_dotdot_properties(int j) const
mp_const_vector_t get_p_mp(int l) const
Get multi-point parameter vector.
Time second derivative vector Taylor polynomial.
void _setSupports(EOutArgsMembers arg, bool supports)
Teuchos::Array< DerivativeSupport > supports_t
void _set_DfDp_properties(int l, const DerivativeProperties &properties)
Teuchos::RCP< const Teuchos::Polynomial< Epetra_Vector > > get_x_poly() const
Get solution vector Taylor polynomial.
void set_DgDx_sg_properties(int j, const DerivativeProperties &properties)
virtual Teuchos::RCP< const Epetra_Map > get_f_map() const =0
.
virtual Teuchos::RCP< Epetra_Operator > create_DgDx_dot_op(int j) const
virtual Teuchos::RCP< const Epetra_Map > get_x_map() const =0
.
Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > sg_operator_t
Short-hand for stochastic Galerkin operator type.
Teuchos::RCP< const Stokhos::OrthogPolyBasis< int, double > > get_sg_basis() const
DerivativeProperties get_DgDx_dot_properties(int j) const
DerivativeProperties get_DfDp_sg_properties(int l) const
Preconditioner(const Teuchos::RCP< Epetra_Operator > &PrecOp_, bool isAlreadyInverted_)
Usable constructor to set the (Epetra_Operator,bool) pair.
void set_x(const Teuchos::RCP< const Epetra_Vector > &x)
void set_x_dot(const Teuchos::RCP< const Epetra_Vector > &x_dot)
void set_x_dotdot_mp(const mp_const_vector_t &x_dotdot_mp)
Teuchos::RCP< const Stokhos::Quadrature< int, double > > get_sg_quadrature() const
Teuchos::RCP< Epetra_Operator > getLinearOp(const std::string &modelEvalDescription, const ModelEvaluator::Derivative &deriv, const std::string &derivName)
Teuchos::RCP< const Epetra_Vector > get_x_dotdot() const
Teuchos::RCP< Epetra_MultiVector > get_DgDp_mv(const int j, const int l, const ModelEvaluator::OutArgs &outArgs, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
Teuchos::RCP< const Stokhos::OrthogPolyBasis< int, double > > sg_basis_
SGDerivativeMultiVector(const Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL, const Teuchos::Array< int > &paramIndexes=Teuchos::Array< int >())
virtual Teuchos::RCP< const Epetra_Vector > get_x_upper_bounds() const
Teuchos::Array< MPDerivative > mp_deriv_t
Teuchos::RCP< Epetra_Operator > get_WPrec() const
Teuchos::RCP< Epetra_MultiVector > get_DgDx_dot_mv(const int j, const ModelEvaluator::OutArgs &outArgs, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
void set_DfDp(int l, const Derivative &DfDp_l)
void set_WPrec(const Teuchos::RCP< Epetra_Operator > &WPrec)
Teuchos::RCP< Stokhos::ProductEpetraMultiVector > mp_multivector_t
void _set_DgDp_mp_properties(int j, int l, const DerivativeProperties &properties)
Teuchos::RCP< Epetra_Operator > W_
Teuchos::RCP< Stokhos::ProductEpetraOperator > mp_operator_t
EDerivativeMultiVectorOrientation getOrientation() const
void set_DgDx_dotdot(int j, const Derivative &DgDx_dotdot_j)
SGDerivativeMultiVector getDerivativeMultiVector() const
void set_g_sg(int j, const sg_vector_t &g_sg_j)
Set stochastic Galerkin vector polynomial response.
Teuchos::RCP< const Stokhos::ProductEpetraMultiVector > mp_const_multivector_t
void set_f(const Evaluation< Epetra_Vector > &f)
void setSupports(EInArgsMembers arg, bool supports=true)
Teuchos::RCP< Epetra_Operator > PrecOp
Accessor for the Epetra_Operator.
virtual Teuchos::RCP< const Epetra_Vector > get_p_upper_bounds(int l) const
DerivativeSupport(EDerivativeMultiVectorOrientation mvOrientation)
DerivativeProperties get_DgDp_mp_properties(int j, int l) const
Teuchos::RCP< const Epetra_Vector > get_x_dot() const
virtual Teuchos::RCP< Epetra_Operator > create_DfDp_op(int l) const
void set_DfDp_sg(int l, const SGDerivative &DfDp_sg_l)
virtual Teuchos::RCP< Epetra_Operator > create_DgDx_op(int j) const
Simple aggregate class that stores a derivative object as a general linear operator or as a multi-vec...
DerivativeProperties get_DgDx_dot_sg_properties(int j) const
Teuchos::RCP< const Epetra_Vector > x_dot_
Teuchos::RCP< Epetra_MultiVector > getMultiVector(const std::string &modelEvalDescription, const ModelEvaluator::Derivative &deriv, const std::string &derivName, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
mp_vector_t get_g_mp(int j) const
Get multi-point response.
void changeOrientation(const EDerivativeMultiVectorOrientation orientation)
DerivativeProperties get_DgDx_dot_mp_properties(int j) const
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...
void set_sg_basis(const Teuchos::RCP< const Stokhos::OrthogPolyBasis< int, double > > &basis)
mp_const_vector_t get_x_mp() const
Get multi-point solution vector.
sg_vector_t get_g_sg(int j) const
Get stochastic Galerkin vector polynomial response.
Teuchos::RCP< Stokhos::OrthogPolyExpansion< int, double, Stokhos::StandardStorage< int, double > > > sg_exp_
Simple aggregate class for a derivative object represented as a column-wise multi-vector or its trans...
void set_x_dotdot(const Teuchos::RCP< const Epetra_Vector > &x_dotdot)
bool supports(EDerivativeMultiVectorOrientation mvOrientation) const
Stochastic Galerkin solution vector polynomial.
Teuchos::RCP< const Epetra_Vector > get_x() const
Set solution vector Taylor polynomial.
Teuchos::RCP< const Teuchos::Polynomial< Epetra_Vector > > x_dot_poly_
void set_W_sg(const sg_operator_t &W_sg)
Set stochastic Galerkin W operator polynomial.
Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > sg_vector_t
Short-hand for stochastic Galerkin vector type.
void set_DgDx_dot_sg(int j, const SGDerivative &DgDx_dot_j)
virtual Teuchos::RCP< EpetraExt::ModelEvaluator::Preconditioner > create_WPrec() const
void set_DgDx_dot(int j, const Derivative &DgDx_dot_j)
bool funcOrDerivesAreSet(EOutArgsMembers arg) const
Return true if the function or its derivatives are set.
An approximate derivative (i.e. for a Jacobian)
void set_DgDx_dot_mp_properties(int j, const DerivativeProperties &properties)
void set_DgDp_properties(int j, int l, const DerivativeProperties &properties)
void set_DgDx_dotdot_mp(int j, const MPDerivative &DgDx_dotdot_j)
Evaluation(const Teuchos::RCP< ObjType > &obj)
DerivativeProperties get_DgDx_dotdot_sg_properties(int j) const
void _set_DgDx_dotdot_mp_properties(int j, const DerivativeProperties &properties)
void set_DgDx_sg(int j, const SGDerivative &DgDx_j)
sg_vector_t get_f_sg() const
Get stochastic Galerkin residual vector polynomial.
virtual Teuchos::RCP< const Epetra_Vector > get_x_init() const
Teuchos::RCP< Teuchos::Polynomial< Epetra_Vector > > get_f_poly() const
Get residual vector Taylor polynomial.
Teuchos::RCP< const Stokhos::EpetraVectorOrthogPoly > sg_const_vector_t
Short-hand for stochastic Galerkin vector type.
virtual Teuchos::RCP< const Epetra_Vector > get_x_dotdot_init() const
void set_p_mp(int l, const mp_const_vector_t &p_mp_l)
Set multi-point parameter vector.
void set_DgDx_mp(int j, const MPDerivative &DgDx_j)
void set_DgDp_sg(int j, int l, const SGDerivative &DgDp_sg_j_l)
void set_DfDp_properties(int l, const DerivativeProperties &properties)
virtual Teuchos::ArrayView< const std::string > get_g_names(int j) const
Get the names of the response functions associated with response subvector j if available.
void setModelEvalDescription(const std::string &modelEvalDescription)
sg_const_vector_t get_x_sg() const
Get stochastic Galerkin solution vector polynomial.
Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > lo_
void set_x_dotdot_sg(const sg_const_vector_t &x_dotdot_sg)
MPDerivativeMultiVector getDerivativeMultiVector() const
Teuchos::RCP< Epetra_MultiVector > get_DfDp_mv(const int l, const ModelEvaluator::OutArgs &outArgs)
EDerivativeMultiVectorOrientation getMultiVectorOrientation() const
Teuchos::RCP< Epetra_Operator > get_W() const
Derivative(const DerivativeMultiVector &dmv)
void set_p(int l, const Teuchos::RCP< const Epetra_Vector > &p_l)
void _set_DgDx_mp_properties(int j, const DerivativeProperties &properties)
void set_DgDp_sg_properties(int j, int l, const DerivativeProperties &properties)
virtual Teuchos::RCP< Epetra_Operator > create_DgDx_dotdot_op(int j) const
Simple aggregate class for a derivative object represented as a column-wise multi-vector or its trans...
void set_DgDx_dot_properties(int j, const DerivativeProperties &properties)
Teuchos::RCP< Epetra_Operator > get_DfDp_op(const int l, const ModelEvaluator::OutArgs &outArgs)
void set_x_dot_sg(const sg_const_vector_t &x_dot_sg)
Set stochastic Galerkin time derivative vector polynomial.
MPDerivative(const MPDerivativeMultiVector &dmv)
DerivativeSupport & plus(EDerivativeMultiVectorOrientation mvOrientation)
Multi-point time second derivative vector.
Preconditioner operator (approx Jacobian)
MPDerivative(const mp_multivector_t &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL)
Teuchos::RCP< const Stokhos::ProductEpetraVector > mp_const_vector_t
bool isFailed() const
Return if the evaluation failed or not.
Teuchos::RCP< Epetra_MultiVector > get_DgDx_mv(const int j, const ModelEvaluator::OutArgs &outArgs, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
const Teuchos::Array< int > & getParamIndexes() const
const Teuchos::Array< int > & getParamIndexes() const
void _set_WPrec_properties(const DerivativeProperties &WPrec_properties)
sg_const_vector_t get_p_sg(int l) const
Get stochastic Galerkin vector polynomial parameter.
void set_W(const Teuchos::RCP< Epetra_Operator > &W)
void _set_DgDx_dot_mp_properties(int j, const DerivativeProperties &properties)
Derivative(const Teuchos::RCP< Epetra_Operator > &lo)
void _set_DgDx_dot_properties(int j, const DerivativeProperties &properties)
void assert_supports(EInArgsMembers arg) const
void assert_supports(EOutArgsMembers arg) const
Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > mv_
virtual double get_t_upper_bound() const
virtual Teuchos::RCP< Epetra_Operator > create_W() const
If supported, create a Epetra_Operator object for W to be evaluated.
sg_const_vector_t get_x_dot_sg() const
Get stochastic Galerkin time derivative vector polynomial.
virtual Teuchos::RCP< Epetra_Operator > create_DgDp_op(int j, int l) const
void set_sg_expansion(const Teuchos::RCP< Stokhos::OrthogPolyExpansion< int, double, Stokhos::StandardStorage< int, double > > > &exp)
void setModelEvalDescription(const std::string &modelEvalDescription)
virtual Teuchos::RCP< const Epetra_Map > get_g_map(int j) const
.
void set_f_sg(const sg_vector_t &f_sg)
Set stochastic Galerkin residual vector polynomial.
DerivativeProperties(EDerivativeLinearity in_linearity, ERankStatus in_rank, bool in_supportsAdjoint)
SGDerivative(const Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > &lo)
DerivativeMultiVector getDerivativeMultiVector() const
DerivativeProperties get_DgDx_mp_properties(int j) const
sg_operator_t get_W_sg() const
Get stochastic Galerkin W operator polynomial.
Teuchos::RCP< const Stokhos::Quadrature< int, double > > sg_quad_
void set_DgDp(int j, int l, const Derivative &DgDp_j_l)
void set_W_mp(const mp_operator_t &W_sg)
Set multi-point W.
Teuchos::Array< Evaluation< Epetra_Vector > > g_t
void set_f_poly(const Teuchos::RCP< Teuchos::Polynomial< Epetra_Vector > > &f_poly)
Set residual vector Taylor polynomial.
void set_DgDx_dotdot_sg_properties(int j, const DerivativeProperties &properties)
void _set_DgDx_dot_sg_properties(int j, const DerivativeProperties &properties)
Teuchos::RCP< const Epetra_Vector > get_p(int l) const
Multi-point time derivative vector.
Teuchos::Array< DerivativeProperties > deriv_properties_t
virtual Teuchos::RCP< const Epetra_Vector > get_x_lower_bounds() const
void set_x_dot_mp(const mp_const_vector_t &x_dot_mp)
Set multi-point time derivative vector.
void set_DfDp_mp_properties(int l, const DerivativeProperties &properties)
void set_DgDx_dot_mp(int j, const MPDerivative &DgDx_dot_j)
Derivative(const Teuchos::RCP< Epetra_MultiVector > &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL)
void set_x_poly(const Teuchos::RCP< const Teuchos::Polynomial< Epetra_Vector > > &x_poly)
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.
void _set_DfDp_mp_properties(int l, const DerivativeProperties &properties)
Solution vector Taylor polynomial.
Stochastic Galerkin time derivative vector polynomial.
EDerivativeMultiVectorOrientation getMultiVectorOrientation() const
Teuchos::Array< Teuchos::RCP< const Epetra_Vector > > p_t
void _set_DgDp_properties(int j, int l, const DerivativeProperties &properties)
Stochastic Galerkin residual vector polynomial.
DerivativeProperties get_WPrec_properties() const
bool supports(EOutArgsMembers arg) const
virtual Teuchos::RCP< const Epetra_Vector > get_x_dot_init() const
Stochastic Galerkin "W" operator polyomial.
Teuchos::Array< sg_const_vector_t > p_sg_t
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)
Teuchos::RCP< Epetra_MultiVector > getMultiVector() const
Teuchos::RCP< const Epetra_Vector > x_
DerivativeSupport(EDerivativeLinearOp, EDerivativeMultiVectorOrientation mvOrientation)
void set_DfDp_sg_properties(int l, const DerivativeProperties &properties)
DerivativeProperties get_DfDp_properties(int l) const
Teuchos::Array< mp_const_vector_t > p_mp_t
virtual void evalModel(const InArgs &inArgs, const OutArgs &outArgs) const =0
Teuchos::RCP< Teuchos::Polynomial< Epetra_Vector > > f_poly_
Teuchos::RCP< Stokhos::ProductEpetraVector > mp_vector_t
void set_DfDp_mp(int l, const MPDerivative &DfDp_mp_l)
DerivativeProperties get_DgDx_properties(int j) const
void set_DgDx_dotdot_mp_properties(int j, const DerivativeProperties &properties)
virtual Teuchos::RCP< const Epetra_Vector > get_p_init(int l) const
Time derivative vector Taylor polynomial.
Simple aggregate class for a derivative object represented as a column-wise multi-vector or its trans...
virtual Teuchos::RCP< const Epetra_Map > get_p_map(int l) const
.
void _set_DgDx_properties(int j, const DerivativeProperties &properties)
Evaluation< Epetra_Vector > get_g(int j) const
Get g(j) where 0 <= j && j < this->Ng().
DerivativeProperties get_W_properties() const
DerivativeProperties get_DgDp_properties(int j, int l) const
void set_DgDx_properties(int j, const DerivativeProperties &properties)
void set_DgDp_mp(int j, int l, const MPDerivative &DgDp_mp_j_l)
void set_DgDx_dot_sg_properties(int j, const DerivativeProperties &properties)
const Teuchos::Array< int > & getParamIndexes() const
SGDerivative(const SGDerivativeMultiVector &dmv)
void set_x_dot_poly(const Teuchos::RCP< const Teuchos::Polynomial< Epetra_Vector > > &x_dot_poly)
Set time derivative vector Taylor polynomial.
void _set_DgDp_sg_properties(int j, int l, const DerivativeProperties &properties)
void set_g_mp(int j, const mp_vector_t &g_mp_j)
Set multi-point response.
void set_x_mp(const mp_const_vector_t &x_mp)
Set multi-point solution vector.
mp_vector_t get_f_mp() const
Get multi-point residual vector.
Evaluation< Epetra_Vector > get_f() const
Teuchos::RCP< Epetra_Operator > getLinearOp() const
Stochastic Galerkin time second derivative vector polynomial.
DerivativeProperties get_DfDp_mp_properties(int l) const
void set_sg_quadrature(const Teuchos::RCP< const Stokhos::Quadrature< int, double > > &quad)
DerivativeProperties get_DgDx_dotdot_mp_properties(int j) const
void set_x_sg(const sg_const_vector_t &x_sg)
Set stochastic Galerkin solution vector polynomial.
void set_DgDx_dotdot_sg(int j, const SGDerivative &DgDx_dotdot_j)
DerivativeProperties get_DgDx_sg_properties(int j) const
void _set_DgDx_dotdot_properties(int j, const DerivativeProperties &properties)
void _setSupports(EInArgsMembers arg, bool supports)
Teuchos::RCP< Epetra_Operator > WPrec_
void set_f_mp(const mp_vector_t &f_mp)
Set multi-point residual vector.
void _set_DgDx_sg_properties(int j, const DerivativeProperties &properties)
virtual Teuchos::RCP< const Epetra_Vector > get_p_lower_bounds(int l) const
void _set_W_properties(const DerivativeProperties &W_properties)
void changeOrientation(const EDerivativeMultiVectorOrientation orientation)
Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const
DerivativeSupport(EDerivativeMultiVectorOrientation mvOrientation1, EDerivativeMultiVectorOrientation mvOrientation2)
DerivativeSupport & plus(EDerivativeLinearOp)
virtual OutArgs createOutArgs() const =0
void _set_DgDx_dotdot_sg_properties(int j, const DerivativeProperties &properties)
virtual double get_t_lower_bound() const
Teuchos::Array< SGDerivative > sg_deriv_t
void set_p_sg(int l, const sg_const_vector_t &p_sg_l)
Set stochastic Galerkin vector polynomial parameter.
Base interface for evaluating a stateless "model".
void set_DgDx_dotdot_properties(int j, const DerivativeProperties &properties)
void _setModelEvalDescription(const std::string &modelEvalDescription)
Teuchos::RCP< const Teuchos::Polynomial< Epetra_Vector > > x_dotdot_poly_
MPDerivative get_DgDp_mp(int j, int l) const
void _set_DfDp_sg_properties(int l, const DerivativeProperties &properties)
std::string toString(const int &x)
bool supports(EInArgsMembers arg) const
Teuchos::RCP< const Teuchos::Polynomial< Epetra_Vector > > get_x_dotdot_poly() const
Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const
void _setModelEvalDescription(const std::string &modelEvalDescription)
Teuchos::RCP< const Stokhos::ProductEpetraOperator > mp_const_operator_t
void set_g(int j, const Evaluation< Epetra_Vector > &g_j)
Set g(j) where 0 <= j && j < this->Ng().
void set_DgDx_mp_properties(int j, const DerivativeProperties &properties)
void set_DgDp_mp_properties(int j, int l, const DerivativeProperties &properties)
Evaluation(const Teuchos::RCP< ObjType > &obj, EEvalType evalType)
Teuchos::RCP< Stokhos::OrthogPolyExpansion< int, double, Stokhos::StandardStorage< int, double > > > get_sg_expansion() const