EpetraExt 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
45#if defined(EpetraExt_SHOW_DEPRECATED_WARNINGS)
46#ifdef __GNUC__
47#warning "The EpetraExt package is deprecated"
48#endif
49#endif
50
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
61struct _object;
62typedef _object PyObject;
63#endif
64#endif
65
66class Epetra_Map;
67class Epetra_Vector;
68class Epetra_Operator;
69
70// Forward declaration of Stochastic Galerkin (SG) argument types
71namespace 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
85namespace EpetraExt {
86
91class ModelEvaluator : virtual public Teuchos::Describable {
92public:
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
128 static const int NUM_E_IN_ARGS_MEMBERS=21;
129
134
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 );
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);
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);
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
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
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 {}
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_; }
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
421
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
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(); }
501 bool isEmpty() const
502 { return !lo_.get() && !dmv_.getMultiVector().get(); }
503 private:
504 Teuchos::RCP<Epetra_Operator> lo_;
506 };
507
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
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(); }
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:
625 Teuchos::Array<int> paramIndexes_;
626 };
627
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(); }
660 bool isEmpty() const
661 { return !lo_.get() && !dmv_.getMultiVector().get(); }
662 private:
663 mp_operator_t lo_;
665 };
666
678 static const int NUM_E_OUT_ARGS_MEMBERS=9;
679
684
689
694
699
704
709
714
719
724
729
734
739
744
749
754
759
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;
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;
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
1284 friend InArgs convertInArgsFromPython(PyObject * source);
1285
1287 friend OutArgs convertOutArgsFromPython(PyObject * source);
1288#endif
1290
1291protected:
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
1394std::string toString( ModelEvaluator::EInArgsMembers inArg );
1395
1397std::string toString( ModelEvaluator::EOutArgsMembers outArg );
1398
1400Teuchos::RCP<Epetra_Operator>
1402 const std::string &modelEvalDescription,
1403 const ModelEvaluator::Derivative &deriv,
1404 const std::string &derivName
1405 );
1406
1408Teuchos::RCP<Epetra_MultiVector>
1410 const std::string &modelEvalDescription,
1411 const ModelEvaluator::Derivative &deriv,
1412 const std::string &derivName,
1414 );
1415
1417Teuchos::RCP<Epetra_Operator>
1419 const int l
1420 ,const ModelEvaluator::OutArgs &outArgs
1421 );
1422
1424Teuchos::RCP<Epetra_MultiVector>
1426 const int l
1427 ,const ModelEvaluator::OutArgs &outArgs
1428 );
1429
1431Teuchos::RCP<Epetra_MultiVector>
1433 const int j
1434 ,const ModelEvaluator::OutArgs &outArgs
1436 );
1437
1439Teuchos::RCP<Epetra_MultiVector>
1441 const int j
1442 ,const ModelEvaluator::OutArgs &outArgs
1444 );
1445
1447Teuchos::RCP<Epetra_MultiVector>
1449 const int j
1450 ,const ModelEvaluator::OutArgs &outArgs
1452 );
1453
1455Teuchos::RCP<Epetra_MultiVector>
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
1470inline
1472{ return modelEvalDescription_; }
1473
1474inline
1476{ return p_.size(); }
1477
1478inline
1479void 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
1482inline
1483void 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
1486inline
1487Teuchos::RCP<const Epetra_Vector> ModelEvaluator::InArgs::get_x_dot() const
1488{ assert_supports(IN_ARG_x_dot); return x_dot_; }
1489
1490inline
1491Teuchos::RCP<const Epetra_Vector> ModelEvaluator::InArgs::get_x_dotdot() const
1492{ assert_supports(IN_ARG_x_dotdot); return x_dotdot_; }
1493
1494inline
1495void ModelEvaluator::InArgs::set_x( const Teuchos::RCP<const Epetra_Vector> &x )
1496{ assert_supports(IN_ARG_x); x_ = x; }
1497
1498inline
1499Teuchos::RCP<const Epetra_Vector> ModelEvaluator::InArgs::get_x() const
1500{ assert_supports(IN_ARG_x); return x_; }
1501
1502inline
1503void 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
1506inline
1507void 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
1510inline
1511Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> >
1513{ assert_supports(IN_ARG_x_dot_poly); return x_dot_poly_; }
1514
1515inline
1516Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> >
1518{ assert_supports(IN_ARG_x_dotdot_poly); return x_dotdot_poly_; }
1519
1520inline
1521void 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
1524inline
1525Teuchos::RCP<const Teuchos::Polynomial<Epetra_Vector> >
1527{ assert_supports(IN_ARG_x_poly); return x_poly_; }
1528
1529inline
1531{ assert_supports(IN_ARG_x_dot_sg); x_dot_sg_ = x_dot_sg; }
1532
1533inline
1535{ assert_supports(IN_ARG_x_dotdot_sg); x_dotdot_sg_ = x_dotdot_sg; }
1536
1537inline
1540{ assert_supports(IN_ARG_x_dot_sg); return x_dot_sg_; }
1541
1542inline
1545{ assert_supports(IN_ARG_x_dotdot_sg); return x_dotdot_sg_; }
1546
1547inline
1549{ assert_supports(IN_ARG_x_dot_mp); x_dot_mp_ = x_dot_mp; }
1550
1551inline
1553{ assert_supports(IN_ARG_x_dotdot_mp); x_dotdot_mp_ = x_dotdot_mp; }
1554
1555inline
1558{ assert_supports(IN_ARG_x_dot_mp); return x_dot_mp_; }
1559
1560inline
1563{ assert_supports(IN_ARG_x_dotdot_mp); return x_dotdot_mp_; }
1564
1565inline
1567{ assert_supports(IN_ARG_x_sg); x_sg_ = x_sg; }
1568
1569inline
1572{ assert_supports(IN_ARG_x_sg); return x_sg_; }
1573
1574inline
1576{ assert_supports(IN_ARG_x_mp); x_mp_ = x_mp; }
1577
1578inline
1581{ assert_supports(IN_ARG_x_mp); return x_mp_; }
1582
1583inline
1584void ModelEvaluator::InArgs::set_p( int l, const Teuchos::RCP<const Epetra_Vector> &p_l )
1585{ assert_l(l); p_[l] = p_l; }
1586
1587inline
1588Teuchos::RCP<const Epetra_Vector> ModelEvaluator::InArgs::get_p(int l) const
1589{ assert_l(l); return p_[l]; }
1590
1591inline
1594{ assert_supports(IN_ARG_p_sg, l); p_sg_[l] = p_sg_l; }
1595
1596inline
1599{ assert_supports(IN_ARG_p_sg, l); return p_sg_[l]; }
1600
1601inline
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
1606inline
1609{ assert_supports(IN_ARG_p_mp, l); return p_mp_[l]; }
1610
1611inline
1613{ assert_supports(IN_ARG_t); t_ = t; }
1614
1615inline
1617{ assert_supports(IN_ARG_t); return t_; }
1618
1619inline
1621{ assert_supports(IN_ARG_alpha); alpha_ = alpha; }
1622
1623inline
1625{ assert_supports(IN_ARG_alpha); return alpha_; }
1626
1627inline
1629{ assert_supports(IN_ARG_omega); omega_ = omega; }
1630
1631inline
1633{ assert_supports(IN_ARG_omega); return omega_; }
1634
1635inline
1637{ assert_supports(IN_ARG_beta); beta_ = beta; }
1638
1639inline
1641{ assert_supports(IN_ARG_beta); return beta_; }
1642
1643inline
1645{ assert_supports(IN_ARG_step_size); step_size_ = step_size; }
1646
1647inline
1649{ assert_supports(IN_ARG_step_size); return step_size_; }
1650
1651inline
1653{ assert_supports(IN_ARG_stage_number); stage_number_ = stage_number; }
1654
1655inline
1657{ assert_supports(IN_ARG_stage_number); return stage_number_; }
1658
1659 inline
1661{ assert_supports(IN_ARG_sg_basis); sg_basis_ = basis; }
1662
1663inline
1664Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> >
1666{ assert_supports(IN_ARG_sg_basis); return sg_basis_; }
1667
1668inline
1670{ assert_supports(IN_ARG_sg_quadrature); sg_quad_ = quad; }
1671
1672inline
1673Teuchos::RCP<const Stokhos::Quadrature<int,double> >
1675{ assert_supports(IN_ARG_sg_quadrature); return sg_quad_; }
1676
1677inline
1679{ assert_supports(IN_ARG_sg_expansion); sg_exp_ = exp; }
1680
1681inline
1682Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double,Stokhos::StandardStorage<int,double> > >
1684{ assert_supports(IN_ARG_sg_expansion); return sg_exp_; }
1685
1686inline
1687void ModelEvaluator::InArgs::_setModelEvalDescription( const std::string &new_modelEvalDescription )
1688{
1689 modelEvalDescription_ = new_modelEvalDescription;
1690}
1691
1692inline
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
1706inline
1708{ return modelEvalDescription_; }
1709
1710inline
1712{
1713 return DfDp_.size();
1714}
1715
1716inline
1718{
1719 return g_.size();
1720}
1721
1722inline
1724
1725inline
1728
1729inline
1731{
1732 assert_j(j);
1733 g_[j] = g_j;
1734}
1735
1736inline
1739{
1740 assert_j(j);
1741 return g_[j];
1742}
1743
1744inline
1746{
1747 assert_supports(OUT_ARG_g_sg, j);
1748 g_sg_[j] = g_sg_j;
1749}
1750
1751inline
1754{
1755 assert_supports(OUT_ARG_g_sg, j);
1756 return g_sg_[j];
1757}
1758
1759inline
1761{
1762 assert_supports(OUT_ARG_g_mp, j);
1763 g_mp_[j] = g_mp_j;
1764}
1765
1766inline
1769{
1770 assert_supports(OUT_ARG_g_mp, j);
1771 return g_mp_[j];
1772}
1773
1774inline
1775void ModelEvaluator::OutArgs::set_W( const Teuchos::RCP<Epetra_Operator> &W ) { W_ = W; }
1776inline
1777void ModelEvaluator::OutArgs::set_WPrec( const Teuchos::RCP<Epetra_Operator> &WPrec ) { WPrec_ = WPrec; }
1778
1779inline
1780Teuchos::RCP<Epetra_Operator> ModelEvaluator::OutArgs::get_W() const { return W_; }
1781inline
1782Teuchos::RCP<Epetra_Operator> ModelEvaluator::OutArgs::get_WPrec() const { return WPrec_; }
1783
1784inline
1787inline
1790
1791inline
1793{
1794 assert_supports(OUT_ARG_DfDp,l);
1795 DfDp_[l] = DfDp_l;
1796}
1797
1798inline
1801{
1802 assert_supports(OUT_ARG_DfDp,l);
1803 return DfDp_[l];
1804}
1805
1806inline
1809{
1810 assert_supports(OUT_ARG_DfDp,l);
1811 return DfDp_properties_[l];
1812}
1813
1814inline
1816{
1817 assert_supports(OUT_ARG_DfDp_sg,l);
1818 DfDp_sg_[l] = DfDp_sg_l;
1819}
1820
1821inline
1824{
1825 assert_supports(OUT_ARG_DfDp_sg,l);
1826 return DfDp_sg_[l];
1827}
1828
1829inline
1832{
1833 assert_supports(OUT_ARG_DfDp_sg,l);
1834 return DfDp_sg_properties_[l];
1835}
1836
1837inline
1839{
1840 assert_supports(OUT_ARG_DfDp_mp,l);
1841 DfDp_mp_[l] = DfDp_mp_l;
1842}
1843
1844inline
1847{
1848 assert_supports(OUT_ARG_DfDp_mp,l);
1849 return DfDp_mp_[l];
1850}
1851
1852inline
1855{
1856 assert_supports(OUT_ARG_DfDp_mp,l);
1857 return DfDp_mp_properties_[l];
1858}
1859
1860inline
1862{
1863 assert_supports(OUT_ARG_DgDx_dot,j);
1864 DgDx_dot_[j] = DgDx_dot_j;
1865}
1866
1867inline
1870{
1871 assert_supports(OUT_ARG_DgDx_dot,j);
1872 return DgDx_dot_[j];
1873}
1874
1875inline
1878{
1879 assert_supports(OUT_ARG_DgDx_dot,j);
1880 return DgDx_dot_properties_[j];
1881}
1882
1883inline
1885{
1886 assert_supports(OUT_ARG_DgDx_dot_sg,j);
1887 DgDx_dot_sg_[j] = DgDx_dot_sg_j;
1888}
1889
1890inline
1893{
1894 assert_supports(OUT_ARG_DgDx_dot_sg,j);
1895 return DgDx_dot_sg_[j];
1896}
1897
1898inline
1901{
1902 assert_supports(OUT_ARG_DgDx_dot_sg,j);
1903 return DgDx_dot_sg_properties_[j];
1904}
1905
1906inline
1908{
1909 assert_supports(OUT_ARG_DgDx_dot_mp,j);
1910 DgDx_dot_mp_[j] = DgDx_dot_mp_j;
1911}
1912
1913inline
1916{
1917 assert_supports(OUT_ARG_DgDx_dot_mp,j);
1918 return DgDx_dot_mp_[j];
1919}
1920
1921inline
1924{
1925 assert_supports(OUT_ARG_DgDx_dot_mp,j);
1926 return DgDx_dot_mp_properties_[j];
1927}
1928
1929inline
1930void 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
1936inline
1939{
1940 assert_supports(OUT_ARG_DgDx_dotdot,j);
1941 return DgDx_dotdot_[j];
1942}
1943
1944inline
1947{
1948 assert_supports(OUT_ARG_DgDx_dotdot,j);
1949 return DgDx_dotdot_properties_[j];
1950}
1951
1952inline
1953void 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
1959inline
1962{
1963 assert_supports(OUT_ARG_DgDx_dotdot_sg,j);
1964 return DgDx_dotdot_sg_[j];
1965}
1966
1967inline
1970{
1971 assert_supports(OUT_ARG_DgDx_dotdot_sg,j);
1972 return DgDx_dotdot_sg_properties_[j];
1973}
1974
1975inline
1976void 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
1982inline
1985{
1986 assert_supports(OUT_ARG_DgDx_dotdot_mp,j);
1987 return DgDx_dotdot_mp_[j];
1988}
1989
1990inline
1993{
1994 assert_supports(OUT_ARG_DgDx_dotdot_mp,j);
1995 return DgDx_dotdot_mp_properties_[j];
1996}
1997
1998inline
2000{
2001 assert_supports(OUT_ARG_DgDx,j);
2002 DgDx_[j] = DgDx_j;
2003}
2004
2005inline
2008{
2009 assert_supports(OUT_ARG_DgDx,j);
2010 return DgDx_[j];
2011}
2012
2013inline
2016{
2017 assert_supports(OUT_ARG_DgDx,j);
2018 return DgDx_properties_[j];
2019}
2020
2021inline
2023{
2024 assert_supports(OUT_ARG_DgDx_sg,j);
2025 DgDx_sg_[j] = DgDx_sg_j;
2026}
2027
2028inline
2031{
2032 assert_supports(OUT_ARG_DgDx_sg,j);
2033 return DgDx_sg_[j];
2034}
2035
2036inline
2039{
2040 assert_supports(OUT_ARG_DgDx_sg,j);
2041 return DgDx_sg_properties_[j];
2042}
2043
2044inline
2046{
2047 assert_supports(OUT_ARG_DgDx_mp,j);
2048 DgDx_mp_[j] = DgDx_mp_j;
2049}
2050
2051inline
2054{
2055 assert_supports(OUT_ARG_DgDx_mp,j);
2056 return DgDx_mp_[j];
2057}
2058
2059inline
2062{
2063 assert_supports(OUT_ARG_DgDx_mp,j);
2064 return DgDx_mp_properties_[j];
2065}
2066
2067inline
2068void 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
2074inline
2077{
2078 assert_supports(OUT_ARG_DgDp,j,l);
2079 return DgDp_[ j*Np() + l ];
2080}
2081
2082inline
2085{
2086 assert_supports(OUT_ARG_DgDp,j,l);
2087 return DgDp_properties_[ j*Np() + l ];
2088}
2089
2090inline
2091void 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
2097inline
2100{
2101 assert_supports(OUT_ARG_DgDp_sg,j,l);
2102 return DgDp_sg_[ j*Np() + l ];
2103}
2104
2105inline
2108{
2109 assert_supports(OUT_ARG_DgDp_sg,j,l);
2110 return DgDp_sg_properties_[ j*Np() + l ];
2111}
2112
2113inline
2114void 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
2120inline
2123{
2124 assert_supports(OUT_ARG_DgDp_mp,j,l);
2125 return DgDp_mp_[ j*Np() + l ];
2126}
2127
2128inline
2131{
2132 assert_supports(OUT_ARG_DgDp_mp,j,l);
2133 return DgDp_mp_properties_[ j*Np() + l ];
2134}
2135
2136inline
2137void ModelEvaluator::OutArgs::set_f_poly( const Teuchos::RCP<Teuchos::Polynomial<Epetra_Vector> > &f_poly )
2138{ f_poly_ = f_poly; }
2139
2140inline
2141Teuchos::RCP<Teuchos::Polynomial<Epetra_Vector> >
2143{ return f_poly_; }
2144
2145inline
2148
2149inline
2152{ return f_sg_; }
2153
2154inline
2156
2157inline
2159
2160inline
2162{ f_mp_ = f_mp; }
2163
2164inline
2167{ return f_mp_; }
2168
2169inline
2171
2172inline
2174
2175//
2176// ModelEvaluator::InArgsSetup
2177//
2178
2179inline
2180void ModelEvaluator::InArgsSetup::setModelEvalDescription( const std::string &new_modelEvalDescription )
2181{
2182 this->_setModelEvalDescription(new_modelEvalDescription);
2183}
2184
2185inline
2187{ this->_set_Np(new_Np); }
2188
2189inline
2191{ this->_setSupports(arg,new_supports); }
2192
2193inline
2194void ModelEvaluator::InArgsSetup::setSupports( EInArgs_p_sg arg, int l, bool new_supports )
2195{ this->_setSupports(arg,l,new_supports); }
2196
2197inline
2198void 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
2205inline
2206void ModelEvaluator::OutArgsSetup::setModelEvalDescription( const std::string &new_modelEvalDescription )
2207{
2208 this->_setModelEvalDescription(new_modelEvalDescription);
2209}
2210
2211inline
2213{ this->_set_Np_Ng(new_Np,new_Ng); }
2214
2215inline
2217{ this->_setSupports(arg,new_supports); }
2218
2219inline
2221{ this->_setSupports(arg,l,new_supports); }
2222
2223inline
2225{ this->_setSupports(arg,j,new_supports); }
2226
2227inline
2229{ this->_setSupports(arg,j,new_supports); }
2230
2231inline
2233{ this->_setSupports(arg,j,new_supports); }
2234
2235inline
2237{ this->_setSupports(arg,j,l,new_supports); }
2238
2239inline
2241{ this->_setSupports(arg,j,new_supports); }
2242
2243inline
2245{ this->_setSupports(arg,l,new_supports); }
2246
2247inline
2249{ this->_setSupports(arg,j,new_supports); }
2250
2251inline
2253{ this->_setSupports(arg,j,new_supports); }
2254
2255inline
2257{ this->_setSupports(arg,j,new_supports); }
2258
2259inline
2261{ this->_setSupports(arg,j,l,new_supports); }
2262
2263inline
2265{ this->_setSupports(arg,j,new_supports); }
2266
2267inline
2269{ this->_setSupports(arg,l,new_supports); }
2270
2271inline
2273{ this->_setSupports(arg,j,new_supports); }
2274
2275inline
2277{ this->_setSupports(arg,j,new_supports); }
2278
2279inline
2281{ this->_setSupports(arg,j,new_supports); }
2282
2283inline
2285{ this->_setSupports(arg,j,l,new_supports); }
2286
2287inline
2289{ this->_set_W_properties(properties); }
2290inline
2292{ this->_set_WPrec_properties(properties); }
2293
2294inline
2296{
2297 this->_set_DfDp_properties(l,properties);
2298}
2299
2300inline
2302{
2303 this->_set_DgDx_dot_properties(j,properties);
2304}
2305
2306inline
2308{
2309 this->_set_DgDx_dotdot_properties(j,properties);
2310}
2311
2312inline
2314{
2315 this->_set_DgDx_properties(j,properties);
2316}
2317
2318inline
2320{
2321 this->_set_DgDp_properties(j,l,properties);
2322}
2323
2324inline
2326{
2327 this->_set_DfDp_sg_properties(l,properties);
2328}
2329
2330inline
2332{
2333 this->_set_DgDx_dot_sg_properties(j,properties);
2334}
2335
2336inline
2338{
2339 this->_set_DgDx_dotdot_sg_properties(j,properties);
2340}
2341
2342inline
2344{
2345 this->_set_DgDx_sg_properties(j,properties);
2346}
2347
2348inline
2350{
2351 this->_set_DgDp_sg_properties(j,l,properties);
2352}
2353
2354inline
2356{
2357 this->_set_DfDp_mp_properties(l,properties);
2358}
2359
2360inline
2362{
2363 this->_set_DgDx_dot_mp_properties(j,properties);
2364}
2365
2366inline
2368{
2369 this->_set_DgDx_dotdot_mp_properties(j,properties);
2370}
2371
2372inline
2374{
2375 this->_set_DgDx_mp_properties(j,properties);
2376}
2377
2378inline
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 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 > get_x_dotdot() const
Teuchos::RCP< Stokhos::OrthogPolyExpansion< int, double, Stokhos::StandardStorage< int, double > > > get_sg_expansion() const
Teuchos::RCP< const Teuchos::Polynomial< Epetra_Vector > > get_x_dot_poly() const
Get time derivative vector Taylor polynomial.
Teuchos::RCP< const Epetra_Vector > get_p(int l) const
void set_x_dotdot_sg(const sg_const_vector_t &x_dotdot_sg)
void set_x_dotdot_mp(const mp_const_vector_t &x_dotdot_mp)
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.
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)
mp_const_vector_t get_x_mp() const
Get multi-point solution vector.
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)
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)
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)
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
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
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)
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)
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::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)
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...
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::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.