EpetraExt Package Browser (Single Doxygen Collection) Development
Loading...
Searching...
No Matches
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
47#include "Teuchos_RCP.hpp"
48#include "Teuchos_Describable.hpp"
49#include "Teuchos_Polynomial.hpp"
50#include "Teuchos_Array.hpp"
51#include "Teuchos_CompilerCodeTweakMacros.hpp"
52
53#ifdef HAVE_PYTRILINOS
54#ifndef PyObject_HEAD
55struct _object;
56typedef _object PyObject;
57#endif
58#endif
59
60class Epetra_Map;
61class Epetra_Vector;
62class Epetra_Operator;
63
64// Forward declaration of Stochastic Galerkin (SG) argument types
65namespace Stokhos {
66 class EpetraVectorOrthogPoly;
67 class EpetraMultiVectorOrthogPoly;
68 class EpetraOperatorOrthogPoly;
69 template <typename ordinal_type, typename scalar_type> class OrthogPolyBasis;
70 template <typename ordinal_type, typename scalar_type> class Quadrature;
71 template <typename ordinal_type, typename scalar_type> class StandardStorage;
72 template <typename ordinal_type, typename scalar_type, typename node_type> class OrthogPolyExpansion;
73
74 class ProductEpetraVector;
75 class ProductEpetraMultiVector;
76 class ProductEpetraOperator;
77}
78
79namespace EpetraExt {
80
85class ModelEvaluator : virtual public Teuchos::Describable {
86public:
87
90
91 typedef Teuchos::RCP<const Stokhos::ProductEpetraVector> mp_const_vector_t;
92 typedef Teuchos::RCP<const Stokhos::ProductEpetraMultiVector> mp_const_multivector_t;
93 typedef Teuchos::RCP<const Stokhos::ProductEpetraOperator > mp_const_operator_t;
94 typedef Teuchos::RCP<Stokhos::ProductEpetraVector> mp_vector_t;
95 typedef Teuchos::RCP<Stokhos::ProductEpetraMultiVector> mp_multivector_t;
96 typedef Teuchos::RCP<Stokhos::ProductEpetraOperator > mp_operator_t;
97
122 static const int NUM_E_IN_ARGS_MEMBERS=21;
123
128
133
135 class InArgs {
136 public:
137
139 typedef Teuchos::RCP<const Stokhos::EpetraVectorOrthogPoly> sg_const_vector_t;
140
142 InArgs();
144 std::string modelEvalDescription() const;
146 int Np() const;
148 void set_x_dot( const Teuchos::RCP<const Epetra_Vector> &x_dot );
150 void set_x_dotdot( const Teuchos::RCP<const Epetra_Vector> &x_dotdot );
152 Teuchos::RCP<const Epetra_Vector> get_x_dot() const;
154 Teuchos::RCP<const Epetra_Vector> get_x_dotdot() const;
156 void set_x( const Teuchos::RCP<const Epetra_Vector> &x );
158 Teuchos::RCP<const Epetra_Vector> get_x() const;
159 void set_x_poly(
160 const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_poly
161 );
163 Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > get_x_poly() const;
165 void set_x_dot_poly(
166 const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_dot_poly
167 );
169 const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_dotdot_poly
170 );
172 Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > get_x_dot_poly() const;
173 Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > get_x_dotdot_poly() const;
175 void set_x_sg(const sg_const_vector_t &x_sg);
179 void set_x_dot_sg(const sg_const_vector_t &x_dot_sg);
180 void set_x_dotdot_sg(const sg_const_vector_t &x_dotdot_sg);
185 void set_x_mp(const mp_const_vector_t &x_mp);
189 void set_x_dot_mp(const mp_const_vector_t &x_dot_mp);
190 void set_x_dotdot_mp(const mp_const_vector_t &x_dotdot_mp);
195 void set_p( int l, const Teuchos::RCP<const Epetra_Vector> &p_l );
197 Teuchos::RCP<const Epetra_Vector> get_p(int l) const;
199 void set_p_sg( int l, const sg_const_vector_t &p_sg_l );
201 sg_const_vector_t get_p_sg(int l) const;
203 void set_p_mp( int l, const mp_const_vector_t &p_mp_l );
205 mp_const_vector_t get_p_mp(int l) const;
207 void set_t( double t );
209 double get_alpha() const;
211 void set_alpha( double alpha );
214 double get_omega() const;
216 void set_omega( double omega );
217 double get_beta() const;
219 void set_beta( double beta );
221 double get_t() const;
222 double get_step_size() const;
223 void set_step_size(double step_size);
224 int get_stage_number() const;
225 void set_stage_number(int stage_number);
227 Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> > get_sg_basis() const;
229 void set_sg_basis( const Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> >& basis );
231 Teuchos::RCP<const Stokhos::Quadrature<int,double> > get_sg_quadrature() const;
233 void set_sg_quadrature( const Teuchos::RCP<const Stokhos::Quadrature<int,double> >& quad );
235 Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > > get_sg_expansion() const;
237 void set_sg_expansion( const Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > >& exp );
239 bool supports(EInArgsMembers arg) const;
241 bool supports(EInArgs_p_sg arg, int l) const;
243 bool supports(EInArgs_p_mp arg, int l) const;
244 protected:
246 void _setModelEvalDescription( const std::string &modelEvalDescription );
248 void _set_Np(int Np);
250 void _setSupports( EInArgsMembers arg, bool supports );
252 void _setSupports( EInArgs_p_sg arg, int l, bool supports );
254 void _setSupports( EInArgs_p_mp arg, int l, bool supports );
255 private:
256 // types
257 typedef Teuchos::Array<Teuchos::RCP<const Epetra_Vector> > p_t;
258 typedef Teuchos::Array<sg_const_vector_t > p_sg_t;
259 typedef Teuchos::Array<mp_const_vector_t > p_mp_t;
260 typedef Teuchos::Array<bool> supports_p_sg_t;
261 // data
263 Teuchos::RCP<const Epetra_Vector> x_dot_;
264 Teuchos::RCP<const Epetra_Vector> x_dotdot_;
265 Teuchos::RCP<const Epetra_Vector> x_;
266 Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > x_dot_poly_;
267 Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > x_dotdot_poly_;
268 Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > x_poly_;
278 double t_;
279 double alpha_;
280 double omega_;
281 double beta_;
284 Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> > sg_basis_;
285 Teuchos::RCP<const Stokhos::Quadrature<int,double> > sg_quad_;
286 Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > > sg_exp_;
290 // functions
291 void assert_supports(EInArgsMembers arg) const;
292 void assert_supports(EInArgs_p_sg arg, int l) const;
293 void assert_supports(EInArgs_p_mp arg, int l) const;
294 void assert_l(int l) const;
295 };
296
303
305 template<class ObjType>
306 class Evaluation : public Teuchos::RCP<ObjType> {
307 public:
311 Evaluation( const Teuchos::RCP<ObjType> &obj )
312 : Teuchos::RCP<ObjType>(obj), evalType_(EVAL_TYPE_EXACT) {}
314 Evaluation( const Teuchos::RCP<ObjType> &obj, EEvalType evalType )
315 : Teuchos::RCP<ObjType>(obj), evalType_(evalType) {}
317 EEvalType getType() const { return evalType_; }
319 void reset( const Teuchos::RCP<ObjType> &obj, EEvalType evalType )
320 { this->operator=(obj); evalType_ = evalType; }
321 private:
323 };
324
330
333
336 public:
360 )
361 :supportsLinearOp_(false)
363 mvOrientation1==DERIV_MV_BY_COL||mvOrientation2==DERIV_MV_BY_COL )
365 mvOrientation1==DERIV_TRANS_MV_BY_ROW||mvOrientation2==DERIV_TRANS_MV_BY_ROW )
366 {}
372 {
373 switch(mvOrientation) {
374 case DERIV_MV_BY_COL: supportsMVByCol_ = true; break;
376 default: TEUCHOS_TEST_FOR_EXCEPT(true);
377 }
378 return *this;
379 }
381 bool none() const
385 { return supportsLinearOp_; }
388 {
389 switch(mvOrientation) {
392 default: TEUCHOS_TEST_FOR_EXCEPT(true);
393 }
394 TEUCHOS_UNREACHABLE_RETURN(false);
395 }
396 private:
400 public:
401 };
402
415
432
437 public:
442 const Teuchos::RCP<Epetra_MultiVector> &mv
444 ,const Teuchos::Array<int> &paramIndexes = Teuchos::Array<int>()
445 ) : mv_(mv), orientation_(orientation), paramIndexes_(paramIndexes) {}
448 { orientation_ = orientation; };
450 Teuchos::RCP<Epetra_MultiVector> getMultiVector() const
451 { return mv_; }
456 const Teuchos::Array<int>& getParamIndexes() const
457 { return paramIndexes_; }
458 private:
459 Teuchos::RCP<Epetra_MultiVector> mv_;
461 Teuchos::Array<int> paramIndexes_;
462 };
463
468 public:
472 Derivative( const Teuchos::RCP<Epetra_Operator> &lo )
473 : lo_(lo) {}
476 const Teuchos::RCP<Epetra_MultiVector> &mv
478 ) : dmv_(mv,orientation) {}
481 : dmv_(dmv) {}
483 Teuchos::RCP<Epetra_Operator> getLinearOp() const
484 { return lo_; }
486 Teuchos::RCP<Epetra_MultiVector> getMultiVector() const
487 { return dmv_.getMultiVector(); }
495 bool isEmpty() const
496 { return !lo_.get() && !dmv_.getMultiVector().get(); }
497 private:
498 Teuchos::RCP<Epetra_Operator> lo_;
500 };
501
509 Preconditioner(const Teuchos::RCP<Epetra_Operator>& PrecOp_,
510 bool isAlreadyInverted_ )
511 : PrecOp(PrecOp_), isAlreadyInverted(isAlreadyInverted_) {}
513 Teuchos::RCP<Epetra_Operator> PrecOp;
519 };
520
525 public:
530 const Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > &mv
532 ,const Teuchos::Array<int> &paramIndexes = Teuchos::Array<int>()
533 ) : mv_(mv), orientation_(orientation), paramIndexes_(paramIndexes) {}
536 { orientation_ = orientation; };
538 Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const
539 { return mv_; }
544 const Teuchos::Array<int>& getParamIndexes() const
545 { return paramIndexes_; }
546 private:
547 Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > mv_;
549 Teuchos::Array<int> paramIndexes_;
550 };
551
556 public:
560 SGDerivative( const Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > &lo )
561 : lo_(lo) {}
564 const Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > &mv
566 ) : dmv_(mv,orientation) {}
569 : dmv_(dmv) {}
571 Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > getLinearOp() const
572 { return lo_; }
574 Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const
575 { return dmv_.getMultiVector(); }
583 bool isEmpty() const
584 { return !lo_.get() && !dmv_.getMultiVector().get(); }
585 private:
586 Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > lo_;
588 };
589
594 public:
595
600 const mp_multivector_t &mv
602 ,const Teuchos::Array<int> &paramIndexes = Teuchos::Array<int>()
603 ) : mv_(mv), orientation_(orientation), paramIndexes_(paramIndexes) {}
606 { orientation_ = orientation; };
609 { return mv_; }
614 const Teuchos::Array<int>& getParamIndexes() const
615 { return paramIndexes_; }
616 private:
619 Teuchos::Array<int> paramIndexes_;
620 };
621
626 public:
627
632 : lo_(lo) {}
635 const mp_multivector_t &mv
637 ) : dmv_(mv,orientation) {}
640 : dmv_(dmv) {}
643 { return lo_; }
654 bool isEmpty() const
655 { return !lo_.get() && !dmv_.getMultiVector().get(); }
656 private:
659 };
660
672 static const int NUM_E_OUT_ARGS_MEMBERS=9;
673
678
683
688
693
698
703
708
713
718
723
728
733
738
743
748
753
758
760 class OutArgs {
761 public:
762
764 typedef Teuchos::RCP<Stokhos::EpetraVectorOrthogPoly> sg_vector_t;
765
767 typedef Teuchos::RCP<Stokhos::EpetraOperatorOrthogPoly > sg_operator_t;
768
770 OutArgs();
772 std::string modelEvalDescription() const;
774 int Np() const;
776 int Ng() const;
778 bool supports(EOutArgsMembers arg) const;
780 const DerivativeSupport& supports(EOutArgsDfDp arg, int l) const;
782 const DerivativeSupport& supports(EOutArgsDgDx_dot arg, int j) const;
783 const DerivativeSupport& supports(EOutArgsDgDx_dotdot arg, int j) const;
785 const DerivativeSupport& supports(EOutArgsDgDx arg, int j) const;
787 const DerivativeSupport& supports(EOutArgsDgDp arg, int j, int l) const;
789 bool supports(EOutArgs_g_sg arg, int j) const;
791 const DerivativeSupport& supports(EOutArgsDfDp_sg arg, int l) const;
793 const DerivativeSupport& supports(EOutArgsDgDx_dot_sg arg, int j) const;
794 const DerivativeSupport& supports(EOutArgsDgDx_dotdot_sg arg, int j) const;
796 const DerivativeSupport& supports(EOutArgsDgDx_sg arg, int j) const;
798 const DerivativeSupport& supports(EOutArgsDgDp_sg arg, int j, int l) const;
800 const DerivativeSupport& supports(EOutArgsDfDp_mp arg, int l) const;
802 bool supports(EOutArgs_g_mp arg, int j) const;
804 const DerivativeSupport& supports(EOutArgsDgDx_dot_mp arg, int j) const;
805 const DerivativeSupport& supports(EOutArgsDgDx_dotdot_mp arg, int j) const;
807 const DerivativeSupport& supports(EOutArgsDgDx_mp arg, int j) const;
809 const DerivativeSupport& supports(EOutArgsDgDp_mp arg, int j, int l) const;
811 void set_f( const Evaluation<Epetra_Vector> &f );
813 Evaluation<Epetra_Vector> get_f() const;
815 void set_f_sg( const sg_vector_t& f_sg );
817 sg_vector_t get_f_sg() const;
819 void set_f_mp( const mp_vector_t& f_mp );
821 mp_vector_t get_f_mp() const;
823 void set_g( int j, const Evaluation<Epetra_Vector> &g_j );
825 Evaluation<Epetra_Vector> get_g(int j) const;
828 void set_g_sg( int j, const sg_vector_t &g_sg_j );
831 sg_vector_t get_g_sg(int j) const;
834 void set_g_mp( int j, const mp_vector_t &g_mp_j );
837 mp_vector_t get_g_mp(int j) const;
839 void set_W( const Teuchos::RCP<Epetra_Operator> &W );
840 void set_WPrec( const Teuchos::RCP<Epetra_Operator> &WPrec );
842 Teuchos::RCP<Epetra_Operator> get_W() const;
843 Teuchos::RCP<Epetra_Operator> get_WPrec() const;
848 void set_W_sg( const sg_operator_t& W_sg );
850 sg_operator_t get_W_sg() const;
852 void set_W_mp( const mp_operator_t& W_sg );
854 mp_operator_t get_W_mp() const;
856 void set_DfDp(int l, const Derivative &DfDp_l);
858 Derivative get_DfDp(int l) const;
862 void set_DfDp_sg(int l, const SGDerivative &DfDp_sg_l);
864 SGDerivative get_DfDp_sg(int l) const;
868 void set_DfDp_mp(int l, const MPDerivative &DfDp_mp_l);
870 MPDerivative get_DfDp_mp(int l) const;
874 void set_DgDx_dot(int j, const Derivative &DgDx_dot_j);
875 void set_DgDx_dotdot(int j, const Derivative &DgDx_dotdot_j);
877 Derivative get_DgDx_dot(int j) const;
878 Derivative get_DgDx_dotdot(int j) const;
883 void set_DgDx_dot_sg(int j, const SGDerivative &DgDx_dot_j);
884 void set_DgDx_dotdot_sg(int j, const SGDerivative &DgDx_dotdot_j);
886 SGDerivative get_DgDx_dot_sg(int j) const;
887 SGDerivative get_DgDx_dotdot_sg(int j) const;
892 void set_DgDx_dot_mp(int j, const MPDerivative &DgDx_dot_j);
893 void set_DgDx_dotdot_mp(int j, const MPDerivative &DgDx_dotdot_j);
895 MPDerivative get_DgDx_dot_mp(int j) const;
896 MPDerivative get_DgDx_dotdot_mp(int j) const;
901 void set_DgDx(int j, const Derivative &DgDx_j);
903 Derivative get_DgDx(int j) const;
907 void set_DgDx_sg(int j, const SGDerivative &DgDx_j);
909 SGDerivative get_DgDx_sg(int j) const;
913 void set_DgDx_mp(int j, const MPDerivative &DgDx_j);
915 MPDerivative get_DgDx_mp(int j) const;
919 void set_DgDp( int j, int l, const Derivative &DgDp_j_l );
921 Derivative get_DgDp(int j, int l) const;
923 DerivativeProperties get_DgDp_properties(int j, int l) const;
925 void set_DgDp_sg( int j, int l, const SGDerivative &DgDp_sg_j_l );
927 SGDerivative get_DgDp_sg(int j, int l) const;
931 void set_DgDp_mp( int j, int l, const MPDerivative &DgDp_mp_j_l );
933 MPDerivative get_DgDp_mp(int j, int l) const;
936
938 void set_f_poly( const Teuchos::RCP<Teuchos::Polynomial<Epetra_Vector> > &f_poly );
940 Teuchos::RCP<Teuchos::Polynomial<Epetra_Vector> > get_f_poly() const;
941
942
944 bool funcOrDerivesAreSet(EOutArgsMembers arg) const;
945
951 void setFailed() const;
957 bool isFailed() const;
958
959 protected:
961 void _setModelEvalDescription( const std::string &modelEvalDescription );
963 void _set_Np_Ng(int Np, int Ng);
965 void _setSupports( EOutArgsMembers arg, bool supports );
967 void _setSupports( EOutArgsDfDp arg, int l, const DerivativeSupport& );
969 void _setSupports( EOutArgsDgDx_dot arg, int j, const DerivativeSupport& );
970 void _setSupports( EOutArgsDgDx_dotdot arg, int j, const DerivativeSupport& );
972 void _setSupports( EOutArgsDgDx arg, int j, const DerivativeSupport& );
974 void _setSupports( EOutArgsDgDp arg, int j, int l, const DerivativeSupport& );
976 void _setSupports( EOutArgs_g_sg arg, int j, bool supports );
978 void _setSupports( EOutArgsDfDp_sg arg, int l, const DerivativeSupport& );
980 void _setSupports( EOutArgsDgDx_dot_sg arg, int j, const DerivativeSupport& );
981 void _setSupports( EOutArgsDgDx_dotdot_sg arg, int j, const DerivativeSupport& );
983 void _setSupports( EOutArgsDgDx_sg arg, int j, const DerivativeSupport& );
985 void _setSupports( EOutArgsDgDp_sg arg, int j, int l, const DerivativeSupport& );
986
988 void _setSupports( EOutArgs_g_mp arg, int j, bool supports );
990 void _setSupports( EOutArgsDfDp_mp arg, int l, const DerivativeSupport& );
992 void _setSupports( EOutArgsDgDx_dot_mp arg, int j, const DerivativeSupport& );
993 void _setSupports( EOutArgsDgDx_dotdot_mp arg, int j, const DerivativeSupport& );
995 void _setSupports( EOutArgsDgDx_mp arg, int j, const DerivativeSupport& );
997 void _setSupports( EOutArgsDgDp_mp arg, int j, int l, const DerivativeSupport& );
999 void _set_W_properties( const DerivativeProperties &W_properties );
1000 void _set_WPrec_properties( const DerivativeProperties &WPrec_properties );
1002 void _set_DfDp_properties( int l, const DerivativeProperties &properties );
1004 void _set_DgDx_dot_properties( int j, const DerivativeProperties &properties );
1005 void _set_DgDx_dotdot_properties( int j, const DerivativeProperties &properties );
1007 void _set_DgDx_properties( int j, const DerivativeProperties &properties );
1009 void _set_DgDp_properties( int j, int l, const DerivativeProperties &properties );
1011 void _set_DfDp_sg_properties( int l, const DerivativeProperties &properties );
1013 void _set_DgDx_dot_sg_properties( int j, const DerivativeProperties &properties );
1014 void _set_DgDx_dotdot_sg_properties( int j, const DerivativeProperties &properties );
1016 void _set_DgDx_sg_properties( int j, const DerivativeProperties &properties );
1018 void _set_DgDp_sg_properties( int j, int l, const DerivativeProperties &properties );
1019
1021 void _set_DfDp_mp_properties( int l, const DerivativeProperties &properties );
1023 void _set_DgDx_dot_mp_properties( int j, const DerivativeProperties &properties );
1024 void _set_DgDx_dotdot_mp_properties( int j, const DerivativeProperties &properties );
1026 void _set_DgDx_mp_properties( int j, const DerivativeProperties &properties );
1028 void _set_DgDp_mp_properties( int j, int l, const DerivativeProperties &properties );
1029 private:
1030 // types
1031 typedef Teuchos::Array<Evaluation<Epetra_Vector> > g_t;
1032 typedef Teuchos::Array<sg_vector_t > g_sg_t;
1033 typedef Teuchos::Array<mp_vector_t > g_mp_t;
1034 typedef Teuchos::Array<Derivative> deriv_t;
1035 typedef Teuchos::Array<SGDerivative> sg_deriv_t;
1036 typedef Teuchos::Array<MPDerivative> mp_deriv_t;
1037 typedef Teuchos::Array<DerivativeProperties> deriv_properties_t;
1038 typedef Teuchos::Array<DerivativeSupport> supports_t;
1039 typedef Teuchos::Array<bool> supports_g_sg_t;
1040 // data
1042 mutable bool isFailed_;
1061 Evaluation<Epetra_Vector> f_;
1065 Teuchos::RCP<Epetra_Operator> W_;
1066 Teuchos::RCP<Epetra_Operator> WPrec_;
1077 deriv_t DgDp_; // Ng x Np
1079 Teuchos::RCP<Teuchos::Polynomial<Epetra_Vector> > f_poly_;
1104 // functions
1105 void assert_supports(EOutArgsMembers arg) const;
1106 void assert_supports(EOutArgsDfDp arg, int l) const;
1107 void assert_supports(EOutArgsDgDx_dot arg, int j) const;
1108 void assert_supports(EOutArgsDgDx_dotdot arg, int j) const;
1109 void assert_supports(EOutArgsDgDx arg, int j) const;
1110 void assert_supports(EOutArgsDgDp arg, int j, int l) const;
1111 void assert_supports(EOutArgs_g_sg arg, int j) const;
1112 void assert_supports(EOutArgsDfDp_sg arg, int l) const;
1113 void assert_supports(EOutArgsDgDx_dot_sg arg, int j) const;
1114 void assert_supports(EOutArgsDgDx_dotdot_sg arg, int j) const;
1115 void assert_supports(EOutArgsDgDx_sg arg, int j) const;
1116 void assert_supports(EOutArgsDgDp_sg arg, int j, int l) const;
1117 void assert_supports(EOutArgs_g_mp arg, int j) const;
1118 void assert_supports(EOutArgsDfDp_mp arg, int l) const;
1119 void assert_supports(EOutArgsDgDx_dot_mp arg, int j) const;
1120 void assert_supports(EOutArgsDgDx_dotdot_mp arg, int j) const;
1121 void assert_supports(EOutArgsDgDx_mp arg, int j) const;
1122 void assert_supports(EOutArgsDgDp_mp arg, int j, int l) const;
1123 void assert_l(int l) const;
1124 void assert_j(int j) const;
1125 };
1126
1128
1131
1133 virtual ~ModelEvaluator();
1134
1136
1139
1141 virtual Teuchos::RCP<const Epetra_Map> get_x_map() const = 0;
1142
1144 virtual Teuchos::RCP<const Epetra_Map> get_f_map() const = 0;
1145
1147 virtual Teuchos::RCP<const Epetra_Map> get_p_map(int l) const;
1148
1163 virtual Teuchos::RCP<const Teuchos::Array<std::string> > get_p_names(int l) const;
1164
1166 virtual Teuchos::RCP<const Epetra_Map> get_g_map(int j) const;
1167
1182 virtual Teuchos::ArrayView<const std::string> get_g_names(int j) const;
1183
1185
1188
1190 virtual Teuchos::RCP<const Epetra_Vector> get_x_init() const;
1191
1193 virtual Teuchos::RCP<const Epetra_Vector> get_x_dot_init() const;
1194
1196 virtual Teuchos::RCP<const Epetra_Vector> get_x_dotdot_init() const;
1197
1199 virtual Teuchos::RCP<const Epetra_Vector> get_p_init(int l) const;
1200
1202 virtual double get_t_init() const;
1203
1205
1208
1213 virtual double getInfBound() const;
1214
1216 virtual Teuchos::RCP<const Epetra_Vector> get_x_lower_bounds() const;
1217
1219 virtual Teuchos::RCP<const Epetra_Vector> get_x_upper_bounds() const;
1220
1222 virtual Teuchos::RCP<const Epetra_Vector> get_p_lower_bounds(int l) const;
1223
1225 virtual Teuchos::RCP<const Epetra_Vector> get_p_upper_bounds(int l) const;
1226
1228 virtual double get_t_lower_bound() const;
1229
1231 virtual double get_t_upper_bound() const;
1232
1234
1237
1244 virtual Teuchos::RCP<Epetra_Operator> create_W() const;
1245 virtual Teuchos::RCP<EpetraExt::ModelEvaluator::Preconditioner> create_WPrec() const;
1246
1248 virtual Teuchos::RCP<Epetra_Operator> create_DfDp_op(int l) const;
1249
1251 virtual Teuchos::RCP<Epetra_Operator> create_DgDx_dot_op(int j) const;
1252
1254 virtual Teuchos::RCP<Epetra_Operator> create_DgDx_dotdot_op(int j) const;
1255
1257 virtual Teuchos::RCP<Epetra_Operator> create_DgDx_op(int j) const;
1258
1260 virtual Teuchos::RCP<Epetra_Operator> create_DgDp_op( int j, int l ) const;
1261
1263
1266
1268 virtual InArgs createInArgs() const = 0;
1269
1271 virtual OutArgs createOutArgs() const = 0;
1272
1274 virtual void evalModel( const InArgs& inArgs, const OutArgs& outArgs ) const = 0;
1275
1276#ifdef HAVE_PYTRILINOS
1278 friend InArgs convertInArgsFromPython(PyObject * source);
1279
1281 friend OutArgs convertOutArgsFromPython(PyObject * source);
1282#endif
1284
1285protected:
1286
1289
1291 class InArgsSetup : public InArgs {
1292 public:
1294 void setModelEvalDescription( const std::string &modelEvalDescription );
1296 void set_Np(int Np);
1298 void setSupports( EInArgsMembers arg, bool supports = true );
1300 void setSupports( EInArgs_p_sg arg, int l, bool supports );
1302 void setSupports( EInArgs_p_mp arg, int l, bool supports );
1303 };
1304
1306 class OutArgsSetup : public OutArgs {
1307 public:
1309 void setModelEvalDescription( const std::string &modelEvalDescription );
1311 void set_Np_Ng(int Np, int Ng);
1313 void setSupports( EOutArgsMembers arg, bool supports = true );
1315 void setSupports(EOutArgsDfDp arg, int l, const DerivativeSupport& );
1317 void setSupports(EOutArgsDgDx_dot arg, int j, const DerivativeSupport& );
1318 void setSupports(EOutArgsDgDx_dotdot arg, int j, const DerivativeSupport& );
1320 void setSupports(EOutArgsDgDx arg, int j, const DerivativeSupport& );
1322 void setSupports(EOutArgsDgDp arg, int j, int l, const DerivativeSupport& );
1324 void setSupports( EOutArgs_g_sg arg, int j, bool supports );
1326 void setSupports(EOutArgsDfDp_sg arg, int l, const DerivativeSupport& );
1328 void setSupports(EOutArgsDgDx_dot_sg arg, int j, const DerivativeSupport& );
1329 void setSupports(EOutArgsDgDx_dotdot_sg arg, int j, const DerivativeSupport& );
1331 void setSupports(EOutArgsDgDx_sg arg, int j, const DerivativeSupport& );
1333 void setSupports(EOutArgsDgDp_sg arg, int j, int l, const DerivativeSupport& );
1335 void setSupports( EOutArgs_g_mp arg, int j, bool supports );
1337 void setSupports(EOutArgsDfDp_mp arg, int l, const DerivativeSupport& );
1339 void setSupports(EOutArgsDgDx_dot_mp arg, int j, const DerivativeSupport& );
1340 void setSupports(EOutArgsDgDx_dotdot_mp arg, int j, const DerivativeSupport& );
1342 void setSupports(EOutArgsDgDx_mp arg, int j, const DerivativeSupport& );
1344 void setSupports(EOutArgsDgDp_mp arg, int j, int l, const DerivativeSupport& );
1346 void set_W_properties( const DerivativeProperties &properties );
1347 void set_WPrec_properties( const DerivativeProperties &properties );
1349 void set_DfDp_properties( int l, const DerivativeProperties &properties );
1351 void set_DgDx_dot_properties( int j, const DerivativeProperties &properties );
1352 void set_DgDx_dotdot_properties( int j, const DerivativeProperties &properties );
1354 void set_DgDx_properties( int j, const DerivativeProperties &properties );
1356 void set_DgDp_properties( int j, int l, const DerivativeProperties &properties );
1358 void set_DfDp_sg_properties( int l, const DerivativeProperties &properties );
1360 void set_DgDx_dot_sg_properties( int j, const DerivativeProperties &properties );
1361 void set_DgDx_dotdot_sg_properties( int j, const DerivativeProperties &properties );
1363 void set_DgDx_sg_properties( int j, const DerivativeProperties &properties );
1365 void set_DgDp_sg_properties( int j, int l, const DerivativeProperties &properties );
1367 void set_DfDp_mp_properties( int l, const DerivativeProperties &properties );
1369 void set_DgDx_dot_mp_properties( int j, const DerivativeProperties &properties );
1370 void set_DgDx_dotdot_mp_properties( int j, const DerivativeProperties &properties );
1372 void set_DgDx_mp_properties( int j, const DerivativeProperties &properties );
1374 void set_DgDp_mp_properties( int j, int l, const DerivativeProperties &properties );
1375 };
1376
1378
1379};
1380
1381// ////////////////////////////
1382// Helper functions
1383
1386
1388std::string toString( ModelEvaluator::EInArgsMembers inArg );
1389
1391std::string toString( ModelEvaluator::EOutArgsMembers outArg );
1392
1394Teuchos::RCP<Epetra_Operator>
1396 const std::string &modelEvalDescription,
1397 const ModelEvaluator::Derivative &deriv,
1398 const std::string &derivName
1399 );
1400
1402Teuchos::RCP<Epetra_MultiVector>
1404 const std::string &modelEvalDescription,
1405 const ModelEvaluator::Derivative &deriv,
1406 const std::string &derivName,
1408 );
1409
1411Teuchos::RCP<Epetra_Operator>
1413 const int l
1414 ,const ModelEvaluator::OutArgs &outArgs
1415 );
1416
1418Teuchos::RCP<Epetra_MultiVector>
1420 const int l
1421 ,const ModelEvaluator::OutArgs &outArgs
1422 );
1423
1425Teuchos::RCP<Epetra_MultiVector>
1427 const int j
1428 ,const ModelEvaluator::OutArgs &outArgs
1430 );
1431
1433Teuchos::RCP<Epetra_MultiVector>
1435 const int j
1436 ,const ModelEvaluator::OutArgs &outArgs
1438 );
1439
1441Teuchos::RCP<Epetra_MultiVector>
1443 const int j
1444 ,const ModelEvaluator::OutArgs &outArgs
1446 );
1447
1449Teuchos::RCP<Epetra_MultiVector>
1451 const int j
1452 ,const int l
1453 ,const ModelEvaluator::OutArgs &outArgs
1455 );
1456
1457// ///////////////////////////
1458// Inline Functions
1459
1460//
1461// ModelEvaluator::InArgs
1462//
1463
1464inline
1467
1468inline
1470{ return p_.size(); }
1471
1472inline
1473void ModelEvaluator::InArgs::set_x_dot( const Teuchos::RCP<const Epetra_Vector> &x_dot )
1474{ assert_supports(IN_ARG_x_dot); x_dot_ = x_dot; }
1475
1476inline
1477void ModelEvaluator::InArgs::set_x_dotdot( const Teuchos::RCP<const Epetra_Vector> &x_dotdot )
1478{ assert_supports(IN_ARG_x_dotdot); x_dotdot_ = x_dotdot; }
1479
1480inline
1481Teuchos::RCP<const Epetra_Vector> ModelEvaluator::InArgs::get_x_dot() const
1482{ assert_supports(IN_ARG_x_dot); return x_dot_; }
1483
1484inline
1485Teuchos::RCP<const Epetra_Vector> ModelEvaluator::InArgs::get_x_dotdot() const
1486{ assert_supports(IN_ARG_x_dotdot); return x_dotdot_; }
1487
1488inline
1489void ModelEvaluator::InArgs::set_x( const Teuchos::RCP<const Epetra_Vector> &x )
1490{ assert_supports(IN_ARG_x); x_ = x; }
1491
1492inline
1493Teuchos::RCP<const Epetra_Vector> ModelEvaluator::InArgs::get_x() const
1494{ assert_supports(IN_ARG_x); return x_; }
1495
1496inline
1497void ModelEvaluator::InArgs::set_x_dot_poly( const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_dot_poly )
1498{ assert_supports(IN_ARG_x_dot_poly); x_dot_poly_ = x_dot_poly; }
1499
1500inline
1501void ModelEvaluator::InArgs::set_x_dotdot_poly( const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_dotdot_poly )
1502{ assert_supports(IN_ARG_x_dotdot_poly); x_dotdot_poly_ = x_dotdot_poly; }
1503
1504inline
1505Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> >
1507{ assert_supports(IN_ARG_x_dot_poly); return x_dot_poly_; }
1508
1509inline
1510Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> >
1512{ assert_supports(IN_ARG_x_dotdot_poly); return x_dotdot_poly_; }
1513
1514inline
1515void ModelEvaluator::InArgs::set_x_poly( const Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> > &x_poly )
1516{ assert_supports(IN_ARG_x_poly); x_poly_ = x_poly; }
1517
1518inline
1519Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> >
1521{ assert_supports(IN_ARG_x_poly); return x_poly_; }
1522
1523inline
1525{ assert_supports(IN_ARG_x_dot_sg); x_dot_sg_ = x_dot_sg; }
1526
1527inline
1529{ assert_supports(IN_ARG_x_dotdot_sg); x_dotdot_sg_ = x_dotdot_sg; }
1530
1531inline
1534{ assert_supports(IN_ARG_x_dot_sg); return x_dot_sg_; }
1535
1536inline
1539{ assert_supports(IN_ARG_x_dotdot_sg); return x_dotdot_sg_; }
1540
1541inline
1543{ assert_supports(IN_ARG_x_dot_mp); x_dot_mp_ = x_dot_mp; }
1544
1545inline
1547{ assert_supports(IN_ARG_x_dotdot_mp); x_dotdot_mp_ = x_dotdot_mp; }
1548
1549inline
1552{ assert_supports(IN_ARG_x_dot_mp); return x_dot_mp_; }
1553
1554inline
1557{ assert_supports(IN_ARG_x_dotdot_mp); return x_dotdot_mp_; }
1558
1559inline
1561{ assert_supports(IN_ARG_x_sg); x_sg_ = x_sg; }
1562
1563inline
1566{ assert_supports(IN_ARG_x_sg); return x_sg_; }
1567
1568inline
1570{ assert_supports(IN_ARG_x_mp); x_mp_ = x_mp; }
1571
1572inline
1575{ assert_supports(IN_ARG_x_mp); return x_mp_; }
1576
1577inline
1578void ModelEvaluator::InArgs::set_p( int l, const Teuchos::RCP<const Epetra_Vector> &p_l )
1579{ assert_l(l); p_[l] = p_l; }
1580
1581inline
1582Teuchos::RCP<const Epetra_Vector> ModelEvaluator::InArgs::get_p(int l) const
1583{ assert_l(l); return p_[l]; }
1584
1585inline
1588{ assert_supports(IN_ARG_p_sg, l); p_sg_[l] = p_sg_l; }
1589
1590inline
1593{ assert_supports(IN_ARG_p_sg, l); return p_sg_[l]; }
1594
1595inline
1597 const ModelEvaluator::mp_const_vector_t &p_mp_l )
1598{ assert_supports(IN_ARG_p_mp, l); p_mp_[l] = p_mp_l; }
1599
1600inline
1603{ assert_supports(IN_ARG_p_mp, l); return p_mp_[l]; }
1604
1605inline
1607{ assert_supports(IN_ARG_t); t_ = t; }
1608
1609inline
1611{ assert_supports(IN_ARG_t); return t_; }
1612
1613inline
1615{ assert_supports(IN_ARG_alpha); alpha_ = alpha; }
1616
1617inline
1619{ assert_supports(IN_ARG_alpha); return alpha_; }
1620
1621inline
1623{ assert_supports(IN_ARG_omega); omega_ = omega; }
1624
1625inline
1627{ assert_supports(IN_ARG_omega); return omega_; }
1628
1629inline
1631{ assert_supports(IN_ARG_beta); beta_ = beta; }
1632
1633inline
1635{ assert_supports(IN_ARG_beta); return beta_; }
1636
1637inline
1639{ assert_supports(IN_ARG_step_size); step_size_ = step_size; }
1640
1641inline
1643{ assert_supports(IN_ARG_step_size); return step_size_; }
1644
1645inline
1647{ assert_supports(IN_ARG_stage_number); stage_number_ = stage_number; }
1648
1649inline
1651{ assert_supports(IN_ARG_stage_number); return stage_number_; }
1652
1653 inline
1655{ assert_supports(IN_ARG_sg_basis); sg_basis_ = basis; }
1656
1657inline
1658Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> >
1660{ assert_supports(IN_ARG_sg_basis); return sg_basis_; }
1661
1662inline
1664{ assert_supports(IN_ARG_sg_quadrature); sg_quad_ = quad; }
1665
1666inline
1667Teuchos::RCP<const Stokhos::Quadrature<int,double> >
1669{ assert_supports(IN_ARG_sg_quadrature); return sg_quad_; }
1670
1671inline
1673{ assert_supports(IN_ARG_sg_expansion); sg_exp_ = exp; }
1674
1675inline
1676Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > >
1678{ assert_supports(IN_ARG_sg_expansion); return sg_exp_; }
1679
1680inline
1681void ModelEvaluator::InArgs::_setModelEvalDescription( const std::string &new_modelEvalDescription )
1682{
1683 modelEvalDescription_ = new_modelEvalDescription;
1684}
1685
1686inline
1688{
1689 p_.resize(new_Np);
1690 p_sg_.resize(new_Np);
1691 p_mp_.resize(new_Np);
1692 supports_p_sg_.resize(new_Np);
1693 supports_p_mp_.resize(new_Np);
1694}
1695
1696//
1697// ModelEvaluator::OutArgs
1698//
1699
1700inline
1702{ return modelEvalDescription_; }
1703
1704inline
1706{
1707 return DfDp_.size();
1708}
1709
1710inline
1712{
1713 return g_.size();
1714}
1715
1716inline
1717void ModelEvaluator::OutArgs::set_f( const Evaluation<Epetra_Vector> &f ) { f_ = f; }
1718
1719inline
1722
1723inline
1724void ModelEvaluator::OutArgs::set_g( int j, const Evaluation<Epetra_Vector> &g_j )
1725{
1726 assert_j(j);
1727 g_[j] = g_j;
1728}
1729
1730inline
1733{
1734 assert_j(j);
1735 return g_[j];
1736}
1737
1738inline
1740{
1741 assert_supports(OUT_ARG_g_sg, j);
1742 g_sg_[j] = g_sg_j;
1743}
1744
1745inline
1748{
1749 assert_supports(OUT_ARG_g_sg, j);
1750 return g_sg_[j];
1751}
1752
1753inline
1755{
1756 assert_supports(OUT_ARG_g_mp, j);
1757 g_mp_[j] = g_mp_j;
1758}
1759
1760inline
1763{
1764 assert_supports(OUT_ARG_g_mp, j);
1765 return g_mp_[j];
1766}
1767
1768inline
1769void ModelEvaluator::OutArgs::set_W( const Teuchos::RCP<Epetra_Operator> &W ) { W_ = W; }
1770inline
1771void ModelEvaluator::OutArgs::set_WPrec( const Teuchos::RCP<Epetra_Operator> &WPrec ) { WPrec_ = WPrec; }
1772
1773inline
1774Teuchos::RCP<Epetra_Operator> ModelEvaluator::OutArgs::get_W() const { return W_; }
1775inline
1776Teuchos::RCP<Epetra_Operator> ModelEvaluator::OutArgs::get_WPrec() const { return WPrec_; }
1777
1778inline
1781inline
1784
1785inline
1787{
1788 assert_supports(OUT_ARG_DfDp,l);
1789 DfDp_[l] = DfDp_l;
1790}
1791
1792inline
1795{
1796 assert_supports(OUT_ARG_DfDp,l);
1797 return DfDp_[l];
1798}
1799
1800inline
1803{
1804 assert_supports(OUT_ARG_DfDp,l);
1805 return DfDp_properties_[l];
1806}
1807
1808inline
1810{
1811 assert_supports(OUT_ARG_DfDp_sg,l);
1812 DfDp_sg_[l] = DfDp_sg_l;
1813}
1814
1815inline
1818{
1819 assert_supports(OUT_ARG_DfDp_sg,l);
1820 return DfDp_sg_[l];
1821}
1822
1823inline
1826{
1827 assert_supports(OUT_ARG_DfDp_sg,l);
1828 return DfDp_sg_properties_[l];
1829}
1830
1831inline
1833{
1834 assert_supports(OUT_ARG_DfDp_mp,l);
1835 DfDp_mp_[l] = DfDp_mp_l;
1836}
1837
1838inline
1841{
1842 assert_supports(OUT_ARG_DfDp_mp,l);
1843 return DfDp_mp_[l];
1844}
1845
1846inline
1849{
1850 assert_supports(OUT_ARG_DfDp_mp,l);
1851 return DfDp_mp_properties_[l];
1852}
1853
1854inline
1856{
1857 assert_supports(OUT_ARG_DgDx_dot,j);
1858 DgDx_dot_[j] = DgDx_dot_j;
1859}
1860
1861inline
1864{
1865 assert_supports(OUT_ARG_DgDx_dot,j);
1866 return DgDx_dot_[j];
1867}
1868
1869inline
1872{
1873 assert_supports(OUT_ARG_DgDx_dot,j);
1874 return DgDx_dot_properties_[j];
1875}
1876
1877inline
1879{
1880 assert_supports(OUT_ARG_DgDx_dot_sg,j);
1881 DgDx_dot_sg_[j] = DgDx_dot_sg_j;
1882}
1883
1884inline
1887{
1888 assert_supports(OUT_ARG_DgDx_dot_sg,j);
1889 return DgDx_dot_sg_[j];
1890}
1891
1892inline
1895{
1896 assert_supports(OUT_ARG_DgDx_dot_sg,j);
1897 return DgDx_dot_sg_properties_[j];
1898}
1899
1900inline
1902{
1903 assert_supports(OUT_ARG_DgDx_dot_mp,j);
1904 DgDx_dot_mp_[j] = DgDx_dot_mp_j;
1905}
1906
1907inline
1910{
1911 assert_supports(OUT_ARG_DgDx_dot_mp,j);
1912 return DgDx_dot_mp_[j];
1913}
1914
1915inline
1918{
1919 assert_supports(OUT_ARG_DgDx_dot_mp,j);
1920 return DgDx_dot_mp_properties_[j];
1921}
1922
1923inline
1924void ModelEvaluator::OutArgs::set_DgDx_dotdot( int j, const Derivative &DgDx_dotdot_j )
1925{
1926 assert_supports(OUT_ARG_DgDx_dotdot,j);
1927 DgDx_dotdot_[j] = DgDx_dotdot_j;
1928}
1929
1930inline
1933{
1934 assert_supports(OUT_ARG_DgDx_dotdot,j);
1935 return DgDx_dotdot_[j];
1936}
1937
1938inline
1941{
1942 assert_supports(OUT_ARG_DgDx_dotdot,j);
1943 return DgDx_dotdot_properties_[j];
1944}
1945
1946inline
1947void ModelEvaluator::OutArgs::set_DgDx_dotdot_sg( int j, const SGDerivative &DgDx_dotdot_sg_j )
1948{
1949 assert_supports(OUT_ARG_DgDx_dotdot_sg,j);
1950 DgDx_dotdot_sg_[j] = DgDx_dotdot_sg_j;
1951}
1952
1953inline
1956{
1957 assert_supports(OUT_ARG_DgDx_dotdot_sg,j);
1958 return DgDx_dotdot_sg_[j];
1959}
1960
1961inline
1964{
1965 assert_supports(OUT_ARG_DgDx_dotdot_sg,j);
1966 return DgDx_dotdot_sg_properties_[j];
1967}
1968
1969inline
1970void ModelEvaluator::OutArgs::set_DgDx_dotdot_mp( int j, const MPDerivative &DgDx_dotdot_mp_j )
1971{
1972 assert_supports(OUT_ARG_DgDx_dotdot_mp,j);
1973 DgDx_dotdot_mp_[j] = DgDx_dotdot_mp_j;
1974}
1975
1976inline
1979{
1980 assert_supports(OUT_ARG_DgDx_dotdot_mp,j);
1981 return DgDx_dotdot_mp_[j];
1982}
1983
1984inline
1987{
1988 assert_supports(OUT_ARG_DgDx_dotdot_mp,j);
1989 return DgDx_dotdot_mp_properties_[j];
1990}
1991
1992inline
1994{
1995 assert_supports(OUT_ARG_DgDx,j);
1996 DgDx_[j] = DgDx_j;
1997}
1998
1999inline
2002{
2003 assert_supports(OUT_ARG_DgDx,j);
2004 return DgDx_[j];
2005}
2006
2007inline
2010{
2011 assert_supports(OUT_ARG_DgDx,j);
2012 return DgDx_properties_[j];
2013}
2014
2015inline
2017{
2018 assert_supports(OUT_ARG_DgDx_sg,j);
2019 DgDx_sg_[j] = DgDx_sg_j;
2020}
2021
2022inline
2025{
2026 assert_supports(OUT_ARG_DgDx_sg,j);
2027 return DgDx_sg_[j];
2028}
2029
2030inline
2033{
2034 assert_supports(OUT_ARG_DgDx_sg,j);
2035 return DgDx_sg_properties_[j];
2036}
2037
2038inline
2040{
2041 assert_supports(OUT_ARG_DgDx_mp,j);
2042 DgDx_mp_[j] = DgDx_mp_j;
2043}
2044
2045inline
2048{
2049 assert_supports(OUT_ARG_DgDx_mp,j);
2050 return DgDx_mp_[j];
2051}
2052
2053inline
2056{
2057 assert_supports(OUT_ARG_DgDx_mp,j);
2058 return DgDx_mp_properties_[j];
2059}
2060
2061inline
2062void ModelEvaluator::OutArgs::set_DgDp( int j, int l, const Derivative &DgDp_j_l )
2063{
2064 assert_supports(OUT_ARG_DgDp,j,l);
2065 DgDp_[ j*Np() + l ] = DgDp_j_l;
2066}
2067
2068inline
2071{
2072 assert_supports(OUT_ARG_DgDp,j,l);
2073 return DgDp_[ j*Np() + l ];
2074}
2075
2076inline
2079{
2080 assert_supports(OUT_ARG_DgDp,j,l);
2081 return DgDp_properties_[ j*Np() + l ];
2082}
2083
2084inline
2085void ModelEvaluator::OutArgs::set_DgDp_sg( int j, int l, const SGDerivative &DgDp_sg_j_l )
2086{
2087 assert_supports(OUT_ARG_DgDp_sg,j,l);
2088 DgDp_sg_[ j*Np() + l ] = DgDp_sg_j_l;
2089}
2090
2091inline
2094{
2095 assert_supports(OUT_ARG_DgDp_sg,j,l);
2096 return DgDp_sg_[ j*Np() + l ];
2097}
2098
2099inline
2102{
2103 assert_supports(OUT_ARG_DgDp_sg,j,l);
2104 return DgDp_sg_properties_[ j*Np() + l ];
2105}
2106
2107inline
2108void ModelEvaluator::OutArgs::set_DgDp_mp( int j, int l, const MPDerivative &DgDp_mp_j_l )
2109{
2110 assert_supports(OUT_ARG_DgDp_mp,j,l);
2111 DgDp_mp_[ j*Np() + l ] = DgDp_mp_j_l;
2112}
2113
2114inline
2117{
2118 assert_supports(OUT_ARG_DgDp_mp,j,l);
2119 return DgDp_mp_[ j*Np() + l ];
2120}
2121
2122inline
2125{
2126 assert_supports(OUT_ARG_DgDp_mp,j,l);
2127 return DgDp_mp_properties_[ j*Np() + l ];
2128}
2129
2130inline
2131void ModelEvaluator::OutArgs::set_f_poly( const Teuchos::RCP<Teuchos::Polynomial<Epetra_Vector> > &f_poly )
2132{ f_poly_ = f_poly; }
2133
2134inline
2135Teuchos::RCP<Teuchos::Polynomial<Epetra_Vector> >
2137{ return f_poly_; }
2138
2139inline
2142
2143inline
2146{ return f_sg_; }
2147
2148inline
2150
2151inline
2153
2154inline
2156{ f_mp_ = f_mp; }
2157
2158inline
2161{ return f_mp_; }
2162
2163inline
2165
2166inline
2168
2169//
2170// ModelEvaluator::InArgsSetup
2171//
2172
2173inline
2174void ModelEvaluator::InArgsSetup::setModelEvalDescription( const std::string &new_modelEvalDescription )
2175{
2176 this->_setModelEvalDescription(new_modelEvalDescription);
2177}
2178
2179inline
2181{ this->_set_Np(new_Np); }
2182
2183inline
2185{ this->_setSupports(arg,new_supports); }
2186
2187inline
2188void ModelEvaluator::InArgsSetup::setSupports( EInArgs_p_sg arg, int l, bool new_supports )
2189{ this->_setSupports(arg,l,new_supports); }
2190
2191inline
2192void ModelEvaluator::InArgsSetup::setSupports( EInArgs_p_mp arg, int l, bool new_supports )
2193{ this->_setSupports(arg,l,new_supports); }
2194
2195//
2196// ModelEvaluator::OutArgsSetup
2197//
2198
2199inline
2200void ModelEvaluator::OutArgsSetup::setModelEvalDescription( const std::string &new_modelEvalDescription )
2201{
2202 this->_setModelEvalDescription(new_modelEvalDescription);
2203}
2204
2205inline
2207{ this->_set_Np_Ng(new_Np,new_Ng); }
2208
2209inline
2211{ this->_setSupports(arg,new_supports); }
2212
2213inline
2215{ this->_setSupports(arg,l,new_supports); }
2216
2217inline
2219{ this->_setSupports(arg,j,new_supports); }
2220
2221inline
2223{ this->_setSupports(arg,j,new_supports); }
2224
2225inline
2227{ this->_setSupports(arg,j,new_supports); }
2228
2229inline
2231{ this->_setSupports(arg,j,l,new_supports); }
2232
2233inline
2235{ this->_setSupports(arg,j,new_supports); }
2236
2237inline
2239{ this->_setSupports(arg,l,new_supports); }
2240
2241inline
2243{ this->_setSupports(arg,j,new_supports); }
2244
2245inline
2247{ this->_setSupports(arg,j,new_supports); }
2248
2249inline
2251{ this->_setSupports(arg,j,new_supports); }
2252
2253inline
2255{ this->_setSupports(arg,j,l,new_supports); }
2256
2257inline
2259{ this->_setSupports(arg,j,new_supports); }
2260
2261inline
2263{ this->_setSupports(arg,l,new_supports); }
2264
2265inline
2267{ this->_setSupports(arg,j,new_supports); }
2268
2269inline
2271{ this->_setSupports(arg,j,new_supports); }
2272
2273inline
2275{ this->_setSupports(arg,j,new_supports); }
2276
2277inline
2279{ this->_setSupports(arg,j,l,new_supports); }
2280
2281inline
2283{ this->_set_W_properties(properties); }
2284inline
2286{ this->_set_WPrec_properties(properties); }
2287
2288inline
2290{
2291 this->_set_DfDp_properties(l,properties);
2292}
2293
2294inline
2296{
2297 this->_set_DgDx_dot_properties(j,properties);
2298}
2299
2300inline
2302{
2303 this->_set_DgDx_dotdot_properties(j,properties);
2304}
2305
2306inline
2308{
2309 this->_set_DgDx_properties(j,properties);
2310}
2311
2312inline
2314{
2315 this->_set_DgDp_properties(j,l,properties);
2316}
2317
2318inline
2320{
2321 this->_set_DfDp_sg_properties(l,properties);
2322}
2323
2324inline
2326{
2327 this->_set_DgDx_dot_sg_properties(j,properties);
2328}
2329
2330inline
2332{
2333 this->_set_DgDx_dotdot_sg_properties(j,properties);
2334}
2335
2336inline
2338{
2339 this->_set_DgDx_sg_properties(j,properties);
2340}
2341
2342inline
2344{
2345 this->_set_DgDp_sg_properties(j,l,properties);
2346}
2347
2348inline
2350{
2351 this->_set_DfDp_mp_properties(l,properties);
2352}
2353
2354inline
2356{
2357 this->_set_DgDx_dot_mp_properties(j,properties);
2358}
2359
2360inline
2362{
2363 this->_set_DgDx_dotdot_mp_properties(j,properties);
2364}
2365
2366inline
2368{
2369 this->_set_DgDx_mp_properties(j,properties);
2370}
2371
2372inline
2374{
2375 this->_set_DgDp_mp_properties(j,l,properties);
2376}
2377
2378} // namespace EpetraExt
2379
2380#endif // EPETRA_EXT_MODEL_EVALUATOR_HPP
Simple aggregate class for a derivative object represented as a column-wise multi-vector or its trans...
void changeOrientation(const EDerivativeMultiVectorOrientation orientation)
const Teuchos::Array< int > & getParamIndexes() const
DerivativeMultiVector(const Teuchos::RCP< Epetra_MultiVector > &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL, const Teuchos::Array< int > &paramIndexes=Teuchos::Array< int >())
Teuchos::RCP< Epetra_MultiVector > getMultiVector() const
EDerivativeMultiVectorOrientation getOrientation() const
DerivativeSupport(EDerivativeMultiVectorOrientation mvOrientation1, EDerivativeMultiVectorOrientation mvOrientation2)
DerivativeSupport & plus(EDerivativeMultiVectorOrientation mvOrientation)
DerivativeSupport(EDerivativeMultiVectorOrientation mvOrientation)
bool supports(EDerivativeMultiVectorOrientation mvOrientation) const
DerivativeSupport & plus(EDerivativeLinearOp)
DerivativeSupport(EDerivativeLinearOp, EDerivativeMultiVectorOrientation mvOrientation)
Simple aggregate class that stores a derivative object as a general linear operator or as a multi-vec...
Derivative(const Teuchos::RCP< Epetra_MultiVector > &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL)
Derivative(const Teuchos::RCP< Epetra_Operator > &lo)
Teuchos::RCP< Epetra_MultiVector > getMultiVector() const
DerivativeMultiVector getDerivativeMultiVector() const
Derivative(const DerivativeMultiVector &dmv)
Teuchos::RCP< Epetra_Operator > getLinearOp() const
EDerivativeMultiVectorOrientation getMultiVectorOrientation() const
Evaluation(const Teuchos::RCP< ObjType > &obj, EEvalType evalType)
void reset(const Teuchos::RCP< ObjType > &obj, EEvalType evalType)
Evaluation(const Teuchos::RCP< ObjType > &obj)
void setSupports(EInArgsMembers arg, bool supports=true)
void setModelEvalDescription(const std::string &modelEvalDescription)
bool supports(EInArgsMembers arg) const
void set_x_dot_sg(const sg_const_vector_t &x_dot_sg)
Set stochastic Galerkin time derivative vector polynomial.
void set_p_mp(int l, const mp_const_vector_t &p_mp_l)
Set multi-point parameter vector.
void set_p_sg(int l, const sg_const_vector_t &p_sg_l)
Set stochastic Galerkin vector polynomial parameter.
sg_const_vector_t get_p_sg(int l) const
Get stochastic Galerkin vector polynomial parameter.
void set_x_dot(const Teuchos::RCP< const Epetra_Vector > &x_dot)
void set_x_dotdot_poly(const Teuchos::RCP< const Teuchos::Polynomial< Epetra_Vector > > &x_dotdot_poly)
Teuchos::RCP< const Teuchos::Polynomial< Epetra_Vector > > get_x_dotdot_poly() const
void set_x_sg(const sg_const_vector_t &x_sg)
Set stochastic Galerkin solution vector polynomial.
void set_x_dot_mp(const mp_const_vector_t &x_dot_mp)
Set multi-point time derivative vector.
void set_sg_basis(const Teuchos::RCP< const Stokhos::OrthogPolyBasis< int, double > > &basis)
Teuchos::RCP< const Teuchos::Polynomial< Epetra_Vector > > get_x_poly() const
Get solution vector Taylor polynomial.
void _setModelEvalDescription(const std::string &modelEvalDescription)
sg_const_vector_t get_x_dot_sg() const
Get stochastic Galerkin time derivative vector polynomial.
Teuchos::RCP< const Epetra_Vector > x_dotdot_
Teuchos::RCP< const Epetra_Vector > get_x_dotdot() const
Teuchos::Array< sg_const_vector_t > p_sg_t
Teuchos::RCP< Stokhos::OrthogPolyExpansion< int, double, Stokhos::StandardStorage< int, double > > > get_sg_expansion() const
Teuchos::RCP< const Teuchos::Polynomial< Epetra_Vector > > x_dot_poly_
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.
Teuchos::Array< Teuchos::RCP< const Epetra_Vector > > p_t
Teuchos::Array< mp_const_vector_t > p_mp_t
Teuchos::RCP< const Epetra_Vector > get_p(int l) const
void set_x_dotdot_sg(const sg_const_vector_t &x_dotdot_sg)
Teuchos::RCP< const Stokhos::Quadrature< int, double > > sg_quad_
void set_x_dotdot_mp(const mp_const_vector_t &x_dotdot_mp)
Teuchos::RCP< Stokhos::OrthogPolyExpansion< int, double, Stokhos::StandardStorage< int, double > > > sg_exp_
void set_x_mp(const mp_const_vector_t &x_mp)
Set multi-point solution vector.
mp_const_vector_t get_p_mp(int l) const
Get multi-point parameter vector.
void assert_supports(EInArgsMembers arg) const
Teuchos::RCP< const Stokhos::OrthogPolyBasis< int, double > > get_sg_basis() const
Teuchos::RCP< const Stokhos::Quadrature< int, double > > get_sg_quadrature() const
void set_sg_quadrature(const Teuchos::RCP< const Stokhos::Quadrature< int, double > > &quad)
Teuchos::RCP< const Epetra_Vector > x_dot_
mp_const_vector_t get_x_mp() const
Get multi-point solution vector.
Teuchos::RCP< const Stokhos::OrthogPolyBasis< int, double > > sg_basis_
void set_sg_expansion(const Teuchos::RCP< Stokhos::OrthogPolyExpansion< int, double, Stokhos::StandardStorage< int, double > > > &exp)
void set_x_dotdot(const Teuchos::RCP< const Epetra_Vector > &x_dotdot)
void set_x_dot_poly(const Teuchos::RCP< const Teuchos::Polynomial< Epetra_Vector > > &x_dot_poly)
Set time derivative vector Taylor polynomial.
void set_x(const Teuchos::RCP< const Epetra_Vector > &x)
void _setSupports(EInArgsMembers arg, bool supports)
Teuchos::RCP< const Teuchos::Polynomial< Epetra_Vector > > x_dotdot_poly_
Teuchos::RCP< const Epetra_Vector > x_
mp_const_vector_t get_x_dot_mp() const
Get multi-point time derivative vector.
Teuchos::RCP< const Epetra_Vector > get_x() const
Set solution vector Taylor polynomial.
Teuchos::RCP< const Stokhos::EpetraVectorOrthogPoly > sg_const_vector_t
Short-hand for stochastic Galerkin vector type.
void set_x_poly(const Teuchos::RCP< const Teuchos::Polynomial< Epetra_Vector > > &x_poly)
Teuchos::RCP< const Epetra_Vector > get_x_dot() const
void set_p(int l, const Teuchos::RCP< const Epetra_Vector > &p_l)
sg_const_vector_t get_x_sg() const
Get stochastic Galerkin solution vector polynomial.
Simple aggregate class for a derivative object represented as a column-wise multi-vector or its trans...
MPDerivativeMultiVector(const mp_multivector_t &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL, const Teuchos::Array< int > &paramIndexes=Teuchos::Array< int >())
void changeOrientation(const EDerivativeMultiVectorOrientation orientation)
EDerivativeMultiVectorOrientation getOrientation() const
Simple aggregate class that stores a derivative object as a general linear operator or as a multi-vec...
MPDerivative(const MPDerivativeMultiVector &dmv)
MPDerivative(const mp_multivector_t &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL)
MPDerivativeMultiVector getDerivativeMultiVector() const
EDerivativeMultiVectorOrientation getMultiVectorOrientation() const
void set_DfDp_sg_properties(int l, const DerivativeProperties &properties)
void set_DgDx_dot_sg_properties(int j, const DerivativeProperties &properties)
void setModelEvalDescription(const std::string &modelEvalDescription)
void set_DgDx_dotdot_sg_properties(int j, const DerivativeProperties &properties)
void set_W_properties(const DerivativeProperties &properties)
void set_DfDp_properties(int l, const DerivativeProperties &properties)
void set_DgDx_dotdot_mp_properties(int j, const DerivativeProperties &properties)
void set_DgDp_properties(int j, int l, const DerivativeProperties &properties)
void set_DfDp_mp_properties(int l, const DerivativeProperties &properties)
void set_DgDx_properties(int j, const DerivativeProperties &properties)
void set_DgDx_mp_properties(int j, const DerivativeProperties &properties)
void set_DgDx_dot_mp_properties(int j, const DerivativeProperties &properties)
void set_DgDp_mp_properties(int j, int l, const DerivativeProperties &properties)
void setSupports(EOutArgsMembers arg, bool supports=true)
void set_DgDx_dotdot_properties(int j, const DerivativeProperties &properties)
void set_DgDx_sg_properties(int j, const DerivativeProperties &properties)
void set_DgDx_dot_properties(int j, const DerivativeProperties &properties)
void set_DgDp_sg_properties(int j, int l, const DerivativeProperties &properties)
void set_WPrec_properties(const DerivativeProperties &properties)
sg_vector_t get_f_sg() const
Get stochastic Galerkin residual vector polynomial.
void set_DgDx_dotdot_sg(int j, const SGDerivative &DgDx_dotdot_j)
DerivativeProperties get_DgDx_sg_properties(int j) const
Teuchos::RCP< Epetra_Operator > get_W() const
void set_g(int j, const Evaluation< Epetra_Vector > &g_j)
Set g(j) where 0 <= j && j < this->Ng().
Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > sg_vector_t
Short-hand for stochastic Galerkin vector type.
void _set_DgDp_mp_properties(int j, int l, const DerivativeProperties &properties)
bool supports(EOutArgsMembers arg) const
void set_DfDp_sg(int l, const SGDerivative &DfDp_sg_l)
void set_DgDp_mp(int j, int l, const MPDerivative &DgDp_mp_j_l)
bool funcOrDerivesAreSet(EOutArgsMembers arg) const
Return true if the function or its derivatives are set.
void set_g_sg(int j, const sg_vector_t &g_sg_j)
Set stochastic Galerkin vector polynomial response.
void set_WPrec(const Teuchos::RCP< Epetra_Operator > &WPrec)
void _set_W_properties(const DerivativeProperties &W_properties)
void _set_DgDx_dotdot_properties(int j, const DerivativeProperties &properties)
DerivativeProperties get_DgDp_mp_properties(int j, int l) const
void _set_DgDx_mp_properties(int j, const DerivativeProperties &properties)
Teuchos::Array< SGDerivative > sg_deriv_t
DerivativeProperties get_DfDp_properties(int l) const
mp_vector_t get_f_mp() const
Get multi-point residual vector.
void _set_DgDx_dot_sg_properties(int j, const DerivativeProperties &properties)
Teuchos::RCP< Teuchos::Polynomial< Epetra_Vector > > f_poly_
void set_W_mp(const mp_operator_t &W_sg)
Set multi-point W.
void _set_DgDp_sg_properties(int j, int l, const DerivativeProperties &properties)
DerivativeProperties get_DfDp_mp_properties(int l) const
void set_DgDx_dot_mp(int j, const MPDerivative &DgDx_dot_j)
void setFailed() const
Set that the evaluation as a whole failed.
DerivativeProperties get_W_properties() const
void set_DfDp_mp(int l, const MPDerivative &DfDp_mp_l)
void set_f_sg(const sg_vector_t &f_sg)
Set stochastic Galerkin residual vector polynomial.
Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > sg_operator_t
Short-hand for stochastic Galerkin operator type.
void set_f_mp(const mp_vector_t &f_mp)
Set multi-point residual vector.
DerivativeProperties get_DgDx_dot_sg_properties(int j) const
void assert_supports(EOutArgsMembers arg) const
DerivativeProperties get_DgDx_dotdot_sg_properties(int j) const
void _set_DfDp_properties(int l, const DerivativeProperties &properties)
DerivativeProperties get_DgDx_mp_properties(int j) const
Teuchos::Array< MPDerivative > mp_deriv_t
void set_f_poly(const Teuchos::RCP< Teuchos::Polynomial< Epetra_Vector > > &f_poly)
Set residual vector Taylor polynomial.
void set_DgDx_dotdot(int j, const Derivative &DgDx_dotdot_j)
DerivativeProperties get_DfDp_sg_properties(int l) const
void _set_DgDx_dot_properties(int j, const DerivativeProperties &properties)
void set_DfDp(int l, const Derivative &DfDp_l)
void _setModelEvalDescription(const std::string &modelEvalDescription)
Teuchos::Array< DerivativeProperties > deriv_properties_t
void set_DgDp(int j, int l, const Derivative &DgDp_j_l)
void set_DgDx(int j, const Derivative &DgDx_j)
mp_vector_t get_g_mp(int j) const
Get multi-point response.
void set_g_mp(int j, const mp_vector_t &g_mp_j)
Set multi-point response.
void _set_DgDx_dotdot_mp_properties(int j, const DerivativeProperties &properties)
void _set_DgDx_properties(int j, const DerivativeProperties &properties)
Teuchos::Array< Evaluation< Epetra_Vector > > g_t
MPDerivative get_DgDp_mp(int j, int l) const
SGDerivative get_DgDp_sg(int j, int l) const
DerivativeProperties get_DgDx_dotdot_properties(int j) const
mp_operator_t get_W_mp() const
Get multi-point W.
void _set_DgDx_sg_properties(int j, const DerivativeProperties &properties)
Evaluation< Epetra_Vector > get_g(int j) const
Get g(j) where 0 <= j && j < this->Ng().
Teuchos::RCP< Epetra_Operator > get_WPrec() const
void _set_DgDx_dot_mp_properties(int j, const DerivativeProperties &properties)
void _set_DfDp_sg_properties(int l, const DerivativeProperties &properties)
sg_operator_t get_W_sg() const
Get stochastic Galerkin W operator polynomial.
void set_W_sg(const sg_operator_t &W_sg)
Set stochastic Galerkin W operator polynomial.
void _set_DgDx_dotdot_sg_properties(int j, const DerivativeProperties &properties)
DerivativeProperties get_DgDx_properties(int j) const
DerivativeProperties get_DgDp_sg_properties(int j, int l) const
void set_DgDx_dotdot_mp(int j, const MPDerivative &DgDx_dotdot_j)
void set_DgDx_dot(int j, const Derivative &DgDx_dot_j)
Teuchos::Array< DerivativeSupport > supports_t
Teuchos::RCP< Teuchos::Polynomial< Epetra_Vector > > get_f_poly() const
Get residual vector Taylor polynomial.
Evaluation< Epetra_Vector > get_f() const
void set_f(const Evaluation< Epetra_Vector > &f)
void set_DgDx_dot_sg(int j, const SGDerivative &DgDx_dot_j)
void set_DgDx_sg(int j, const SGDerivative &DgDx_j)
DerivativeProperties get_WPrec_properties() const
DerivativeProperties get_DgDx_dotdot_mp_properties(int j) const
sg_vector_t get_g_sg(int j) const
Get stochastic Galerkin vector polynomial response.
DerivativeProperties get_DgDp_properties(int j, int l) const
void _set_WPrec_properties(const DerivativeProperties &WPrec_properties)
DerivativeProperties get_DgDx_dot_mp_properties(int j) const
void _setSupports(EOutArgsMembers arg, bool supports)
Derivative get_DgDp(int j, int l) const
void set_DgDx_mp(int j, const MPDerivative &DgDx_j)
void set_DgDp_sg(int j, int l, const SGDerivative &DgDp_sg_j_l)
Teuchos::RCP< Epetra_Operator > WPrec_
void _set_DfDp_mp_properties(int l, const DerivativeProperties &properties)
void set_W(const Teuchos::RCP< Epetra_Operator > &W)
bool isFailed() const
Return if the evaluation failed or not.
DerivativeProperties get_DgDx_dot_properties(int j) const
void _set_DgDp_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< Stokhos::EpetraMultiVectorOrthogPoly > mv_
void changeOrientation(const EDerivativeMultiVectorOrientation orientation)
EDerivativeMultiVectorOrientation getOrientation() const
SGDerivativeMultiVector(const Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL, const Teuchos::Array< int > &paramIndexes=Teuchos::Array< int >())
Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const
Simple aggregate class that stores a derivative object as a general linear operator or as a multi-vec...
Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > getLinearOp() const
SGDerivative(const SGDerivativeMultiVector &dmv)
SGDerivativeMultiVector getDerivativeMultiVector() const
SGDerivative(const Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL)
Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > lo_
Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > getMultiVector() const
EDerivativeMultiVectorOrientation getMultiVectorOrientation() const
SGDerivative(const Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > &lo)
Base interface for evaluating a stateless "model".
Teuchos::RCP< Stokhos::ProductEpetraMultiVector > mp_multivector_t
virtual Teuchos::RCP< const Epetra_Vector > get_p_upper_bounds(int l) const
Teuchos::RCP< const Stokhos::ProductEpetraMultiVector > mp_const_multivector_t
Teuchos::RCP< const Stokhos::ProductEpetraOperator > mp_const_operator_t
virtual Teuchos::RCP< Epetra_Operator > create_DfDp_op(int l) const
virtual Teuchos::RCP< Epetra_Operator > create_DgDp_op(int j, int l) const
virtual double get_t_lower_bound() const
@ IN_ARG_x_sg
Stochastic Galerkin solution vector polynomial.
@ IN_ARG_x_dotdot_sg
Stochastic Galerkin time second derivative vector polynomial.
@ IN_ARG_sg_quadrature
Stochastic Galerkin quadrature.
@ IN_ARG_x_dot_mp
Multi-point time derivative vector.
@ IN_ARG_x_poly
Solution vector Taylor polynomial.
@ IN_ARG_x_mp
Multi-point solution vector.
@ IN_ARG_x_dot_sg
Stochastic Galerkin time derivative vector polynomial.
@ IN_ARG_sg_basis
Stochastic Galerkin basis.
@ IN_ARG_x_dotdot_mp
Multi-point time second derivative vector.
@ IN_ARG_x_dot_poly
Time derivative vector Taylor polynomial.
@ IN_ARG_x_dotdot_poly
Time second derivative vector Taylor polynomial.
@ IN_ARG_omega
Coeff of second derivative term d(x_dotdot)/dx.
@ IN_ARG_sg_expansion
Stochastic Galerkin expansion.
virtual Teuchos::RCP< EpetraExt::ModelEvaluator::Preconditioner > create_WPrec() const
virtual Teuchos::RCP< const Epetra_Vector > get_x_lower_bounds() const
virtual Teuchos::RCP< const Epetra_Map > get_g_map(int j) const
\breif .
Teuchos::RCP< Stokhos::ProductEpetraVector > mp_vector_t
virtual Teuchos::RCP< const Epetra_Vector > get_x_dotdot_init() const
virtual Teuchos::RCP< Epetra_Operator > create_DgDx_op(int j) const
Teuchos::RCP< Stokhos::ProductEpetraOperator > mp_operator_t
virtual Teuchos::RCP< const Epetra_Map > get_x_map() const =0
\breif .
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.
virtual OutArgs createOutArgs() const =0
@ OUT_ARG_f_mp
Multi-point residual vector.
@ OUT_ARG_W_sg
Stochastic Galerkin "W" operator polyomial.
@ OUT_ARG_f_poly
Residual vector Taylor polynomial.
@ OUT_ARG_WPrec
Preconditioner operator (approx Jacobian)
@ OUT_ARG_W_mp
Multi-point "W" operator.
@ OUT_ARG_f_sg
Stochastic Galerkin residual vector polynomial.
virtual Teuchos::RCP< Epetra_Operator > create_W() const
If supported, create a Epetra_Operator object for W to be evaluated.
virtual Teuchos::RCP< const Epetra_Vector > get_p_lower_bounds(int l) const
virtual Teuchos::RCP< const Epetra_Vector > get_x_upper_bounds() const
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.
virtual Teuchos::RCP< const Epetra_Vector > get_x_dot_init() const
@ EVAL_TYPE_EXACT
Exact function evaluation.
@ EVAL_TYPE_VERY_APPROX_DERIV
A very approximate derivative (i.e. for a preconditioner)
@ EVAL_TYPE_APPROX_DERIV
An approximate derivative (i.e. for a Jacobian)
Teuchos::RCP< const Stokhos::ProductEpetraVector > mp_const_vector_t
virtual void evalModel(const InArgs &inArgs, const OutArgs &outArgs) const =0
virtual Teuchos::RCP< Epetra_Operator > create_DgDx_dot_op(int j) const
virtual Teuchos::RCP< const Epetra_Vector > get_p_init(int l) const
virtual double getInfBound() const
Return the value of an infinite bound.
virtual Teuchos::RCP< const Epetra_Map > get_p_map(int l) const
\breif .
virtual Teuchos::RCP< const Epetra_Vector > get_x_init() const
virtual Teuchos::RCP< Epetra_Operator > create_DgDx_dotdot_op(int j) const
virtual InArgs createInArgs() const =0
virtual Teuchos::RCP< const Epetra_Map > get_f_map() const =0
\breif .
EpetraExt::BlockCrsMatrix: A class for constructing a distributed block matrix.
Teuchos::RCP< Epetra_MultiVector > get_DgDx_dot_mv(const int j, const ModelEvaluator::OutArgs &outArgs, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
Teuchos::RCP< Epetra_Operator > getLinearOp(const std::string &modelEvalDescription, const ModelEvaluator::Derivative &deriv, const std::string &derivName)
Teuchos::RCP< Epetra_Operator > get_DfDp_op(const int l, const ModelEvaluator::OutArgs &outArgs)
Teuchos::RCP< Epetra_MultiVector > get_DgDp_mv(const int j, const int l, const ModelEvaluator::OutArgs &outArgs, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
Teuchos::RCP< Epetra_MultiVector > get_DgDx_mv(const int j, const ModelEvaluator::OutArgs &outArgs, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
Teuchos::RCP< Epetra_MultiVector > get_DfDp_mv(const int l, const ModelEvaluator::OutArgs &outArgs)
Teuchos::RCP< Epetra_MultiVector > get_DgDx_dotdot_mv(const int j, const ModelEvaluator::OutArgs &outArgs, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
std::string toString(const int &x)
Teuchos::RCP< Epetra_MultiVector > getMultiVector(const std::string &modelEvalDescription, const ModelEvaluator::Derivative &deriv, const std::string &derivName, const ModelEvaluator::EDerivativeMultiVectorOrientation mvOrientation)
DerivativeProperties(EDerivativeLinearity in_linearity, ERankStatus in_rank, bool in_supportsAdjoint)
Simple aggregate struct that stores a preconditioner as an Epetra_Operator and a bool,...
Preconditioner()
Default constructor of null Operatir.
Preconditioner(const Teuchos::RCP< Epetra_Operator > &PrecOp_, bool isAlreadyInverted_)
Usable constructor to set the (Epetra_Operator,bool) pair.
Teuchos::RCP< Epetra_Operator > PrecOp
Accessor for the Epetra_Operator.