EpetraExt  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 #if defined(EpetraExt_SHOW_DEPRECATED_WARNINGS)
46 #ifdef __GNUC__
47 #warning "The EpetraExt package is deprecated"
48 #endif
49 #endif
50 
51 #include "EpetraExt_ConfigDefs.h"
53 #include "Teuchos_RCP.hpp"
54 #include "Teuchos_Describable.hpp"
55 #include "Teuchos_Polynomial.hpp"
56 #include "Teuchos_Array.hpp"
57 #include "Teuchos_CompilerCodeTweakMacros.hpp"
58 
59 #ifdef HAVE_PYTRILINOS
60 #ifndef PyObject_HEAD
61 struct _object;
62 typedef _object PyObject;
63 #endif
64 #endif
65 
66 class Epetra_Map;
67 class Epetra_Vector;
68 class Epetra_Operator;
69 
70 // Forward declaration of Stochastic Galerkin (SG) argument types
71 namespace Stokhos {
72  class EpetraVectorOrthogPoly;
73  class EpetraMultiVectorOrthogPoly;
74  class EpetraOperatorOrthogPoly;
75  template <typename ordinal_type, typename scalar_type> class OrthogPolyBasis;
76  template <typename ordinal_type, typename scalar_type> class Quadrature;
77  template <typename ordinal_type, typename scalar_type> class StandardStorage;
78  template <typename ordinal_type, typename scalar_type, typename node_type> class OrthogPolyExpansion;
79 
80  class ProductEpetraVector;
81  class ProductEpetraMultiVector;
82  class ProductEpetraOperator;
83 }
84 
85 namespace EpetraExt {
86 
91 class ModelEvaluator : virtual public Teuchos::Describable {
92 public:
93 
96 
97  typedef Teuchos::RCP<const Stokhos::ProductEpetraVector> mp_const_vector_t;
98  typedef Teuchos::RCP<const Stokhos::ProductEpetraMultiVector> mp_const_multivector_t;
99  typedef Teuchos::RCP<const Stokhos::ProductEpetraOperator > mp_const_operator_t;
100  typedef Teuchos::RCP<Stokhos::ProductEpetraVector> mp_vector_t;
101  typedef Teuchos::RCP<Stokhos::ProductEpetraMultiVector> mp_multivector_t;
102  typedef Teuchos::RCP<Stokhos::ProductEpetraOperator > mp_operator_t;
103 
127  };
128  static const int NUM_E_IN_ARGS_MEMBERS=21;
129 
133  };
134 
138  };
139 
141  class InArgs {
142  public:
143 
145  typedef Teuchos::RCP<const Stokhos::EpetraVectorOrthogPoly> sg_const_vector_t;
146 
148  InArgs();
150  std::string modelEvalDescription() const;
152  int Np() const;
154  void set_x_dot( const Teuchos::RCP<const Epetra_Vector> &x_dot );
156  void set_x_dotdot( const Teuchos::RCP<const Epetra_Vector> &x_dotdot );
158  Teuchos::RCP<const Epetra_Vector> get_x_dot() const;
160  Teuchos::RCP<const Epetra_Vector> get_x_dotdot() const;
162  void set_x( const Teuchos::RCP<const Epetra_Vector> &x );
164  Teuchos::RCP<const Epetra_Vector> get_x() const;
165  void set_x_poly(
166  const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_poly
167  );
169  Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > get_x_poly() const;
171  void set_x_dot_poly(
172  const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_dot_poly
173  );
174  void set_x_dotdot_poly(
175  const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_dotdot_poly
176  );
178  Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > get_x_dot_poly() const;
179  Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > get_x_dotdot_poly() const;
181  void set_x_sg(const sg_const_vector_t &x_sg);
183  sg_const_vector_t get_x_sg() const;
185  void set_x_dot_sg(const sg_const_vector_t &x_dot_sg);
186  void set_x_dotdot_sg(const sg_const_vector_t &x_dotdot_sg);
191  void set_x_mp(const mp_const_vector_t &x_mp);
193  mp_const_vector_t get_x_mp() const;
195  void set_x_dot_mp(const mp_const_vector_t &x_dot_mp);
196  void set_x_dotdot_mp(const mp_const_vector_t &x_dotdot_mp);
201  void set_p( int l, const Teuchos::RCP<const Epetra_Vector> &p_l );
203  Teuchos::RCP<const Epetra_Vector> get_p(int l) const;
205  void set_p_sg( int l, const sg_const_vector_t &p_sg_l );
207  sg_const_vector_t get_p_sg(int l) const;
209  void set_p_mp( int l, const mp_const_vector_t &p_mp_l );
211  mp_const_vector_t get_p_mp(int l) const;
213  void set_t( double t );
215  double get_alpha() const;
217  void set_alpha( double alpha );
220  double get_omega() const;
222  void set_omega( double omega );
223  double get_beta() const;
225  void set_beta( double beta );
227  double get_t() const;
228  double get_step_size() const;
229  void set_step_size(double step_size);
230  int get_stage_number() const;
231  void set_stage_number(int stage_number);
233  Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> > get_sg_basis() const;
235  void set_sg_basis( const Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> >& basis );
237  Teuchos::RCP<const Stokhos::Quadrature<int,double> > get_sg_quadrature() const;
239  void set_sg_quadrature( const Teuchos::RCP<const Stokhos::Quadrature<int,double> >& quad );
241  Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > > get_sg_expansion() const;
243  void set_sg_expansion( const Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > >& exp );
245  bool supports(EInArgsMembers arg) const;
247  bool supports(EInArgs_p_sg arg, int l) const;
249  bool supports(EInArgs_p_mp arg, int l) const;
250  protected:
252  void _setModelEvalDescription( const std::string &modelEvalDescription );
254  void _set_Np(int Np);
256  void _setSupports( EInArgsMembers arg, bool supports );
258  void _setSupports( EInArgs_p_sg arg, int l, bool supports );
260  void _setSupports( EInArgs_p_mp arg, int l, bool supports );
261  private:
262  // types
263  typedef Teuchos::Array<Teuchos::RCP<const Epetra_Vector> > p_t;
264  typedef Teuchos::Array<sg_const_vector_t > p_sg_t;
265  typedef Teuchos::Array<mp_const_vector_t > p_mp_t;
266  typedef Teuchos::Array<bool> supports_p_sg_t;
267  // data
268  std::string modelEvalDescription_;
269  Teuchos::RCP<const Epetra_Vector> x_dot_;
270  Teuchos::RCP<const Epetra_Vector> x_dotdot_;
271  Teuchos::RCP<const Epetra_Vector> x_;
272  Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > x_dot_poly_;
273  Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > x_dotdot_poly_;
274  Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > x_poly_;
275  sg_const_vector_t x_dot_sg_;
276  sg_const_vector_t x_dotdot_sg_;
277  sg_const_vector_t x_sg_;
278  mp_const_vector_t x_dot_mp_;
279  mp_const_vector_t x_dotdot_mp_;
280  mp_const_vector_t x_mp_;
281  p_t p_;
282  p_sg_t p_sg_;
283  p_mp_t p_mp_;
284  double t_;
285  double alpha_;
286  double omega_;
287  double beta_;
288  double step_size_;
289  int stage_number_;
290  Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> > sg_basis_;
291  Teuchos::RCP<const Stokhos::Quadrature<int,double> > sg_quad_;
292  Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > > sg_exp_;
293  bool supports_[NUM_E_IN_ARGS_MEMBERS];
294  supports_p_sg_t supports_p_sg_; // Np
295  supports_p_sg_t supports_p_mp_; // Np
296  // functions
297  void assert_supports(EInArgsMembers arg) const;
298  void assert_supports(EInArgs_p_sg arg, int l) const;
299  void assert_supports(EInArgs_p_mp arg, int l) const;
300  void assert_l(int l) const;
301  };
302 
304  enum EEvalType {
308  };
309 
311  template<class ObjType>
312  class Evaluation : public Teuchos::RCP<ObjType> {
313  public:
315  Evaluation() : evalType_(EVAL_TYPE_EXACT) {}
317  Evaluation( const Teuchos::RCP<ObjType> &obj )
318  : Teuchos::RCP<ObjType>(obj), evalType_(EVAL_TYPE_EXACT) {}
320  Evaluation( const Teuchos::RCP<ObjType> &obj, EEvalType evalType )
321  : Teuchos::RCP<ObjType>(obj), evalType_(evalType) {}
323  EEvalType getType() const { return evalType_; }
325  void reset( const Teuchos::RCP<ObjType> &obj, EEvalType evalType )
326  { this->operator=(obj); evalType_ = evalType; }
327  private:
328  EEvalType evalType_;
329  };
330 
335  };
336 
339 
342  public:
345  :supportsLinearOp_(false), supportsMVByCol_(false), supportsTransMVByRow_(false)
346  {}
349  :supportsLinearOp_(true), supportsMVByCol_(false), supportsTransMVByRow_(false)
350  {}
353  :supportsLinearOp_(false), supportsMVByCol_(mvOrientation==DERIV_MV_BY_COL)
354  ,supportsTransMVByRow_(mvOrientation==DERIV_TRANS_MV_BY_ROW)
355  {}
359  :supportsLinearOp_(true), supportsMVByCol_(mvOrientation==DERIV_MV_BY_COL)
360  ,supportsTransMVByRow_(mvOrientation==DERIV_TRANS_MV_BY_ROW)
361  {}
364  EDerivativeMultiVectorOrientation mvOrientation1,
365  EDerivativeMultiVectorOrientation mvOrientation2
366  )
367  :supportsLinearOp_(false)
368  ,supportsMVByCol_(
369  mvOrientation1==DERIV_MV_BY_COL||mvOrientation2==DERIV_MV_BY_COL )
370  ,supportsTransMVByRow_(
371  mvOrientation1==DERIV_TRANS_MV_BY_ROW||mvOrientation2==DERIV_TRANS_MV_BY_ROW )
372  {}
375  { supportsLinearOp_ = true; return *this; }
378  {
379  switch(mvOrientation) {
380  case DERIV_MV_BY_COL: supportsMVByCol_ = true; break;
381  case DERIV_TRANS_MV_BY_ROW: supportsTransMVByRow_ = true; break;
382  default: TEUCHOS_TEST_FOR_EXCEPT(true);
383  }
384  return *this;
385  }
387  bool none() const
388  { return ( !supportsLinearOp_ && !supportsMVByCol_ && !supportsTransMVByRow_ ); }
391  { return supportsLinearOp_; }
393  bool supports(EDerivativeMultiVectorOrientation mvOrientation) const
394  {
395  switch(mvOrientation) {
396  case DERIV_MV_BY_COL: return supportsMVByCol_;
397  case DERIV_TRANS_MV_BY_ROW: return supportsTransMVByRow_;
398  default: TEUCHOS_TEST_FOR_EXCEPT(true);
399  }
400  TEUCHOS_UNREACHABLE_RETURN(false);
401  }
402  private:
403  bool supportsLinearOp_;
404  bool supportsMVByCol_;
405  bool supportsTransMVByRow_;
406  public:
407  };
408 
414  };
416  enum ERankStatus {
420  };
421 
435  EDerivativeLinearity in_linearity, ERankStatus in_rank, bool in_supportsAdjoint
436  ):linearity(in_linearity),rank(in_rank),supportsAdjoint(in_supportsAdjoint) {}
437  };
438 
443  public:
448  const Teuchos::RCP<Epetra_MultiVector> &mv
450  ,const Teuchos::Array<int> &paramIndexes = Teuchos::Array<int>()
451  ) : mv_(mv), orientation_(orientation), paramIndexes_(paramIndexes) {}
454  { orientation_ = orientation; };
456  Teuchos::RCP<Epetra_MultiVector> getMultiVector() const
457  { return mv_; }
460  { return orientation_; }
462  const Teuchos::Array<int>& getParamIndexes() const
463  { return paramIndexes_; }
464  private:
465  Teuchos::RCP<Epetra_MultiVector> mv_;
467  Teuchos::Array<int> paramIndexes_;
468  };
469 
473  class Derivative {
474  public:
478  Derivative( const Teuchos::RCP<Epetra_Operator> &lo )
479  : lo_(lo) {}
482  const Teuchos::RCP<Epetra_MultiVector> &mv
484  ) : dmv_(mv,orientation) {}
487  : dmv_(dmv) {}
489  Teuchos::RCP<Epetra_Operator> getLinearOp() const
490  { return lo_; }
492  Teuchos::RCP<Epetra_MultiVector> getMultiVector() const
493  { return dmv_.getMultiVector(); }
496  { return dmv_.getOrientation(); }
499  { return dmv_; }
501  bool isEmpty() const
502  { return !lo_.get() && !dmv_.getMultiVector().get(); }
503  private:
504  Teuchos::RCP<Epetra_Operator> lo_;
506  };
507 
511  struct Preconditioner {
513  Preconditioner() : PrecOp(Teuchos::null), isAlreadyInverted(false) {}
515  Preconditioner(const Teuchos::RCP<Epetra_Operator>& PrecOp_,
516  bool isAlreadyInverted_ )
517  : PrecOp(PrecOp_), isAlreadyInverted(isAlreadyInverted_) {}
519  Teuchos::RCP<Epetra_Operator> PrecOp;
525  };
526 
531  public:
536  const Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > &mv
538  ,const Teuchos::Array<int> &paramIndexes = Teuchos::Array<int>()
539  ) : mv_(mv), orientation_(orientation), paramIndexes_(paramIndexes) {}
542  { orientation_ = orientation; };
544  Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const
545  { return mv_; }
548  { return orientation_; }
550  const Teuchos::Array<int>& getParamIndexes() const
551  { return paramIndexes_; }
552  private:
553  Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > mv_;
555  Teuchos::Array<int> paramIndexes_;
556  };
557 
561  class SGDerivative {
562  public:
566  SGDerivative( const Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > &lo )
567  : lo_(lo) {}
570  const Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > &mv
572  ) : dmv_(mv,orientation) {}
575  : dmv_(dmv) {}
577  Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > getLinearOp() const
578  { return lo_; }
580  Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const
581  { return dmv_.getMultiVector(); }
584  { return dmv_.getOrientation(); }
587  { return dmv_; }
589  bool isEmpty() const
590  { return !lo_.get() && !dmv_.getMultiVector().get(); }
591  private:
592  Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > lo_;
594  };
595 
600  public:
601 
606  const mp_multivector_t &mv
608  ,const Teuchos::Array<int> &paramIndexes = Teuchos::Array<int>()
609  ) : mv_(mv), orientation_(orientation), paramIndexes_(paramIndexes) {}
612  { orientation_ = orientation; };
615  { return mv_; }
618  { return orientation_; }
620  const Teuchos::Array<int>& getParamIndexes() const
621  { return paramIndexes_; }
622  private:
623  mp_multivector_t mv_;
625  Teuchos::Array<int> paramIndexes_;
626  };
627 
631  class MPDerivative {
632  public:
633 
638  : lo_(lo) {}
641  const mp_multivector_t &mv
643  ) : dmv_(mv,orientation) {}
646  : dmv_(dmv) {}
649  { return lo_; }
652  { return dmv_.getMultiVector(); }
655  { return dmv_.getOrientation(); }
658  { return dmv_; }
660  bool isEmpty() const
661  { return !lo_.get() && !dmv_.getMultiVector().get(); }
662  private:
663  mp_operator_t lo_;
665  };
666 
677  };
678  static const int NUM_E_OUT_ARGS_MEMBERS=9;
679 
683  };
684 
688  };
689 
693  };
694 
698  };
699 
703  };
704 
708  };
709 
713  };
714 
718  };
719 
723  };
724 
728  };
729 
733  };
734 
738  };
739 
743  };
744 
748  };
749 
753  };
754 
758  };
759 
763  };
764 
766  class OutArgs {
767  public:
768 
770  typedef Teuchos::RCP<Stokhos::EpetraVectorOrthogPoly> sg_vector_t;
771 
773  typedef Teuchos::RCP<Stokhos::EpetraOperatorOrthogPoly > sg_operator_t;
774 
776  OutArgs();
778  std::string modelEvalDescription() const;
780  int Np() const;
782  int Ng() const;
784  bool supports(EOutArgsMembers arg) const;
786  const DerivativeSupport& supports(EOutArgsDfDp arg, int l) const;
788  const DerivativeSupport& supports(EOutArgsDgDx_dot arg, int j) const;
789  const DerivativeSupport& supports(EOutArgsDgDx_dotdot arg, int j) const;
791  const DerivativeSupport& supports(EOutArgsDgDx arg, int j) const;
793  const DerivativeSupport& supports(EOutArgsDgDp arg, int j, int l) const;
795  bool supports(EOutArgs_g_sg arg, int j) const;
797  const DerivativeSupport& supports(EOutArgsDfDp_sg arg, int l) const;
799  const DerivativeSupport& supports(EOutArgsDgDx_dot_sg arg, int j) const;
800  const DerivativeSupport& supports(EOutArgsDgDx_dotdot_sg arg, int j) const;
802  const DerivativeSupport& supports(EOutArgsDgDx_sg arg, int j) const;
804  const DerivativeSupport& supports(EOutArgsDgDp_sg arg, int j, int l) const;
806  const DerivativeSupport& supports(EOutArgsDfDp_mp arg, int l) const;
808  bool supports(EOutArgs_g_mp arg, int j) const;
810  const DerivativeSupport& supports(EOutArgsDgDx_dot_mp arg, int j) const;
811  const DerivativeSupport& supports(EOutArgsDgDx_dotdot_mp arg, int j) const;
813  const DerivativeSupport& supports(EOutArgsDgDx_mp arg, int j) const;
815  const DerivativeSupport& supports(EOutArgsDgDp_mp arg, int j, int l) const;
817  void set_f( const Evaluation<Epetra_Vector> &f );
821  void set_f_sg( const sg_vector_t& f_sg );
823  sg_vector_t get_f_sg() const;
825  void set_f_mp( const mp_vector_t& f_mp );
827  mp_vector_t get_f_mp() const;
829  void set_g( int j, const Evaluation<Epetra_Vector> &g_j );
831  Evaluation<Epetra_Vector> get_g(int j) const;
834  void set_g_sg( int j, const sg_vector_t &g_sg_j );
837  sg_vector_t get_g_sg(int j) const;
840  void set_g_mp( int j, const mp_vector_t &g_mp_j );
843  mp_vector_t get_g_mp(int j) const;
845  void set_W( const Teuchos::RCP<Epetra_Operator> &W );
846  void set_WPrec( const Teuchos::RCP<Epetra_Operator> &WPrec );
848  Teuchos::RCP<Epetra_Operator> get_W() const;
849  Teuchos::RCP<Epetra_Operator> get_WPrec() const;
854  void set_W_sg( const sg_operator_t& W_sg );
856  sg_operator_t get_W_sg() const;
858  void set_W_mp( const mp_operator_t& W_sg );
860  mp_operator_t get_W_mp() const;
862  void set_DfDp(int l, const Derivative &DfDp_l);
864  Derivative get_DfDp(int l) const;
868  void set_DfDp_sg(int l, const SGDerivative &DfDp_sg_l);
870  SGDerivative get_DfDp_sg(int l) const;
874  void set_DfDp_mp(int l, const MPDerivative &DfDp_mp_l);
876  MPDerivative get_DfDp_mp(int l) const;
880  void set_DgDx_dot(int j, const Derivative &DgDx_dot_j);
881  void set_DgDx_dotdot(int j, const Derivative &DgDx_dotdot_j);
883  Derivative get_DgDx_dot(int j) const;
884  Derivative get_DgDx_dotdot(int j) const;
889  void set_DgDx_dot_sg(int j, const SGDerivative &DgDx_dot_j);
890  void set_DgDx_dotdot_sg(int j, const SGDerivative &DgDx_dotdot_j);
892  SGDerivative get_DgDx_dot_sg(int j) const;
893  SGDerivative get_DgDx_dotdot_sg(int j) const;
898  void set_DgDx_dot_mp(int j, const MPDerivative &DgDx_dot_j);
899  void set_DgDx_dotdot_mp(int j, const MPDerivative &DgDx_dotdot_j);
901  MPDerivative get_DgDx_dot_mp(int j) const;
902  MPDerivative get_DgDx_dotdot_mp(int j) const;
907  void set_DgDx(int j, const Derivative &DgDx_j);
909  Derivative get_DgDx(int j) const;
913  void set_DgDx_sg(int j, const SGDerivative &DgDx_j);
915  SGDerivative get_DgDx_sg(int j) const;
919  void set_DgDx_mp(int j, const MPDerivative &DgDx_j);
921  MPDerivative get_DgDx_mp(int j) const;
925  void set_DgDp( int j, int l, const Derivative &DgDp_j_l );
927  Derivative get_DgDp(int j, int l) const;
929  DerivativeProperties get_DgDp_properties(int j, int l) const;
931  void set_DgDp_sg( int j, int l, const SGDerivative &DgDp_sg_j_l );
933  SGDerivative get_DgDp_sg(int j, int l) const;
935  DerivativeProperties get_DgDp_sg_properties(int j, int l) const;
937  void set_DgDp_mp( int j, int l, const MPDerivative &DgDp_mp_j_l );
939  MPDerivative get_DgDp_mp(int j, int l) const;
941  DerivativeProperties get_DgDp_mp_properties(int j, int l) const;
942 
944  void set_f_poly( const Teuchos::RCP<Teuchos::Polynomial<Epetra_Vector> > &f_poly );
946  Teuchos::RCP<Teuchos::Polynomial<Epetra_Vector> > get_f_poly() const;
947 
948 
950  bool funcOrDerivesAreSet(EOutArgsMembers arg) const;
951 
957  void setFailed() const;
963  bool isFailed() const;
964 
965  protected:
967  void _setModelEvalDescription( const std::string &modelEvalDescription );
969  void _set_Np_Ng(int Np, int Ng);
971  void _setSupports( EOutArgsMembers arg, bool supports );
973  void _setSupports( EOutArgsDfDp arg, int l, const DerivativeSupport& );
975  void _setSupports( EOutArgsDgDx_dot arg, int j, const DerivativeSupport& );
976  void _setSupports( EOutArgsDgDx_dotdot arg, int j, const DerivativeSupport& );
978  void _setSupports( EOutArgsDgDx arg, int j, const DerivativeSupport& );
980  void _setSupports( EOutArgsDgDp arg, int j, int l, const DerivativeSupport& );
982  void _setSupports( EOutArgs_g_sg arg, int j, bool supports );
984  void _setSupports( EOutArgsDfDp_sg arg, int l, const DerivativeSupport& );
986  void _setSupports( EOutArgsDgDx_dot_sg arg, int j, const DerivativeSupport& );
987  void _setSupports( EOutArgsDgDx_dotdot_sg arg, int j, const DerivativeSupport& );
989  void _setSupports( EOutArgsDgDx_sg arg, int j, const DerivativeSupport& );
991  void _setSupports( EOutArgsDgDp_sg arg, int j, int l, const DerivativeSupport& );
992 
994  void _setSupports( EOutArgs_g_mp arg, int j, bool supports );
996  void _setSupports( EOutArgsDfDp_mp arg, int l, const DerivativeSupport& );
998  void _setSupports( EOutArgsDgDx_dot_mp arg, int j, const DerivativeSupport& );
999  void _setSupports( EOutArgsDgDx_dotdot_mp arg, int j, const DerivativeSupport& );
1001  void _setSupports( EOutArgsDgDx_mp arg, int j, const DerivativeSupport& );
1003  void _setSupports( EOutArgsDgDp_mp arg, int j, int l, const DerivativeSupport& );
1005  void _set_W_properties( const DerivativeProperties &W_properties );
1006  void _set_WPrec_properties( const DerivativeProperties &WPrec_properties );
1008  void _set_DfDp_properties( int l, const DerivativeProperties &properties );
1010  void _set_DgDx_dot_properties( int j, const DerivativeProperties &properties );
1011  void _set_DgDx_dotdot_properties( int j, const DerivativeProperties &properties );
1013  void _set_DgDx_properties( int j, const DerivativeProperties &properties );
1015  void _set_DgDp_properties( int j, int l, const DerivativeProperties &properties );
1017  void _set_DfDp_sg_properties( int l, const DerivativeProperties &properties );
1019  void _set_DgDx_dot_sg_properties( int j, const DerivativeProperties &properties );
1020  void _set_DgDx_dotdot_sg_properties( int j, const DerivativeProperties &properties );
1022  void _set_DgDx_sg_properties( int j, const DerivativeProperties &properties );
1024  void _set_DgDp_sg_properties( int j, int l, const DerivativeProperties &properties );
1025 
1027  void _set_DfDp_mp_properties( int l, const DerivativeProperties &properties );
1029  void _set_DgDx_dot_mp_properties( int j, const DerivativeProperties &properties );
1030  void _set_DgDx_dotdot_mp_properties( int j, const DerivativeProperties &properties );
1032  void _set_DgDx_mp_properties( int j, const DerivativeProperties &properties );
1034  void _set_DgDp_mp_properties( int j, int l, const DerivativeProperties &properties );
1035  private:
1036  // types
1037  typedef Teuchos::Array<Evaluation<Epetra_Vector> > g_t;
1038  typedef Teuchos::Array<sg_vector_t > g_sg_t;
1039  typedef Teuchos::Array<mp_vector_t > g_mp_t;
1040  typedef Teuchos::Array<Derivative> deriv_t;
1041  typedef Teuchos::Array<SGDerivative> sg_deriv_t;
1042  typedef Teuchos::Array<MPDerivative> mp_deriv_t;
1043  typedef Teuchos::Array<DerivativeProperties> deriv_properties_t;
1044  typedef Teuchos::Array<DerivativeSupport> supports_t;
1045  typedef Teuchos::Array<bool> supports_g_sg_t;
1046  // data
1047  std::string modelEvalDescription_;
1048  mutable bool isFailed_;
1049  bool supports_[NUM_E_OUT_ARGS_MEMBERS];
1050  supports_t supports_DfDp_; // Np
1051  supports_t supports_DgDx_dot_; // Ng
1052  supports_t supports_DgDx_dotdot_; // Ng
1053  supports_t supports_DgDx_; // Ng
1054  supports_t supports_DgDp_; // Ng x Np
1055  supports_g_sg_t supports_g_sg_; // Ng
1056  supports_t supports_DfDp_sg_; // Np
1057  supports_t supports_DgDx_dot_sg_; // Ng
1058  supports_t supports_DgDx_dotdot_sg_; // Ng
1059  supports_t supports_DgDx_sg_; // Ng
1060  supports_t supports_DgDp_sg_; // Ng x Np
1061  supports_g_sg_t supports_g_mp_; // Ng
1062  supports_t supports_DfDp_mp_; // Np_mp
1063  supports_t supports_DgDx_dot_mp_; // Ng_mp
1064  supports_t supports_DgDx_dotdot_mp_; // Ng_mp
1065  supports_t supports_DgDx_mp_; // Ng_mp
1066  supports_t supports_DgDp_mp_; // Ng_mp x Np_mp
1068  g_t g_;
1069  g_sg_t g_sg_;
1070  g_mp_t g_mp_;
1071  Teuchos::RCP<Epetra_Operator> W_;
1072  Teuchos::RCP<Epetra_Operator> WPrec_;
1073  DerivativeProperties W_properties_;
1074  DerivativeProperties WPrec_properties_;
1075  deriv_t DfDp_; // Np
1076  deriv_properties_t DfDp_properties_; // Np
1077  deriv_t DgDx_dot_; // Ng
1078  deriv_t DgDx_dotdot_; // Ng
1079  deriv_t DgDx_; // Ng
1080  deriv_properties_t DgDx_dot_properties_; // Ng
1081  deriv_properties_t DgDx_dotdot_properties_; // Ng
1082  deriv_properties_t DgDx_properties_; // Ng
1083  deriv_t DgDp_; // Ng x Np
1084  deriv_properties_t DgDp_properties_; // Ng x Np
1085  Teuchos::RCP<Teuchos::Polynomial<Epetra_Vector> > f_poly_;
1086  sg_vector_t f_sg_;
1087  sg_operator_t W_sg_;
1088  sg_deriv_t DfDp_sg_; // Np
1089  deriv_properties_t DfDp_sg_properties_; // Np
1090  sg_deriv_t DgDx_dot_sg_; // Ng
1091  sg_deriv_t DgDx_dotdot_sg_; // Ng
1092  sg_deriv_t DgDx_sg_; // Ng
1093  deriv_properties_t DgDx_dot_sg_properties_; // Ng
1094  deriv_properties_t DgDx_dotdot_sg_properties_; // Ng
1095  deriv_properties_t DgDx_sg_properties_; // Ng
1096  sg_deriv_t DgDp_sg_; // Ng x Np
1097  deriv_properties_t DgDp_sg_properties_; // Ng x Np
1098  mp_vector_t f_mp_;
1099  mp_operator_t W_mp_;
1100  mp_deriv_t DfDp_mp_; // Np
1101  deriv_properties_t DfDp_mp_properties_; // Np
1102  mp_deriv_t DgDx_dot_mp_; // Ng
1103  mp_deriv_t DgDx_dotdot_mp_; // Ng
1104  mp_deriv_t DgDx_mp_; // Ng
1105  deriv_properties_t DgDx_dot_mp_properties_; // Ng
1106  deriv_properties_t DgDx_dotdot_mp_properties_; // Ng
1107  deriv_properties_t DgDx_mp_properties_; // Ng
1108  mp_deriv_t DgDp_mp_; // Ng x Np
1109  deriv_properties_t DgDp_mp_properties_; // Ng x Np
1110  // functions
1111  void assert_supports(EOutArgsMembers arg) const;
1112  void assert_supports(EOutArgsDfDp arg, int l) const;
1113  void assert_supports(EOutArgsDgDx_dot arg, int j) const;
1114  void assert_supports(EOutArgsDgDx_dotdot arg, int j) const;
1115  void assert_supports(EOutArgsDgDx arg, int j) const;
1116  void assert_supports(EOutArgsDgDp arg, int j, int l) const;
1117  void assert_supports(EOutArgs_g_sg arg, int j) const;
1118  void assert_supports(EOutArgsDfDp_sg arg, int l) const;
1119  void assert_supports(EOutArgsDgDx_dot_sg arg, int j) const;
1120  void assert_supports(EOutArgsDgDx_dotdot_sg arg, int j) const;
1121  void assert_supports(EOutArgsDgDx_sg arg, int j) const;
1122  void assert_supports(EOutArgsDgDp_sg arg, int j, int l) const;
1123  void assert_supports(EOutArgs_g_mp arg, int j) const;
1124  void assert_supports(EOutArgsDfDp_mp arg, int l) const;
1125  void assert_supports(EOutArgsDgDx_dot_mp arg, int j) const;
1126  void assert_supports(EOutArgsDgDx_dotdot_mp arg, int j) const;
1127  void assert_supports(EOutArgsDgDx_mp arg, int j) const;
1128  void assert_supports(EOutArgsDgDp_mp arg, int j, int l) const;
1129  void assert_l(int l) const;
1130  void assert_j(int j) const;
1131  };
1132 
1134 
1137 
1139  virtual ~ModelEvaluator();
1140 
1142 
1145 
1147  virtual Teuchos::RCP<const Epetra_Map> get_x_map() const = 0;
1148 
1150  virtual Teuchos::RCP<const Epetra_Map> get_f_map() const = 0;
1151 
1153  virtual Teuchos::RCP<const Epetra_Map> get_p_map(int l) const;
1154 
1169  virtual Teuchos::RCP<const Teuchos::Array<std::string> > get_p_names(int l) const;
1170 
1172  virtual Teuchos::RCP<const Epetra_Map> get_g_map(int j) const;
1173 
1188  virtual Teuchos::ArrayView<const std::string> get_g_names(int j) const;
1189 
1191 
1194 
1196  virtual Teuchos::RCP<const Epetra_Vector> get_x_init() const;
1197 
1199  virtual Teuchos::RCP<const Epetra_Vector> get_x_dot_init() const;
1200 
1202  virtual Teuchos::RCP<const Epetra_Vector> get_x_dotdot_init() const;
1203 
1205  virtual Teuchos::RCP<const Epetra_Vector> get_p_init(int l) const;
1206 
1208  virtual double get_t_init() const;
1209 
1211 
1214 
1219  virtual double getInfBound() const;
1220 
1222  virtual Teuchos::RCP<const Epetra_Vector> get_x_lower_bounds() const;
1223 
1225  virtual Teuchos::RCP<const Epetra_Vector> get_x_upper_bounds() const;
1226 
1228  virtual Teuchos::RCP<const Epetra_Vector> get_p_lower_bounds(int l) const;
1229 
1231  virtual Teuchos::RCP<const Epetra_Vector> get_p_upper_bounds(int l) const;
1232 
1234  virtual double get_t_lower_bound() const;
1235 
1237  virtual double get_t_upper_bound() const;
1238 
1240 
1243 
1250  virtual Teuchos::RCP<Epetra_Operator> create_W() const;
1251  virtual Teuchos::RCP<EpetraExt::ModelEvaluator::Preconditioner> create_WPrec() const;
1252 
1254  virtual Teuchos::RCP<Epetra_Operator> create_DfDp_op(int l) const;
1255 
1257  virtual Teuchos::RCP<Epetra_Operator> create_DgDx_dot_op(int j) const;
1258 
1260  virtual Teuchos::RCP<Epetra_Operator> create_DgDx_dotdot_op(int j) const;
1261 
1263  virtual Teuchos::RCP<Epetra_Operator> create_DgDx_op(int j) const;
1264 
1266  virtual Teuchos::RCP<Epetra_Operator> create_DgDp_op( int j, int l ) const;
1267 
1269 
1272 
1274  virtual InArgs createInArgs() const = 0;
1275 
1277  virtual OutArgs createOutArgs() const = 0;
1278 
1280  virtual void evalModel( const InArgs& inArgs, const OutArgs& outArgs ) const = 0;
1281 
1282 #ifdef HAVE_PYTRILINOS
1283 
1284  friend InArgs convertInArgsFromPython(PyObject * source);
1285 
1287  friend OutArgs convertOutArgsFromPython(PyObject * source);
1288 #endif
1289 
1290 
1291 protected:
1292 
1295 
1297  class InArgsSetup : public InArgs {
1298  public:
1300  void setModelEvalDescription( const std::string &modelEvalDescription );
1302  void set_Np(int Np);
1304  void setSupports( EInArgsMembers arg, bool supports = true );
1306  void setSupports( EInArgs_p_sg arg, int l, bool supports );
1308  void setSupports( EInArgs_p_mp arg, int l, bool supports );
1309  };
1310 
1312  class OutArgsSetup : public OutArgs {
1313  public:
1315  void setModelEvalDescription( const std::string &modelEvalDescription );
1317  void set_Np_Ng(int Np, int Ng);
1319  void setSupports( EOutArgsMembers arg, bool supports = true );
1321  void setSupports(EOutArgsDfDp arg, int l, const DerivativeSupport& );
1323  void setSupports(EOutArgsDgDx_dot arg, int j, const DerivativeSupport& );
1324  void setSupports(EOutArgsDgDx_dotdot arg, int j, const DerivativeSupport& );
1326  void setSupports(EOutArgsDgDx arg, int j, const DerivativeSupport& );
1328  void setSupports(EOutArgsDgDp arg, int j, int l, const DerivativeSupport& );
1330  void setSupports( EOutArgs_g_sg arg, int j, bool supports );
1332  void setSupports(EOutArgsDfDp_sg arg, int l, const DerivativeSupport& );
1334  void setSupports(EOutArgsDgDx_dot_sg arg, int j, const DerivativeSupport& );
1335  void setSupports(EOutArgsDgDx_dotdot_sg arg, int j, const DerivativeSupport& );
1337  void setSupports(EOutArgsDgDx_sg arg, int j, const DerivativeSupport& );
1339  void setSupports(EOutArgsDgDp_sg arg, int j, int l, const DerivativeSupport& );
1341  void setSupports( EOutArgs_g_mp arg, int j, bool supports );
1343  void setSupports(EOutArgsDfDp_mp arg, int l, const DerivativeSupport& );
1345  void setSupports(EOutArgsDgDx_dot_mp arg, int j, const DerivativeSupport& );
1346  void setSupports(EOutArgsDgDx_dotdot_mp arg, int j, const DerivativeSupport& );
1348  void setSupports(EOutArgsDgDx_mp arg, int j, const DerivativeSupport& );
1350  void setSupports(EOutArgsDgDp_mp arg, int j, int l, const DerivativeSupport& );
1352  void set_W_properties( const DerivativeProperties &properties );
1353  void set_WPrec_properties( const DerivativeProperties &properties );
1355  void set_DfDp_properties( int l, const DerivativeProperties &properties );
1357  void set_DgDx_dot_properties( int j, const DerivativeProperties &properties );
1358  void set_DgDx_dotdot_properties( int j, const DerivativeProperties &properties );
1360  void set_DgDx_properties( int j, const DerivativeProperties &properties );
1362  void set_DgDp_properties( int j, int l, const DerivativeProperties &properties );
1364  void set_DfDp_sg_properties( int l, const DerivativeProperties &properties );
1366  void set_DgDx_dot_sg_properties( int j, const DerivativeProperties &properties );
1367  void set_DgDx_dotdot_sg_properties( int j, const DerivativeProperties &properties );
1369  void set_DgDx_sg_properties( int j, const DerivativeProperties &properties );
1371  void set_DgDp_sg_properties( int j, int l, const DerivativeProperties &properties );
1373  void set_DfDp_mp_properties( int l, const DerivativeProperties &properties );
1375  void set_DgDx_dot_mp_properties( int j, const DerivativeProperties &properties );
1376  void set_DgDx_dotdot_mp_properties( int j, const DerivativeProperties &properties );
1378  void set_DgDx_mp_properties( int j, const DerivativeProperties &properties );
1380  void set_DgDp_mp_properties( int j, int l, const DerivativeProperties &properties );
1381  };
1382 
1384 
1385 };
1386 
1387 // ////////////////////////////
1388 // Helper functions
1389 
1392 
1394 std::string toString( ModelEvaluator::EInArgsMembers inArg );
1395 
1397 std::string toString( ModelEvaluator::EOutArgsMembers outArg );
1398 
1400 Teuchos::RCP<Epetra_Operator>
1401 getLinearOp(
1402  const std::string &modelEvalDescription,
1403  const ModelEvaluator::Derivative &deriv,
1404  const std::string &derivName
1405  );
1406 
1408 Teuchos::RCP<Epetra_MultiVector>
1410  const std::string &modelEvalDescription,
1411  const ModelEvaluator::Derivative &deriv,
1412  const std::string &derivName,
1414  );
1415 
1417 Teuchos::RCP<Epetra_Operator>
1418 get_DfDp_op(
1419  const int l
1420  ,const ModelEvaluator::OutArgs &outArgs
1421  );
1422 
1424 Teuchos::RCP<Epetra_MultiVector>
1425 get_DfDp_mv(
1426  const int l
1427  ,const ModelEvaluator::OutArgs &outArgs
1428  );
1429 
1431 Teuchos::RCP<Epetra_MultiVector>
1433  const int j
1434  ,const ModelEvaluator::OutArgs &outArgs
1436  );
1437 
1439 Teuchos::RCP<Epetra_MultiVector>
1441  const int j
1442  ,const ModelEvaluator::OutArgs &outArgs
1444  );
1445 
1447 Teuchos::RCP<Epetra_MultiVector>
1448 get_DgDx_mv(
1449  const int j
1450  ,const ModelEvaluator::OutArgs &outArgs
1452  );
1453 
1455 Teuchos::RCP<Epetra_MultiVector>
1456 get_DgDp_mv(
1457  const int j
1458  ,const int l
1459  ,const ModelEvaluator::OutArgs &outArgs
1461  );
1462 
1463 // ///////////////////////////
1464 // Inline Functions
1465 
1466 //
1467 // ModelEvaluator::InArgs
1468 //
1469 
1470 inline
1472 { return modelEvalDescription_; }
1473 
1474 inline
1476 { return p_.size(); }
1477 
1478 inline
1479 void ModelEvaluator::InArgs::set_x_dot( const Teuchos::RCP<const Epetra_Vector> &x_dot )
1480 { assert_supports(IN_ARG_x_dot); x_dot_ = x_dot; }
1481 
1482 inline
1483 void ModelEvaluator::InArgs::set_x_dotdot( const Teuchos::RCP<const Epetra_Vector> &x_dotdot )
1484 { assert_supports(IN_ARG_x_dotdot); x_dotdot_ = x_dotdot; }
1485 
1486 inline
1487 Teuchos::RCP<const Epetra_Vector> ModelEvaluator::InArgs::get_x_dot() const
1488 { assert_supports(IN_ARG_x_dot); return x_dot_; }
1489 
1490 inline
1491 Teuchos::RCP<const Epetra_Vector> ModelEvaluator::InArgs::get_x_dotdot() const
1492 { assert_supports(IN_ARG_x_dotdot); return x_dotdot_; }
1493 
1494 inline
1495 void ModelEvaluator::InArgs::set_x( const Teuchos::RCP<const Epetra_Vector> &x )
1496 { assert_supports(IN_ARG_x); x_ = x; }
1497 
1498 inline
1499 Teuchos::RCP<const Epetra_Vector> ModelEvaluator::InArgs::get_x() const
1500 { assert_supports(IN_ARG_x); return x_; }
1501 
1502 inline
1503 void ModelEvaluator::InArgs::set_x_dot_poly( const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_dot_poly )
1504 { assert_supports(IN_ARG_x_dot_poly); x_dot_poly_ = x_dot_poly; }
1505 
1506 inline
1507 void ModelEvaluator::InArgs::set_x_dotdot_poly( const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_dotdot_poly )
1508 { assert_supports(IN_ARG_x_dotdot_poly); x_dotdot_poly_ = x_dotdot_poly; }
1509 
1510 inline
1511 Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> >
1513 { assert_supports(IN_ARG_x_dot_poly); return x_dot_poly_; }
1514 
1515 inline
1516 Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> >
1518 { assert_supports(IN_ARG_x_dotdot_poly); return x_dotdot_poly_; }
1519 
1520 inline
1521 void ModelEvaluator::InArgs::set_x_poly( const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_poly )
1522 { assert_supports(IN_ARG_x_poly); x_poly_ = x_poly; }
1523 
1524 inline
1525 Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> >
1527 { assert_supports(IN_ARG_x_poly); return x_poly_; }
1528 
1529 inline
1531 { assert_supports(IN_ARG_x_dot_sg); x_dot_sg_ = x_dot_sg; }
1532 
1533 inline
1535 { assert_supports(IN_ARG_x_dotdot_sg); x_dotdot_sg_ = x_dotdot_sg; }
1536 
1537 inline
1540 { assert_supports(IN_ARG_x_dot_sg); return x_dot_sg_; }
1541 
1542 inline
1545 { assert_supports(IN_ARG_x_dotdot_sg); return x_dotdot_sg_; }
1546 
1547 inline
1549 { assert_supports(IN_ARG_x_dot_mp); x_dot_mp_ = x_dot_mp; }
1550 
1551 inline
1553 { assert_supports(IN_ARG_x_dotdot_mp); x_dotdot_mp_ = x_dotdot_mp; }
1554 
1555 inline
1558 { assert_supports(IN_ARG_x_dot_mp); return x_dot_mp_; }
1559 
1560 inline
1563 { assert_supports(IN_ARG_x_dotdot_mp); return x_dotdot_mp_; }
1564 
1565 inline
1567 { assert_supports(IN_ARG_x_sg); x_sg_ = x_sg; }
1568 
1569 inline
1572 { assert_supports(IN_ARG_x_sg); return x_sg_; }
1573 
1574 inline
1576 { assert_supports(IN_ARG_x_mp); x_mp_ = x_mp; }
1577 
1578 inline
1581 { assert_supports(IN_ARG_x_mp); return x_mp_; }
1582 
1583 inline
1584 void ModelEvaluator::InArgs::set_p( int l, const Teuchos::RCP<const Epetra_Vector> &p_l )
1585 { assert_l(l); p_[l] = p_l; }
1586 
1587 inline
1588 Teuchos::RCP<const Epetra_Vector> ModelEvaluator::InArgs::get_p(int l) const
1589 { assert_l(l); return p_[l]; }
1590 
1591 inline
1594 { assert_supports(IN_ARG_p_sg, l); p_sg_[l] = p_sg_l; }
1595 
1596 inline
1599 { assert_supports(IN_ARG_p_sg, l); return p_sg_[l]; }
1600 
1601 inline
1603  const ModelEvaluator::mp_const_vector_t &p_mp_l )
1604 { assert_supports(IN_ARG_p_mp, l); p_mp_[l] = p_mp_l; }
1605 
1606 inline
1609 { assert_supports(IN_ARG_p_mp, l); return p_mp_[l]; }
1610 
1611 inline
1613 { assert_supports(IN_ARG_t); t_ = t; }
1614 
1615 inline
1617 { assert_supports(IN_ARG_t); return t_; }
1618 
1619 inline
1621 { assert_supports(IN_ARG_alpha); alpha_ = alpha; }
1622 
1623 inline
1625 { assert_supports(IN_ARG_alpha); return alpha_; }
1626 
1627 inline
1629 { assert_supports(IN_ARG_omega); omega_ = omega; }
1630 
1631 inline
1633 { assert_supports(IN_ARG_omega); return omega_; }
1634 
1635 inline
1637 { assert_supports(IN_ARG_beta); beta_ = beta; }
1638 
1639 inline
1641 { assert_supports(IN_ARG_beta); return beta_; }
1642 
1643 inline
1645 { assert_supports(IN_ARG_step_size); step_size_ = step_size; }
1646 
1647 inline
1649 { assert_supports(IN_ARG_step_size); return step_size_; }
1650 
1651 inline
1653 { assert_supports(IN_ARG_stage_number); stage_number_ = stage_number; }
1654 
1655 inline
1657 { assert_supports(IN_ARG_stage_number); return stage_number_; }
1658 
1659  inline
1661 { assert_supports(IN_ARG_sg_basis); sg_basis_ = basis; }
1662 
1663 inline
1664 Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> >
1666 { assert_supports(IN_ARG_sg_basis); return sg_basis_; }
1667 
1668 inline
1670 { assert_supports(IN_ARG_sg_quadrature); sg_quad_ = quad; }
1671 
1672 inline
1673 Teuchos::RCP<const Stokhos::Quadrature<int,double> >
1675 { assert_supports(IN_ARG_sg_quadrature); return sg_quad_; }
1676 
1677 inline
1679 { assert_supports(IN_ARG_sg_expansion); sg_exp_ = exp; }
1680 
1681 inline
1682 Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > >
1684 { assert_supports(IN_ARG_sg_expansion); return sg_exp_; }
1685 
1686 inline
1687 void ModelEvaluator::InArgs::_setModelEvalDescription( const std::string &new_modelEvalDescription )
1688 {
1689  modelEvalDescription_ = new_modelEvalDescription;
1690 }
1691 
1692 inline
1694 {
1695  p_.resize(new_Np);
1696  p_sg_.resize(new_Np);
1697  p_mp_.resize(new_Np);
1698  supports_p_sg_.resize(new_Np);
1699  supports_p_mp_.resize(new_Np);
1700 }
1701 
1702 //
1703 // ModelEvaluator::OutArgs
1704 //
1705 
1706 inline
1708 { return modelEvalDescription_; }
1709 
1710 inline
1712 {
1713  return DfDp_.size();
1714 }
1715 
1716 inline
1718 {
1719  return g_.size();
1720 }
1721 
1722 inline
1724 
1725 inline
1727 ModelEvaluator::OutArgs::get_f() const { return f_; }
1728 
1729 inline
1731 {
1732  assert_j(j);
1733  g_[j] = g_j;
1734 }
1735 
1736 inline
1739 {
1740  assert_j(j);
1741  return g_[j];
1742 }
1743 
1744 inline
1746 {
1747  assert_supports(OUT_ARG_g_sg, j);
1748  g_sg_[j] = g_sg_j;
1749 }
1750 
1751 inline
1754 {
1755  assert_supports(OUT_ARG_g_sg, j);
1756  return g_sg_[j];
1757 }
1758 
1759 inline
1761 {
1762  assert_supports(OUT_ARG_g_mp, j);
1763  g_mp_[j] = g_mp_j;
1764 }
1765 
1766 inline
1769 {
1770  assert_supports(OUT_ARG_g_mp, j);
1771  return g_mp_[j];
1772 }
1773 
1774 inline
1775 void ModelEvaluator::OutArgs::set_W( const Teuchos::RCP<Epetra_Operator> &W ) { W_ = W; }
1776 inline
1777 void ModelEvaluator::OutArgs::set_WPrec( const Teuchos::RCP<Epetra_Operator> &WPrec ) { WPrec_ = WPrec; }
1778 
1779 inline
1780 Teuchos::RCP<Epetra_Operator> ModelEvaluator::OutArgs::get_W() const { return W_; }
1781 inline
1782 Teuchos::RCP<Epetra_Operator> ModelEvaluator::OutArgs::get_WPrec() const { return WPrec_; }
1783 
1784 inline
1786 { return W_properties_; }
1787 inline
1789 { return WPrec_properties_; }
1790 
1791 inline
1792 void ModelEvaluator::OutArgs::set_DfDp( int l, const Derivative &DfDp_l )
1793 {
1794  assert_supports(OUT_ARG_DfDp,l);
1795  DfDp_[l] = DfDp_l;
1796 }
1797 
1798 inline
1801 {
1802  assert_supports(OUT_ARG_DfDp,l);
1803  return DfDp_[l];
1804 }
1805 
1806 inline
1809 {
1810  assert_supports(OUT_ARG_DfDp,l);
1811  return DfDp_properties_[l];
1812 }
1813 
1814 inline
1816 {
1817  assert_supports(OUT_ARG_DfDp_sg,l);
1818  DfDp_sg_[l] = DfDp_sg_l;
1819 }
1820 
1821 inline
1824 {
1825  assert_supports(OUT_ARG_DfDp_sg,l);
1826  return DfDp_sg_[l];
1827 }
1828 
1829 inline
1832 {
1833  assert_supports(OUT_ARG_DfDp_sg,l);
1834  return DfDp_sg_properties_[l];
1835 }
1836 
1837 inline
1839 {
1840  assert_supports(OUT_ARG_DfDp_mp,l);
1841  DfDp_mp_[l] = DfDp_mp_l;
1842 }
1843 
1844 inline
1847 {
1848  assert_supports(OUT_ARG_DfDp_mp,l);
1849  return DfDp_mp_[l];
1850 }
1851 
1852 inline
1855 {
1856  assert_supports(OUT_ARG_DfDp_mp,l);
1857  return DfDp_mp_properties_[l];
1858 }
1859 
1860 inline
1861 void ModelEvaluator::OutArgs::set_DgDx_dot( int j, const Derivative &DgDx_dot_j )
1862 {
1863  assert_supports(OUT_ARG_DgDx_dot,j);
1864  DgDx_dot_[j] = DgDx_dot_j;
1865 }
1866 
1867 inline
1870 {
1871  assert_supports(OUT_ARG_DgDx_dot,j);
1872  return DgDx_dot_[j];
1873 }
1874 
1875 inline
1878 {
1879  assert_supports(OUT_ARG_DgDx_dot,j);
1880  return DgDx_dot_properties_[j];
1881 }
1882 
1883 inline
1884 void ModelEvaluator::OutArgs::set_DgDx_dot_sg( int j, const SGDerivative &DgDx_dot_sg_j )
1885 {
1886  assert_supports(OUT_ARG_DgDx_dot_sg,j);
1887  DgDx_dot_sg_[j] = DgDx_dot_sg_j;
1888 }
1889 
1890 inline
1893 {
1894  assert_supports(OUT_ARG_DgDx_dot_sg,j);
1895  return DgDx_dot_sg_[j];
1896 }
1897 
1898 inline
1901 {
1902  assert_supports(OUT_ARG_DgDx_dot_sg,j);
1903  return DgDx_dot_sg_properties_[j];
1904 }
1905 
1906 inline
1907 void ModelEvaluator::OutArgs::set_DgDx_dot_mp( int j, const MPDerivative &DgDx_dot_mp_j )
1908 {
1909  assert_supports(OUT_ARG_DgDx_dot_mp,j);
1910  DgDx_dot_mp_[j] = DgDx_dot_mp_j;
1911 }
1912 
1913 inline
1916 {
1917  assert_supports(OUT_ARG_DgDx_dot_mp,j);
1918  return DgDx_dot_mp_[j];
1919 }
1920 
1921 inline
1924 {
1925  assert_supports(OUT_ARG_DgDx_dot_mp,j);
1926  return DgDx_dot_mp_properties_[j];
1927 }
1928 
1929 inline
1930 void ModelEvaluator::OutArgs::set_DgDx_dotdot( int j, const Derivative &DgDx_dotdot_j )
1931 {
1932  assert_supports(OUT_ARG_DgDx_dotdot,j);
1933  DgDx_dotdot_[j] = DgDx_dotdot_j;
1934 }
1935 
1936 inline
1939 {
1940  assert_supports(OUT_ARG_DgDx_dotdot,j);
1941  return DgDx_dotdot_[j];
1942 }
1943 
1944 inline
1947 {
1948  assert_supports(OUT_ARG_DgDx_dotdot,j);
1949  return DgDx_dotdot_properties_[j];
1950 }
1951 
1952 inline
1953 void ModelEvaluator::OutArgs::set_DgDx_dotdot_sg( int j, const SGDerivative &DgDx_dotdot_sg_j )
1954 {
1955  assert_supports(OUT_ARG_DgDx_dotdot_sg,j);
1956  DgDx_dotdot_sg_[j] = DgDx_dotdot_sg_j;
1957 }
1958 
1959 inline
1962 {
1963  assert_supports(OUT_ARG_DgDx_dotdot_sg,j);
1964  return DgDx_dotdot_sg_[j];
1965 }
1966 
1967 inline
1970 {
1971  assert_supports(OUT_ARG_DgDx_dotdot_sg,j);
1972  return DgDx_dotdot_sg_properties_[j];
1973 }
1974 
1975 inline
1976 void ModelEvaluator::OutArgs::set_DgDx_dotdot_mp( int j, const MPDerivative &DgDx_dotdot_mp_j )
1977 {
1978  assert_supports(OUT_ARG_DgDx_dotdot_mp,j);
1979  DgDx_dotdot_mp_[j] = DgDx_dotdot_mp_j;
1980 }
1981 
1982 inline
1985 {
1986  assert_supports(OUT_ARG_DgDx_dotdot_mp,j);
1987  return DgDx_dotdot_mp_[j];
1988 }
1989 
1990 inline
1993 {
1994  assert_supports(OUT_ARG_DgDx_dotdot_mp,j);
1995  return DgDx_dotdot_mp_properties_[j];
1996 }
1997 
1998 inline
1999 void ModelEvaluator::OutArgs::set_DgDx( int j, const Derivative &DgDx_j )
2000 {
2001  assert_supports(OUT_ARG_DgDx,j);
2002  DgDx_[j] = DgDx_j;
2003 }
2004 
2005 inline
2008 {
2009  assert_supports(OUT_ARG_DgDx,j);
2010  return DgDx_[j];
2011 }
2012 
2013 inline
2016 {
2017  assert_supports(OUT_ARG_DgDx,j);
2018  return DgDx_properties_[j];
2019 }
2020 
2021 inline
2023 {
2024  assert_supports(OUT_ARG_DgDx_sg,j);
2025  DgDx_sg_[j] = DgDx_sg_j;
2026 }
2027 
2028 inline
2031 {
2032  assert_supports(OUT_ARG_DgDx_sg,j);
2033  return DgDx_sg_[j];
2034 }
2035 
2036 inline
2039 {
2040  assert_supports(OUT_ARG_DgDx_sg,j);
2041  return DgDx_sg_properties_[j];
2042 }
2043 
2044 inline
2046 {
2047  assert_supports(OUT_ARG_DgDx_mp,j);
2048  DgDx_mp_[j] = DgDx_mp_j;
2049 }
2050 
2051 inline
2054 {
2055  assert_supports(OUT_ARG_DgDx_mp,j);
2056  return DgDx_mp_[j];
2057 }
2058 
2059 inline
2062 {
2063  assert_supports(OUT_ARG_DgDx_mp,j);
2064  return DgDx_mp_properties_[j];
2065 }
2066 
2067 inline
2068 void ModelEvaluator::OutArgs::set_DgDp( int j, int l, const Derivative &DgDp_j_l )
2069 {
2070  assert_supports(OUT_ARG_DgDp,j,l);
2071  DgDp_[ j*Np() + l ] = DgDp_j_l;
2072 }
2073 
2074 inline
2077 {
2078  assert_supports(OUT_ARG_DgDp,j,l);
2079  return DgDp_[ j*Np() + l ];
2080 }
2081 
2082 inline
2085 {
2086  assert_supports(OUT_ARG_DgDp,j,l);
2087  return DgDp_properties_[ j*Np() + l ];
2088 }
2089 
2090 inline
2091 void ModelEvaluator::OutArgs::set_DgDp_sg( int j, int l, const SGDerivative &DgDp_sg_j_l )
2092 {
2093  assert_supports(OUT_ARG_DgDp_sg,j,l);
2094  DgDp_sg_[ j*Np() + l ] = DgDp_sg_j_l;
2095 }
2096 
2097 inline
2100 {
2101  assert_supports(OUT_ARG_DgDp_sg,j,l);
2102  return DgDp_sg_[ j*Np() + l ];
2103 }
2104 
2105 inline
2108 {
2109  assert_supports(OUT_ARG_DgDp_sg,j,l);
2110  return DgDp_sg_properties_[ j*Np() + l ];
2111 }
2112 
2113 inline
2114 void ModelEvaluator::OutArgs::set_DgDp_mp( int j, int l, const MPDerivative &DgDp_mp_j_l )
2115 {
2116  assert_supports(OUT_ARG_DgDp_mp,j,l);
2117  DgDp_mp_[ j*Np() + l ] = DgDp_mp_j_l;
2118 }
2119 
2120 inline
2123 {
2124  assert_supports(OUT_ARG_DgDp_mp,j,l);
2125  return DgDp_mp_[ j*Np() + l ];
2126 }
2127 
2128 inline
2131 {
2132  assert_supports(OUT_ARG_DgDp_mp,j,l);
2133  return DgDp_mp_properties_[ j*Np() + l ];
2134 }
2135 
2136 inline
2137 void ModelEvaluator::OutArgs::set_f_poly( const Teuchos::RCP<Teuchos::Polynomial<Epetra_Vector> > &f_poly )
2138 { f_poly_ = f_poly; }
2139 
2140 inline
2141 Teuchos::RCP<Teuchos::Polynomial<Epetra_Vector> >
2143 { return f_poly_; }
2144 
2145 inline
2147 { f_sg_ = f_sg; }
2148 
2149 inline
2152 { return f_sg_; }
2153 
2154 inline
2156 
2157 inline
2159 
2160 inline
2162 { f_mp_ = f_mp; }
2163 
2164 inline
2167 { return f_mp_; }
2168 
2169 inline
2171 
2172 inline
2174 
2175 //
2176 // ModelEvaluator::InArgsSetup
2177 //
2178 
2179 inline
2180 void ModelEvaluator::InArgsSetup::setModelEvalDescription( const std::string &new_modelEvalDescription )
2181 {
2182  this->_setModelEvalDescription(new_modelEvalDescription);
2183 }
2184 
2185 inline
2187 { this->_set_Np(new_Np); }
2188 
2189 inline
2191 { this->_setSupports(arg,new_supports); }
2192 
2193 inline
2194 void ModelEvaluator::InArgsSetup::setSupports( EInArgs_p_sg arg, int l, bool new_supports )
2195 { this->_setSupports(arg,l,new_supports); }
2196 
2197 inline
2198 void ModelEvaluator::InArgsSetup::setSupports( EInArgs_p_mp arg, int l, bool new_supports )
2199 { this->_setSupports(arg,l,new_supports); }
2200 
2201 //
2202 // ModelEvaluator::OutArgsSetup
2203 //
2204 
2205 inline
2206 void ModelEvaluator::OutArgsSetup::setModelEvalDescription( const std::string &new_modelEvalDescription )
2207 {
2208  this->_setModelEvalDescription(new_modelEvalDescription);
2209 }
2210 
2211 inline
2212 void ModelEvaluator::OutArgsSetup::set_Np_Ng(int new_Np, int new_Ng)
2213 { this->_set_Np_Ng(new_Np,new_Ng); }
2214 
2215 inline
2217 { this->_setSupports(arg,new_supports); }
2218 
2219 inline
2221 { this->_setSupports(arg,l,new_supports); }
2222 
2223 inline
2225 { this->_setSupports(arg,j,new_supports); }
2226 
2227 inline
2229 { this->_setSupports(arg,j,new_supports); }
2230 
2231 inline
2233 { this->_setSupports(arg,j,new_supports); }
2234 
2235 inline
2236 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgsDgDp arg, int j, int l, const DerivativeSupport& new_supports )
2237 { this->_setSupports(arg,j,l,new_supports); }
2238 
2239 inline
2240 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgs_g_sg arg, int j, bool new_supports )
2241 { this->_setSupports(arg,j,new_supports); }
2242 
2243 inline
2245 { this->_setSupports(arg,l,new_supports); }
2246 
2247 inline
2249 { this->_setSupports(arg,j,new_supports); }
2250 
2251 inline
2253 { this->_setSupports(arg,j,new_supports); }
2254 
2255 inline
2257 { this->_setSupports(arg,j,new_supports); }
2258 
2259 inline
2261 { this->_setSupports(arg,j,l,new_supports); }
2262 
2263 inline
2264 void ModelEvaluator::OutArgsSetup::setSupports( EOutArgs_g_mp arg, int j, bool new_supports )
2265 { this->_setSupports(arg,j,new_supports); }
2266 
2267 inline
2269 { this->_setSupports(arg,l,new_supports); }
2270 
2271 inline
2273 { this->_setSupports(arg,j,new_supports); }
2274 
2275 inline
2277 { this->_setSupports(arg,j,new_supports); }
2278 
2279 inline
2281 { this->_setSupports(arg,j,new_supports); }
2282 
2283 inline
2285 { this->_setSupports(arg,j,l,new_supports); }
2286 
2287 inline
2289 { this->_set_W_properties(properties); }
2290 inline
2292 { this->_set_WPrec_properties(properties); }
2293 
2294 inline
2296 {
2297  this->_set_DfDp_properties(l,properties);
2298 }
2299 
2300 inline
2302 {
2303  this->_set_DgDx_dot_properties(j,properties);
2304 }
2305 
2306 inline
2308 {
2309  this->_set_DgDx_dotdot_properties(j,properties);
2310 }
2311 
2312 inline
2314 {
2315  this->_set_DgDx_properties(j,properties);
2316 }
2317 
2318 inline
2320 {
2321  this->_set_DgDp_properties(j,l,properties);
2322 }
2323 
2324 inline
2326 {
2327  this->_set_DfDp_sg_properties(l,properties);
2328 }
2329 
2330 inline
2332 {
2333  this->_set_DgDx_dot_sg_properties(j,properties);
2334 }
2335 
2336 inline
2338 {
2339  this->_set_DgDx_dotdot_sg_properties(j,properties);
2340 }
2341 
2342 inline
2344 {
2345  this->_set_DgDx_sg_properties(j,properties);
2346 }
2347 
2348 inline
2350 {
2351  this->_set_DgDp_sg_properties(j,l,properties);
2352 }
2353 
2354 inline
2356 {
2357  this->_set_DfDp_mp_properties(l,properties);
2358 }
2359 
2360 inline
2362 {
2363  this->_set_DgDx_dot_mp_properties(j,properties);
2364 }
2365 
2366 inline
2368 {
2369  this->_set_DgDx_dotdot_mp_properties(j,properties);
2370 }
2371 
2372 inline
2374 {
2375  this->_set_DgDx_mp_properties(j,properties);
2376 }
2377 
2378 inline
2380 {
2381  this->_set_DgDp_mp_properties(j,l,properties);
2382 }
2383 
2384 } // namespace EpetraExt
2385 
2386 #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
mp_const_vector_t get_x_mp() const
Get multi-point solution vector.
Teuchos::RCP< const Teuchos::Polynomial< Epetra_Vector > > get_x_dot_poly() const
Get time derivative vector Taylor polynomial.
EDerivativeMultiVectorOrientation getMultiVectorOrientation() const
SGDerivative get_DgDx_dotdot_sg(int j) const
bool supports(EOutArgsMembers arg) const
void set_WPrec_properties(const DerivativeProperties &properties)
MPDerivativeMultiVector(const mp_multivector_t &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL, const Teuchos::Array< int > &paramIndexes=Teuchos::Array< int >())
virtual Teuchos::RCP< const Epetra_Map > get_g_map(int j) const
.
void set_W_properties(const DerivativeProperties &properties)
DerivativeProperties get_DgDx_sg_properties(int j) const
virtual InArgs createInArgs() const =0
mp_const_vector_t get_p_mp(int l) const
Get multi-point parameter vector.
virtual Teuchos::RCP< Epetra_Operator > create_DgDx_op(int j) const
Evaluation< Epetra_Vector > get_g(int j) const
Get g(j) where 0 &lt;= j &amp;&amp; j &lt; this-&gt;Ng().
mp_const_vector_t get_x_dotdot_mp() const
void set_DgDx(int j, const Derivative &DgDx_j)
void setSupports(EOutArgsMembers arg, bool supports=true)
A very approximate derivative (i.e. for a preconditioner)
Teuchos::RCP< const Epetra_Vector > get_x_dotdot() const
void set_x_dotdot_poly(const Teuchos::RCP< const Teuchos::Polynomial< Epetra_Vector > > &x_dotdot_poly)
mp_vector_t get_g_mp(int j) const
Get multi-point response.
Preconditioner()
Default constructor of null Operatir.
Time second derivative vector Taylor polynomial.
void _setSupports(EOutArgsMembers arg, bool supports)
void _set_DfDp_properties(int l, const DerivativeProperties &properties)
virtual Teuchos::RCP< const Epetra_Vector > get_p_init(int l) const
void set_DgDx_sg_properties(int j, const DerivativeProperties &properties)
virtual Teuchos::RCP< const Epetra_Map > get_f_map() const =0
.
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< Teuchos::Polynomial< Epetra_Vector > > get_f_poly() const
Get residual vector Taylor polynomial.
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)
virtual Teuchos::RCP< const Epetra_Vector > get_p_upper_bounds(int l) const
void set_x_dotdot_mp(const mp_const_vector_t &x_dotdot_mp)
Teuchos::RCP< Epetra_Operator > getLinearOp(const std::string &modelEvalDescription, const ModelEvaluator::Derivative &deriv, const std::string &derivName)
Teuchos::RCP< Epetra_MultiVector > get_DgDp_mv(const int j, const int l, const ModelEvaluator::OutArgs &outArgs, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
virtual double get_t_upper_bound() const
Coeff of second derivative term d(x_dotdot)/dx.
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.
SGDerivativeMultiVector(const Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL, const Teuchos::Array< int > &paramIndexes=Teuchos::Array< int >())
bool funcOrDerivesAreSet(EOutArgsMembers arg) const
Return true if the function or its derivatives are set.
DerivativeProperties get_DfDp_sg_properties(int l) const
MPDerivative get_DgDx_dotdot_mp(int j) const
Teuchos::RCP< Epetra_Operator > get_W() const
DerivativeProperties get_DgDx_mp_properties(int j) 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
Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const
void _set_DgDp_mp_properties(int j, int l, const DerivativeProperties &properties)
Teuchos::RCP< Stokhos::ProductEpetraOperator > mp_operator_t
void set_DgDx_dotdot(int j, const Derivative &DgDx_dotdot_j)
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)
SGDerivativeMultiVector getDerivativeMultiVector() const
void setSupports(EInArgsMembers arg, bool supports=true)
Teuchos::RCP< Epetra_Operator > PrecOp
Accessor for the Epetra_Operator.
Teuchos::RCP< const Teuchos::Polynomial< Epetra_Vector > > get_x_poly() const
Get solution vector Taylor polynomial.
DerivativeProperties get_WPrec_properties() const
DerivativeSupport(EDerivativeMultiVectorOrientation mvOrientation)
DerivativeProperties get_DgDp_properties(int j, int l) const
const Teuchos::Array< int > & getParamIndexes() const
DerivativeProperties get_DgDx_properties(int j) const
Teuchos::RCP< Epetra_Operator > getLinearOp() const
bool supports(EDerivativeMultiVectorOrientation mvOrientation) const
DerivativeProperties get_DgDp_mp_properties(int j, int l) const
DerivativeProperties get_W_properties() const
void setFailed() const
Set that the evaluation as a whole failed.
Teuchos::RCP< const Epetra_Vector > get_p(int l) const
void set_DfDp_sg(int l, const SGDerivative &DfDp_sg_l)
DerivativeProperties get_DgDx_dotdot_sg_properties(int j) const
Simple aggregate class that stores a derivative object as a general linear operator or as a multi-vec...
EDerivativeMultiVectorOrientation getOrientation() const
Teuchos::RCP< const Stokhos::Quadrature< int, double > > get_sg_quadrature() const
SGDerivative get_DgDp_sg(int j, int l) const
Teuchos::RCP< Epetra_MultiVector > getMultiVector(const std::string &modelEvalDescription, const ModelEvaluator::Derivative &deriv, const std::string &derivName, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
virtual Teuchos::RCP< Epetra_Operator > create_DgDx_dot_op(int j) const
void changeOrientation(const EDerivativeMultiVectorOrientation orientation)
virtual Teuchos::RCP< const Epetra_Vector > get_x_upper_bounds() const
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)
Multi-point &quot;W&quot; operator.
Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > getLinearOp() const
Simple aggregate class for a derivative object represented as a column-wise multi-vector or its trans...
MPDerivativeMultiVector getDerivativeMultiVector() const
Teuchos::RCP< Epetra_Operator > get_WPrec() const
void set_x_dotdot(const Teuchos::RCP< const Epetra_Vector > &x_dotdot)
Stochastic Galerkin solution vector polynomial.
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)
void set_DgDx_dot(int j, const Derivative &DgDx_dot_j)
DerivativeProperties get_DgDx_dot_sg_properties(int j) const
mp_const_vector_t get_x_dot_mp() const
Get multi-point time derivative vector.
sg_vector_t get_f_sg() const
Get stochastic Galerkin residual vector polynomial.
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)
Teuchos::RCP< Epetra_MultiVector > getMultiVector() const
Evaluation(const Teuchos::RCP< ObjType > &obj)
void _set_DgDx_dotdot_mp_properties(int j, const DerivativeProperties &properties)
void set_DgDx_sg(int j, const SGDerivative &DgDx_j)
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.
Teuchos::RCP< const Stokhos::EpetraVectorOrthogPoly > sg_const_vector_t
Short-hand for stochastic Galerkin vector type.
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)
void setModelEvalDescription(const std::string &modelEvalDescription)
void set_x_dotdot_sg(const sg_const_vector_t &x_dotdot_sg)
virtual Teuchos::RCP< const Epetra_Vector > get_x_lower_bounds() const
Teuchos::RCP< const Teuchos::Polynomial< Epetra_Vector > > get_x_dotdot_poly() const
virtual Teuchos::RCP< const Epetra_Vector > get_x_dotdot_init() const
Teuchos::RCP< Epetra_MultiVector > get_DfDp_mv(const int l, const ModelEvaluator::OutArgs &outArgs)
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)
Simple aggregate class for a derivative object represented as a column-wise multi-vector or its trans...
Teuchos::RCP< Epetra_MultiVector > getMultiVector() const
Derivative get_DgDp(int j, int l) const
void set_DgDx_dot_properties(int j, const DerivativeProperties &properties)
const Teuchos::Array< int > & getParamIndexes() const
Teuchos::RCP< Epetra_Operator > get_DfDp_op(const int l, const ModelEvaluator::OutArgs &outArgs)
sg_operator_t get_W_sg() const
Get stochastic Galerkin W operator polynomial.
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)
Teuchos::RCP< const Epetra_Vector > get_x_dot() const
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 supports(EInArgsMembers arg) const
EDerivativeMultiVectorOrientation getOrientation() const
Teuchos::RCP< Epetra_MultiVector > get_DgDx_mv(const int j, const ModelEvaluator::OutArgs &outArgs, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
void _set_WPrec_properties(const DerivativeProperties &WPrec_properties)
Teuchos::RCP< const Stokhos::OrthogPolyBasis< int, double > > get_sg_basis() const
void set_W(const Teuchos::RCP< Epetra_Operator > &W)
void _set_DgDx_dot_mp_properties(int j, const DerivativeProperties &properties)
virtual Teuchos::RCP< const Epetra_Vector > get_x_dot_init() const
virtual Teuchos::RCP< const Epetra_Map > get_p_map(int l) const
.
Derivative(const Teuchos::RCP< Epetra_Operator > &lo)
void _set_DgDx_dot_properties(int j, const DerivativeProperties &properties)
mp_operator_t get_W_mp() const
Get multi-point W.
void set_sg_expansion(const Teuchos::RCP< Stokhos::OrthogPolyExpansion< int, double, Stokhos::StandardStorage< int, double > > > &exp)
virtual Teuchos::RCP< Epetra_Operator > create_DgDp_op(int j, int l) const
void setModelEvalDescription(const std::string &modelEvalDescription)
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)
Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const
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.
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)
virtual Teuchos::RCP< Epetra_Operator > create_DgDx_dotdot_op(int j) const
void _set_DgDx_dot_sg_properties(int j, const DerivativeProperties &properties)
Multi-point time derivative vector.
EDerivativeMultiVectorOrientation getMultiVectorOrientation() const
sg_vector_t get_g_sg(int j) const
Get stochastic Galerkin vector polynomial response.
DerivativeProperties get_DgDx_dotdot_mp_properties(int j) const
DerivativeProperties get_DfDp_properties(int l) const
void set_x_dot_mp(const mp_const_vector_t &x_dot_mp)
Set multi-point time derivative vector.
bool isFailed() const
Return if the evaluation failed or not.
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 >())
virtual Teuchos::RCP< const Epetra_Vector > get_p_lower_bounds(int l) const
void changeOrientation(const EDerivativeMultiVectorOrientation orientation)
void reset(const Teuchos::RCP< ObjType > &obj, EEvalType evalType)
Simple aggregate struct that stores a preconditioner as an Epetra_Operator and a bool, about whether it is inverted or not.
EDerivativeMultiVectorOrientation getOrientation() const
void _set_DfDp_mp_properties(int l, const DerivativeProperties &properties)
Solution vector Taylor polynomial.
Stochastic Galerkin time derivative vector polynomial.
virtual double getInfBound() const
Return the value of an infinite bound.
sg_const_vector_t get_p_sg(int l) const
Get stochastic Galerkin vector polynomial parameter.
void _set_DgDp_properties(int j, int l, const DerivativeProperties &properties)
Stochastic Galerkin residual vector polynomial.
virtual double get_t_lower_bound() const
Stochastic Galerkin &quot;W&quot; operator polyomial.
Teuchos::RCP< Epetra_MultiVector > get_DgDx_dotdot_mv(const int j, const ModelEvaluator::OutArgs &outArgs, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
SGDerivative(const Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL)
DerivativeSupport(EDerivativeLinearOp, EDerivativeMultiVectorOrientation mvOrientation)
virtual Teuchos::RCP< const Epetra_Vector > get_x_init() const
mp_vector_t get_f_mp() const
Get multi-point residual vector.
void set_DfDp_sg_properties(int l, const DerivativeProperties &properties)
virtual double get_t_init() const
DerivativeProperties get_DgDx_dotdot_properties(int j) const
virtual void evalModel(const InArgs &inArgs, const OutArgs &outArgs) const =0
EDerivativeMultiVectorOrientation getMultiVectorOrientation() const
Teuchos::RCP< Stokhos::ProductEpetraVector > mp_vector_t
void set_DfDp_mp(int l, const MPDerivative &DfDp_mp_l)
void set_DgDx_dotdot_mp_properties(int j, const DerivativeProperties &properties)
Teuchos::RCP< Stokhos::OrthogPolyExpansion< int, double, Stokhos::StandardStorage< int, double > > > get_sg_expansion() const
Time derivative vector Taylor polynomial.
Simple aggregate class for a derivative object represented as a column-wise multi-vector or its trans...
void _set_DgDx_properties(int j, const DerivativeProperties &properties)
virtual Teuchos::RCP< EpetraExt::ModelEvaluator::Preconditioner > create_WPrec() const
void set_DgDx_properties(int j, const DerivativeProperties &properties)
MPDerivative get_DgDp_mp(int j, int l) const
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)
SGDerivative(const SGDerivativeMultiVector &dmv)
DerivativeProperties get_DgDx_dot_mp_properties(int j) const
DerivativeProperties get_DfDp_mp_properties(int l) const
DerivativeProperties get_DgDx_dot_properties(int j) const
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.
virtual Teuchos::RCP< Epetra_Operator > create_DfDp_op(int l) const
void set_x_mp(const mp_const_vector_t &x_mp)
Set multi-point solution vector.
Stochastic Galerkin time second derivative vector polynomial.
const Teuchos::Array< int > & getParamIndexes() const
void set_sg_quadrature(const Teuchos::RCP< const Stokhos::Quadrature< int, double > > &quad)
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)
void _set_DgDx_dotdot_properties(int j, const DerivativeProperties &properties)
void _setSupports(EInArgsMembers arg, bool supports)
void set_f_mp(const mp_vector_t &f_mp)
Set multi-point residual vector.
Evaluation< Epetra_Vector > get_f() 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_sg() const
Get stochastic Galerkin solution vector polynomial.
void _set_DgDx_sg_properties(int j, const DerivativeProperties &properties)
Teuchos::RCP< const Epetra_Vector > get_x() const
Set solution vector Taylor polynomial.
void _set_W_properties(const DerivativeProperties &W_properties)
void changeOrientation(const EDerivativeMultiVectorOrientation orientation)
DerivativeSupport(EDerivativeMultiVectorOrientation mvOrientation1, EDerivativeMultiVectorOrientation mvOrientation2)
DerivativeSupport & plus(EDerivativeLinearOp)
DerivativeProperties get_DgDp_sg_properties(int j, int l) const
virtual OutArgs createOutArgs() const =0
void _set_DgDx_dotdot_sg_properties(int j, const DerivativeProperties &properties)
sg_const_vector_t get_x_dot_sg() const
Get stochastic Galerkin time derivative vector polynomial.
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 &quot;model&quot;.
void set_DgDx_dotdot_properties(int j, const DerivativeProperties &properties)
void _setModelEvalDescription(const std::string &modelEvalDescription)
void _set_DfDp_sg_properties(int l, const DerivativeProperties &properties)
std::string toString(const int &x)
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 &lt;= j &amp;&amp; j &lt; this-&gt;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)
sg_const_vector_t get_x_dotdot_sg() const