Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_ModelEvaluatorBase_decl.hpp
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Thyra: Interfaces and Support for Abstract Numerical Algorithms
5 // Copyright (2004) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
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 Roscoe A. Bartlett (bartlettra@ornl.gov)
38 //
39 // ***********************************************************************
40 // @HEADER
41 
42 #ifndef THYRA_MODEL_EVALUATOR_BASE_DECL_HPP
43 #define THYRA_MODEL_EVALUATOR_BASE_DECL_HPP
44 
45 
46 #include "Thyra_LinearOpWithSolveBase.hpp"
47 #include "Teuchos_Describable.hpp"
48 #include "Teuchos_any.hpp"
49 #include "Teuchos_Assert.hpp"
50 
51 #ifdef HAVE_THYRA_ME_POLYNOMIAL
52 # include "Teuchos_Polynomial.hpp"
53 #endif
54 
55 namespace Stokhos {
56  class ProductEpetraVector;
57  class ProductEpetraMultiVector;
58  class ProductEpetraOperator;
59 }
60 
61 namespace Thyra {
62 
63 
84  : virtual public Teuchos::Describable,
85  virtual public Teuchos::VerboseObject<ModelEvaluatorBase>
86 {
87 public:
88 
91 
107  };
109  static const int NUM_E_IN_ARGS_MEMBERS=13;
110 
114  };
115 
158  template<class Scalar>
159  class InArgs : public Teuchos::Describable {
160  public:
164  InArgs();
167  int Np() const;
169  bool supports(EInArgsMembers arg) const;
171  void set_x_dot_dot( const RCP<const VectorBase<Scalar> > &x_dot_dot );
175  void set_x_dot( const RCP<const VectorBase<Scalar> > &x_dot );
179  void set_x( const RCP<const VectorBase<Scalar> > &x );
182 
184  template<typename ObjectType>
185  bool supports() const;
187  template<typename ObjectType>
188  void set(const RCP<const ObjectType>& uo);
190  template<typename ObjectType>
191  RCP<const ObjectType> get() const;
192 
193 #ifdef HAVE_THYRA_ME_POLYNOMIAL
194 
195  void set_x_poly(
196  const RCP<const Teuchos::Polynomial< VectorBase<Scalar> > > &x_poly );
200  void set_x_dot_poly(
201  const RCP<const Teuchos::Polynomial< VectorBase<Scalar> > > &x_dot_poly );
203  RCP<const Teuchos::Polynomial< VectorBase<Scalar> > > get_x_dot_poly() const;
204 #endif // HAVE_THYRA_ME_POLYNOMIAL
205 
206  void set_p( int l, const RCP<const VectorBase<Scalar> > &p_l );
208  RCP<const VectorBase<Scalar> > get_p(int l) const;
209 
210 
215 
220 
221  void set_p_mp( int l, const RCP<const Stokhos::ProductEpetraVector > &p_mp_l );
222  RCP<const Stokhos::ProductEpetraVector > get_p_mp(int l) const;
224  bool supports(EInArgs_p_mp arg, int l) const;
225 
226 
228  void set_t( ScalarMag t );
230  ScalarMag get_t() const;
232  void set_alpha( Scalar alpha );
234  Scalar get_alpha() const;
236  void set_beta( Scalar beta );
238  Scalar get_beta() const;
240  void set_W_x_dot_dot_coeff( Scalar W_x_dot_dot_coeff );
242  Scalar get_W_x_dot_dot_coeff() const;
244  void set_step_size( Scalar step_size);
246  Scalar get_step_size() const;
248  void set_stage_number( Scalar stage_number);
250  Scalar get_stage_number() const;
253  void setArgs(
254  const InArgs<Scalar>& inArgs, bool ignoreUnsupported = false,
255  bool cloneObjects = false
256  );
258  void assertSameSupport( const InArgs<Scalar> &inArgs ) const;
260  std::string modelEvalDescription() const;
262  std::string description() const;
265  void describe(
266  Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel
267  ) const;
268  protected:
270  void _setModelEvalDescription( const std::string &modelEvalDescription );
272  void _set_Np(int Np);
274  void _setSupports( EInArgsMembers arg, bool supports );
276  void _setSupports( EInArgs_p_mp arg, int l, bool supports );
278  void _setSupports( const InArgs<Scalar>& inputInArgs, const int Np );
280  template<typename ObjectType>
281  void _setSupports( const bool supports );
284  private:
285  // types
287  // data
288  std::string modelEvalDescription_;
289  RCP<const VectorBase<Scalar> > x_dot_dot_;
295 #ifdef HAVE_THYRA_ME_POLYNOMIAL
298 #endif // HAVE_THYRA_ME_POLYNOMIAL
299  p_t p_;
300  ScalarMag t_;
301  Scalar alpha_;
302  Scalar beta_;
303  Scalar W_x_dot_dot_coeff_;
304  Scalar step_size_;
305  Scalar stage_number_;
306  bool supports_[NUM_E_IN_ARGS_MEMBERS];
307  Teuchos::Array<bool> supports_p_mp_; //Np
308  // functions
309  void assert_supports(EInArgsMembers arg) const;
310  void assert_supports(EInArgs_p_mp arg, int l) const;
311  void assert_l(int l) const;
312 
313  std::map<std::string,Teuchos::any> extended_inargs_;
314  };
315 
317  enum EEvalType {
318  EVAL_TYPE_EXACT = 0,
321  };
322 
329  template<class ObjType>
330  class Evaluation : public RCP<ObjType> {
331  public:
334  : evalType_(EVAL_TYPE_EXACT) {}
336  Evaluation() : evalType_(EVAL_TYPE_EXACT) {}
338  Evaluation( const RCP<ObjType> &obj )
339  : RCP<ObjType>(obj), evalType_(EVAL_TYPE_EXACT) {}
341  Evaluation( const RCP<ObjType> &obj, EEvalType evalType )
342  : RCP<ObjType>(obj), evalType_(evalType) {}
344  EEvalType getType() const { return evalType_; }
346  void reset( const RCP<ObjType> &obj, EEvalType evalType )
347  { this->operator=(obj); evalType_ = evalType; }
348  private:
349  EEvalType evalType_;
350  };
351 
358  };
359 
363  };
364 
368  public:
371  :supportsLinearOp_(false), supportsMVByCol_(false), supportsTransMVByRow_(false)
372  {}
375  :supportsLinearOp_(true), supportsMVByCol_(false), supportsTransMVByRow_(false)
376  {}
379  :supportsLinearOp_(false), supportsMVByCol_(mvOrientation==DERIV_MV_BY_COL)
380  ,supportsTransMVByRow_(mvOrientation==DERIV_TRANS_MV_BY_ROW)
381  {}
384  { supportsLinearOp_ = true; return *this; }
387  {
388  switch(mvOrientation) {
389  case DERIV_MV_BY_COL: supportsMVByCol_ = true; break;
390  case DERIV_TRANS_MV_BY_ROW: supportsTransMVByRow_ = true; break;
391  default: TEUCHOS_TEST_FOR_EXCEPT(true);
392  }
393  return *this;
394  }
396  bool none() const
397  { return ( !supportsLinearOp_ && !supportsMVByCol_ && !supportsTransMVByRow_ ); }
400  { return supportsLinearOp_; }
402  bool supports(EDerivativeMultiVectorOrientation mvOrientation) const
403  {
404  switch(mvOrientation) {
405  case DERIV_MV_BY_COL: return supportsMVByCol_;
406  case DERIV_TRANS_MV_BY_ROW: return supportsTransMVByRow_;
407  default: TEUCHOS_TEST_FOR_EXCEPT(true);
408  }
410  }
412  bool isSameSupport(const DerivativeSupport &derivSupport) const
413  {
414  return (
415  supportsLinearOp_ == derivSupport.supportsLinearOp_
416  && supportsMVByCol_ == derivSupport.supportsMVByCol_
417  && supportsTransMVByRow_ == derivSupport.supportsTransMVByRow_
418  );
419  }
421  std::string description() const;
422  private:
423  bool supportsLinearOp_;
424  bool supportsMVByCol_;
425  bool supportsTransMVByRow_;
426  public:
427  };
428 
434  };
435 
437  enum ERankStatus {
441  };
442 
456  {}
459  EDerivativeLinearity in_linearity, ERankStatus in_rank,
460  bool in_supportsAdjoint
461  )
462  :linearity(in_linearity),rank(in_rank),
463  supportsAdjoint(in_supportsAdjoint)
464  {}
465  };
466 
470  template<class Scalar>
472  public:
475  :orientation_(DERIV_MV_BY_COL)
476  {}
479  const RCP<MultiVectorBase<Scalar> > &mv
481  ) : mv_(mv.assert_not_null()), orientation_(orientation) {}
484  { orientation_ = orientation; };
487  { mv_.assert_not_null(); return *this; }
490  { return mv_; }
493  { return orientation_; }
495  std::string description() const;
497  void describe(
498  Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel
499  ) const;
500  private:
503  };
504 
508  template<class Scalar>
509  class Derivative {
510  public:
515  : lo_(lo.assert_not_null()) {}
518  const RCP<MultiVectorBase<Scalar> > &mv,
520  ) : dmv_(mv,orientation) {}
523  : dmv_(dmv) {}
525  bool isEmpty() const
526  { return ( lo_.get()==NULL && dmv_.getMultiVector().get()==NULL ); }
529  { dmv_.assert_not_null(); lo_.assert_not_null(); return *this; }
532  { return lo_; }
535  { return dmv_.getMultiVector(); }
538  { return dmv_.getOrientation(); }
541  { return dmv_; }
545  bool isSupportedBy( const DerivativeSupport &derivSupport ) const
546  {
547  // If there is not derivative support then we will return false!
548  if (derivSupport.none())
549  return false;
550  if (!is_null(getMultiVector())) {
551  return derivSupport.supports(getMultiVectorOrientation());
552  }
553  else if(!is_null(getLinearOp())) {
554  return derivSupport.supports(DERIV_LINEAR_OP);
555  }
556  // If nothing is set then of course we support that!
557  return true;
558  }
560  std::string description() const;
562  void describe(
563  Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel
564  ) const;
565  private:
568  };
569 
574  public:
577  :orientation_(DERIV_MV_BY_COL)
578  {}
583  ,const Teuchos::Array<int> &paramIndexes = Teuchos::Array<int>()
584  ) : mv_(mv.assert_not_null()), orientation_(orientation), paramIndexes_(paramIndexes) {}
587  { orientation_ = orientation; };
590  { mv_.assert_not_null(); return *this; }
593  { return mv_; }
596  { return orientation_; }
599  { return paramIndexes_; }
601  std::string description() const {return "\n";}
603  void describe(
604  Teuchos::FancyOStream &/* out */, const Teuchos::EVerbosityLevel /* verbLevel */
605  ) const {}
606  private:
609  Teuchos::Array<int> paramIndexes_;
610  };
611 
615  class MPDerivative {
616  public:
621  : lo_(lo.assert_not_null()) {}
626  ) : dmv_(mv,orientation) {}
629  : dmv_(dmv) {}
631  bool isEmpty() const
632  { return ( lo_.get()==NULL && dmv_.getMultiVector().get()==NULL ); }
635  { dmv_.assert_not_null(); lo_.assert_not_null(); return *this; }
638  { return lo_; }
641  { return dmv_.getMultiVector(); }
644  { return dmv_.getOrientation(); }
647  { return dmv_; }
651  bool isSupportedBy( const DerivativeSupport &derivSupport ) const
652  {
653  // If there is not derivative support then we will return false!
654  if (derivSupport.none())
655  return false;
656  if (!is_null(getMultiVector())) {
657  return derivSupport.supports(getMultiVectorOrientation());
658  }
659  else if(!is_null(getLinearOp())) {
660  return derivSupport.supports(DERIV_LINEAR_OP);
661  }
662  // If nothing is set then of course we support that!
663  return true;
664  }
666  std::string description() const {return "\n";}
668  void describe(
669  Teuchos::FancyOStream &/* out */, const Teuchos::EVerbosityLevel /* verbLevel */
670  ) const {}
671  private:
674  };
675 
685  };
687  static const int NUM_E_OUT_ARGS_MEMBERS=7;
688 
692  };
693 
697  };
698 
702  };
703 
707  };
708 
712  };
713 
717  };
718 
722  };
723 
727  };
728 
732  };
733 
786  template<class Scalar>
787  class OutArgs : public Teuchos::Describable {
788  public:
790  OutArgs();
793  int Np() const;
796  int Ng() const;
798  bool supports(EOutArgsMembers arg) const;
801  const DerivativeSupport& supports(EOutArgsDfDp arg, int l) const;
804  const DerivativeSupport& supports(EOutArgsDgDx_dot arg, int j) const;
807  const DerivativeSupport& supports(EOutArgsDgDx arg, int j) const;
810  const DerivativeSupport& supports(EOutArgsDgDp arg, int j, int l) const;
812  void set_f( const Evaluation<VectorBase<Scalar> > &f );
816  void set_g( int j, const Evaluation<VectorBase<Scalar> > &g_j );
818  Evaluation<VectorBase<Scalar> > get_g(int j) const;
820  void set_W( const RCP<LinearOpWithSolveBase<Scalar> > &W );
823 
825  template<typename ObjectType>
826  bool supports() const;
828  template<typename ObjectType>
829  void set(const RCP<const ObjectType>& uo);
831  template<typename ObjectType>
832  RCP<const ObjectType> get() const;
833 
834  const DerivativeSupport& supports(EOutArgsDfDp_mp arg, int l) const;
835  bool supports(EOutArgs_g_mp arg, int j) const;
836  const DerivativeSupport& supports(EOutArgsDgDx_dot_mp arg, int j) const;
837  const DerivativeSupport& supports(EOutArgsDgDx_mp arg, int j) const;
838  const DerivativeSupport& supports(EOutArgsDgDp_mp arg, int j, int l) const;
840  void set_f_mp( const RCP<Stokhos::ProductEpetraVector> &f_mp );
844  void set_g_mp( int j, const RCP<Stokhos::ProductEpetraVector> &g_mp_j );
848  void set_W_mp( const RCP<Stokhos::ProductEpetraOperator> &W_mp );
851 
853  void set_W_op( const RCP<LinearOpBase<Scalar> > &W_op );
857  void set_W_prec( const RCP<PreconditionerBase<Scalar> > &W_prec );
864  void set_DfDp(int l, const Derivative<Scalar> &DfDp_l);
866  Derivative<Scalar> get_DfDp(int l) const;
871  void set_DgDx_dot(int j, const Derivative<Scalar> &DgDx_dot_j);
873  Derivative<Scalar> get_DgDx_dot(int j) const;
878  void set_DgDx(int j, const Derivative<Scalar> &DgDx_j);
880  Derivative<Scalar> get_DgDx(int j) const;
885  void set_DgDp( int j, int l, const Derivative<Scalar> &DgDp_j_l );
887  Derivative<Scalar> get_DgDp(int j, int l) const;
890  DerivativeProperties get_DgDp_properties(int j, int l) const;
891 
892  void set_DfDp_mp(int l, const MPDerivative &DfDp_mp_l);
893  MPDerivative get_DfDp_mp(int l) const;
894  DerivativeProperties get_DfDp_mp_properties(int l) const;
895  void set_DgDx_dot_mp(int j, const MPDerivative &DgDx_dot_mp_j);
896  MPDerivative get_DgDx_dot_mp(int j) const;
897  DerivativeProperties get_DgDx_dot_mp_properties(int j) const;
898  void set_DgDx_mp(int j, const MPDerivative &DgDx_mp_j);
899  MPDerivative get_DgDx_mp(int j) const;
900  DerivativeProperties get_DgDx_mp_properties(int j) const;
901  void set_DgDp_mp( int j, int l, const MPDerivative &DgDp_mp_j_l );
902  MPDerivative get_DgDp_mp(int j, int l) const;
903  DerivativeProperties get_DgDp_mp_properties(int j, int l) const;
904 
905 #ifdef HAVE_THYRA_ME_POLYNOMIAL
906 
907  void set_f_poly( const RCP<Teuchos::Polynomial< VectorBase<Scalar> > > &f_poly );
909  RCP<Teuchos::Polynomial< VectorBase<Scalar> > > get_f_poly() const;
910 #endif // HAVE_THYRA_ME_POLYNOMIAL
911 
916  void setArgs( const OutArgs<Scalar>& outArgs, bool ignoreUnsupported = false );
928  void setFailed() const;
934  bool isFailed() const;
936  bool isEmpty() const;
938  void assertSameSupport( const OutArgs<Scalar> &outArgs ) const;
940  std::string modelEvalDescription() const;
942  std::string description() const;
945  void describe(
946  Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel
947  ) const;
948  protected:
950  void _setModelEvalDescription( const std::string &modelEvalDescription );
952  void _set_Np_Ng(int Np, int Ng);
954  void _setSupports( EOutArgsMembers arg, bool supports );
956  template<typename ObjectType>
957  void _setSupports( const bool supports );
959  void _setSupports( EOutArgsDfDp arg, int l, const DerivativeSupport& );
961  void _setSupports( EOutArgsDgDx_dot arg, int j, const DerivativeSupport& );
963  void _setSupports( EOutArgsDgDx arg, int j, const DerivativeSupport& );
965  void _setSupports( EOutArgsDgDp arg, int j, int l, const DerivativeSupport& );
966 
967  void _setSupports( EOutArgs_g_mp arg, int j, bool supports );
968  void _setSupports( EOutArgsDfDp_mp arg, int l, const DerivativeSupport& );
969  void _setSupports( EOutArgsDgDx_dot_mp arg, int j, const DerivativeSupport& );
970  void _setSupports( EOutArgsDgDx_mp arg, int j, const DerivativeSupport& );
971  void _setSupports( EOutArgsDgDp_mp arg, int j, int l, const DerivativeSupport& );
972 
974  void _set_W_properties( const DerivativeProperties &properties );
976  void _set_DfDp_properties( int l, const DerivativeProperties &properties );
978  void _set_DgDx_dot_properties( int j, const DerivativeProperties &properties );
980  void _set_DgDx_properties( int j, const DerivativeProperties &properties );
982  void _set_DgDp_properties( int j, int l, const DerivativeProperties &properties );
983 
984  void _set_DfDp_mp_properties( int l, const DerivativeProperties &properties );
985  void _set_DgDx_dot_mp_properties( int j, const DerivativeProperties &properties );
986  void _set_DgDx_mp_properties( int j, const DerivativeProperties &properties );
987  void _set_DgDp_mp_properties( int j, int l, const DerivativeProperties &properties );
988 
990  void _setSupports( const OutArgs<Scalar>& inputOutArgs );
995  private:
996  // types
1001  // data
1002  std::string modelEvalDescription_;
1003  bool supports_[NUM_E_OUT_ARGS_MEMBERS];
1004  supports_t supports_DfDp_; // Np
1005  supports_t supports_DgDx_dot_; // Ng
1006  supports_t supports_DgDx_; // Ng
1007  supports_t supports_DgDp_; // Ng x Np
1009  g_t g_; // Ng
1011  RCP<LinearOpBase<Scalar> > W_op_;
1013  DerivativeProperties W_properties_;
1014  deriv_t DfDp_; // Np
1015  deriv_properties_t DfDp_properties_; // Np
1016  deriv_t DgDx_dot_; // Ng
1017  deriv_t DgDx_; // Ng
1018  deriv_properties_t DgDx_dot_properties_; // Ng
1019  deriv_properties_t DgDx_properties_; // Ng
1020  deriv_t DgDp_; // Ng x Np
1021  deriv_properties_t DgDp_properties_; // Ng x Np
1022 
1023  Teuchos::Array<bool> supports_g_mp_; //Ng
1024  supports_t supports_DfDp_mp_; // Np_mp
1025  supports_t supports_DgDx_dot_mp_; // Ng_mp
1026  supports_t supports_DgDx_mp_; // Ng_mp
1027  supports_t supports_DgDp_mp_; // Ng_mp x Np_mp
1032  Teuchos::Array<MPDerivative> DgDx_dot_mp_;
1035  deriv_properties_t DfDp_mp_properties_;
1036  deriv_properties_t DgDx_dot_mp_properties_;
1037  deriv_properties_t DgDx_mp_properties_;
1038  deriv_properties_t DgDp_mp_properties_;
1039 
1040 #ifdef HAVE_THYRA_ME_POLYNOMIAL
1042 #endif // HAVE_THYRA_ME_POLYNOMIAL
1043  mutable bool isFailed_;
1044 
1045  std::map<std::string,Teuchos::any> extended_outargs_;
1046 
1047  // functions
1048  void assert_supports(EOutArgsMembers arg) const;
1049  void assert_supports(
1050  EOutArgsDfDp arg, int l,
1051  const Derivative<Scalar> &deriv = Derivative<Scalar>()
1052  ) const;
1053  void assert_supports(
1054  EOutArgsDgDx_dot arg, int j,
1055  const Derivative<Scalar> &deriv = Derivative<Scalar>()
1056  ) const;
1057  void assert_supports(
1058  EOutArgsDgDx arg, int j,
1059  const Derivative<Scalar> &deriv = Derivative<Scalar>()
1060  ) const;
1061  void assert_supports(
1062  EOutArgsDgDp arg, int j, int l,
1063  const Derivative<Scalar> &deriv = Derivative<Scalar>()
1064  ) const;
1065 
1066  void assert_supports(EOutArgs_g_mp arg, int j) const;
1067  void assert_supports(
1068  EOutArgsDfDp_mp arg, int l,
1069  const MPDerivative &deriv = MPDerivative()
1070  ) const;
1071  void assert_supports(
1072  EOutArgsDgDx_dot_mp arg, int j,
1073  const MPDerivative &deriv = MPDerivative()
1074  ) const;
1075  void assert_supports(
1076  EOutArgsDgDx_mp arg, int j,
1077  const MPDerivative &deriv = MPDerivative()
1078  ) const;
1079  void assert_supports(
1080  EOutArgsDgDp_mp arg, int j, int l,
1081  const MPDerivative &deriv = MPDerivative()
1082  ) const;
1083 
1084  void assert_l(int l) const;
1085  void assert_j(int j) const;
1086  };
1087 
1089 
1090 // Added since at least gcc 3.3.4 does not do the right thing here!
1091 #ifdef HAVE_PROTECTED_NESTED_TEMPLATE_CLASS_ACCESS
1092 protected:
1093 #endif
1094 
1097 
1105  template<class Scalar>
1106  class InArgsSetup : public InArgs<Scalar> {
1107  public:
1109  InArgsSetup();
1111  InArgsSetup( const InArgs<Scalar>& );
1113  void setModelEvalDescription( const std::string &modelEvalDescription );
1115  void set_Np(int Np);
1117  void setSupports( EInArgsMembers arg, bool supports = true );
1119  void setSupports( const InArgs<Scalar>& inputInArgs, const int Np = -1 );
1121  template<typename ObjectType>
1122  void setSupports(const bool supports = true);
1125 
1126  void setSupports( EInArgs_p_mp arg, int l, bool supports);
1127  };
1128 
1136  template<class Scalar>
1137  class OutArgsSetup : public OutArgs<Scalar> {
1138  public:
1140  OutArgsSetup();
1142  OutArgsSetup( const OutArgs<Scalar>& );
1144  void setModelEvalDescription( const std::string &modelEvalDescription );
1146  void set_Np_Ng(int Np, int Ng);
1148  void setSupports( EOutArgsMembers arg, bool supports = true );
1150  void setSupports(EOutArgsDfDp arg, int l, const DerivativeSupport& );
1152  void setSupports(EOutArgsDgDx_dot arg, int j, const DerivativeSupport& );
1154  void setSupports(EOutArgsDgDx arg, int j, const DerivativeSupport& );
1156  void setSupports(EOutArgsDgDp arg, int j, int l, const DerivativeSupport& );
1158  template<typename ObjectType>
1159  void setSupports(const bool supports = true);
1160 
1161  void setSupports( EOutArgs_g_mp arg, int j, bool supports);
1162  void setSupports(EOutArgsDfDp_mp arg, int l, const DerivativeSupport& );
1163  void setSupports(EOutArgsDgDx_dot_mp arg, int j, const DerivativeSupport& );
1164  void setSupports(EOutArgsDgDx_mp arg, int j, const DerivativeSupport& );
1165  void setSupports(EOutArgsDgDp_mp arg, int j, int l, const DerivativeSupport& );
1166 
1168  void set_W_properties( const DerivativeProperties &properties );
1170  void set_DfDp_properties( int l, const DerivativeProperties &properties );
1172  void set_DgDx_dot_properties( int j, const DerivativeProperties &properties );
1174  void set_DgDx_properties( int j, const DerivativeProperties &properties );
1176  void set_DgDp_properties( int j, int l, const DerivativeProperties &properties );
1177 
1178  void set_DfDp_mp_properties( int l, const DerivativeProperties &properties );
1179  void set_DgDx_dot_mp_properties( int j, const DerivativeProperties &properties );
1180  void set_DgDx_mp_properties( int j, const DerivativeProperties &properties );
1181  void set_DgDp_mp_properties( int j, int l, const DerivativeProperties &properties );
1182 
1184  void setSupports( const OutArgs<Scalar>& inputOutArgs );
1189  };
1190 
1192 
1195 
1198 
1200 
1201 private:
1202  // Not defined and not to be called
1204  ModelEvaluatorBase& operator=(const ModelEvaluatorBase&);
1205 
1206 }; // ModelEvaluatorBase
1207 
1208 
1211 
1212 
1215 
1216 
1218 std::string toString(
1220  );
1221 
1222 
1225 getOtherDerivativeMultiVectorOrientation(
1227  );
1228 
1229 
1230 } // namespace Thyra
1231 
1232 
1233 // //////////////////////////////////
1234 // Inline Defintions
1235 
1236 // Extended InArgs
1237 template<class Scalar>
1238 template<typename ObjectType>
1240 {
1241  std::map<std::string,Teuchos::any>::const_iterator search =
1242  extended_inargs_.find(typeid(ObjectType).name());
1243 
1244  if (search == extended_inargs_.end())
1245  return false;
1246 
1247  return true;
1248 }
1249 
1250 template<class Scalar>
1251 template<typename ObjectType>
1253 {
1254  std::map<std::string,Teuchos::any>::iterator search = extended_inargs_.find(typeid(ObjectType).name());
1255  TEUCHOS_TEST_FOR_EXCEPTION(search == extended_inargs_.end(),
1256  std::runtime_error,
1257  "ERROR: InArgs::set<ObjectType>() was called with unsupported extended data type \""
1258  << typeid(ObjectType).name() << "\"!");
1259 
1260  search->second = Teuchos::any(eo);
1261 }
1262 
1263 template<class Scalar>
1264 template<typename ObjectType>
1267 {
1268  std::map<std::string,Teuchos::any>::const_iterator search = extended_inargs_.find(typeid(ObjectType).name());
1269  TEUCHOS_TEST_FOR_EXCEPTION(search == extended_inargs_.end(),
1270  std::runtime_error,
1271  "ERROR: InArgs::get<ObjectType>() was called with unsupported extended data type \""
1272  << typeid(ObjectType).name() << "\"!");
1273 
1274  return Teuchos::any_cast<Teuchos::RCP<const ObjectType> >(search->second);
1275 }
1276 
1277 template<class Scalar>
1278 template<class ObjectType>
1280 setSupports(const bool in_supports)
1281 {
1282  this->template _setSupports<ObjectType>(in_supports);
1283 }
1284 
1285 template<class Scalar>
1286 template<class ObjectType>
1288 _setSupports(const bool in_supports)
1289 {
1290  if (in_supports)
1291  // When supports() is called, the map is searched to check for
1292  // supporting a type. If we support the type, we will insert an
1293  // empty placholder for now so that the search is successful for
1294  // support checks.
1295  this->extended_inargs_[typeid(ObjectType).name()] = Teuchos::any();
1296  else {
1297  // if false, remove the entry
1298  std::map<std::string,Teuchos::any>::iterator search =
1299  this->extended_inargs_.find(typeid(ObjectType).name());
1300 
1301  if (search != this->extended_inargs_.end())
1302  this->extended_inargs_.erase(typeid(ObjectType).name());
1303  }
1304 }
1305 
1306 // Extended OutArgs
1307 template<class Scalar>
1308 template<typename ObjectType>
1310 {
1311  std::map<std::string,Teuchos::any>::const_iterator search =
1312  extended_outargs_.find(typeid(ObjectType).name());
1313 
1314  if (search == extended_outargs_.end())
1315  return false;
1316 
1317  return true;
1318 }
1319 
1320 template<class Scalar>
1321 template<typename ObjectType>
1323 {
1324  std::map<std::string,Teuchos::any>::iterator search = extended_outargs_.find(typeid(ObjectType).name());
1325  TEUCHOS_TEST_FOR_EXCEPTION(search == extended_outargs_.end(),
1326  std::runtime_error,
1327  "ERROR: OutArgs::set<ObjectType>() was called with unsupported extended data type \""
1328  << typeid(ObjectType).name() << "\"!");
1329 
1330  search->second = Teuchos::any(eo);
1331 }
1332 
1333 template<class Scalar>
1334 template<typename ObjectType>
1337 {
1338  std::map<std::string,Teuchos::any>::const_iterator search = extended_outargs_.find(typeid(ObjectType).name());
1339  TEUCHOS_TEST_FOR_EXCEPTION(search == extended_outargs_.end(),
1340  std::runtime_error,
1341  "ERROR: OutArgs::get<ObjectType>() was called with unsupported extended data type \""
1342  << typeid(ObjectType).name() << "\"!");
1343 
1344  return Teuchos::any_cast<Teuchos::RCP<const ObjectType> >(search->second);
1345 }
1346 
1347 template<class Scalar>
1348 template<class ObjectType>
1350 setSupports(const bool in_supports)
1351 {
1352  this->template _setSupports<ObjectType>(in_supports);
1353 }
1354 
1355 template<class Scalar>
1356 template<class ObjectType>
1358 _setSupports(const bool in_supports)
1359 {
1360  if (in_supports)
1361  // When supports() is called, the map is searched to check for
1362  // supporting a type. If we support the type, we will insert an
1363  // empty placholder for now so that the search is successful for
1364  // support checks.
1365  this->extended_outargs_[typeid(ObjectType).name()] = Teuchos::any();
1366  else {
1367  // if false, remove the entry
1368  std::map<std::string,Teuchos::any>::iterator search =
1369  this->extended_outargs_.find(typeid(ObjectType).name());
1370 
1371  if (search != this->extended_outargs_.end())
1372  this->extended_outargs_.erase(typeid(ObjectType).name());
1373  }
1374 }
1375 
1376 //
1377 // Thyra_MEB_helper_functions_grp
1378 //
1379 
1380 
1381 inline
1383 {
1384  switch(arg) {
1385  case ModelEvaluatorBase::IN_ARG_x_dot_dot:
1386  return "IN_ARG_x_dot_dot";
1387  case ModelEvaluatorBase::IN_ARG_x_dot:
1388  return "IN_ARG_x_dot";
1389  case ModelEvaluatorBase::IN_ARG_x:
1390  return "IN_ARG_x";
1391  case ModelEvaluatorBase::IN_ARG_x_dot_poly:
1392  return "IN_ARG_x_dot_poly";
1393  case ModelEvaluatorBase::IN_ARG_x_poly:
1394  return "IN_ARG_x_poly";
1395  case ModelEvaluatorBase::IN_ARG_x_dot_mp:
1396  return "IN_ARG_x_dot_mp";
1397  case ModelEvaluatorBase::IN_ARG_x_mp:
1398  return "IN_ARG_x_mp";
1399  case ModelEvaluatorBase::IN_ARG_t:
1400  return "IN_ARG_t";
1401  case ModelEvaluatorBase::IN_ARG_alpha:
1402  return "IN_ARG_alpha";
1403  case ModelEvaluatorBase::IN_ARG_beta:
1404  return "IN_ARG_beta";
1405  case ModelEvaluatorBase::IN_ARG_W_x_dot_dot_coeff:
1406  return "IN_ARG_W_x_dot_dot_coeff";
1407  case ModelEvaluatorBase::IN_ARG_step_size:
1408  return "IN_ARG_step_size";
1409  case ModelEvaluatorBase::IN_ARG_stage_number:
1410  return "IN_ARG_stage_number";
1411 #ifdef TEUCHOS_DEBUG
1412  default:
1414 #endif
1415  }
1416  return ""; // Will never be executed!
1417 }
1418 
1419 
1420 inline
1421 std::string Thyra::toString(ModelEvaluatorBase::EOutArgsMembers arg)
1422 {
1423  switch(arg) {
1424  case ModelEvaluatorBase::OUT_ARG_f:
1425  return "OUT_ARG_f";
1426  case ModelEvaluatorBase::OUT_ARG_W:
1427  return "OUT_ARG_W";
1428  case ModelEvaluatorBase::OUT_ARG_f_mp:
1429  return "OUT_ARG_f_mp";
1430  case ModelEvaluatorBase::OUT_ARG_W_mp:
1431  return "OUT_ARG_W_mp";
1432  case ModelEvaluatorBase::OUT_ARG_W_op:
1433  return "OUT_ARG_W_op";
1434  case ModelEvaluatorBase::OUT_ARG_W_prec:
1435  return "OUT_ARG_W_prec";
1436  case ModelEvaluatorBase::OUT_ARG_f_poly:
1437  return "OUT_ARG_f_poly";
1438 #ifdef TEUCHOS_DEBUG
1439  default:
1441 #endif
1442  }
1443  return ""; // Will never be executed!
1444 }
1445 
1446 
1447 inline
1448 std::string Thyra::toString(
1449  ModelEvaluatorBase::EDerivativeMultiVectorOrientation orientation
1450  )
1451 {
1452  switch(orientation) {
1453  case ModelEvaluatorBase::DERIV_MV_BY_COL:
1454  return "DERIV_MV_BY_COL";
1455  case ModelEvaluatorBase::DERIV_TRANS_MV_BY_ROW:
1456  return "DERIV_TRANS_MV_BY_ROW";
1457 #ifdef TEUCHOS_DEBUG
1458  default:
1460 #endif
1461  }
1462  return ""; // Should never execute this!
1463 }
1464 
1465 
1466 inline
1468 Thyra::getOtherDerivativeMultiVectorOrientation(
1469  ModelEvaluatorBase::EDerivativeMultiVectorOrientation orientation
1470  )
1471 {
1472  switch(orientation) {
1473  case ModelEvaluatorBase::DERIV_MV_BY_COL:
1474  return ModelEvaluatorBase::DERIV_TRANS_MV_BY_ROW;
1475  case ModelEvaluatorBase::DERIV_TRANS_MV_BY_ROW:
1476  return ModelEvaluatorBase::DERIV_MV_BY_COL;
1477 #ifdef TEUCHOS_DEBUG
1478  default:
1480 #endif
1481  }
1482  return ModelEvaluatorBase::DERIV_MV_BY_COL; // Should never execute this!
1483 }
1484 
1485 
1486 #endif // THYRA_MODEL_EVALUATOR_BASE_DECL_HPP
Protected subclass of InArgs that only ModelEvaluator subclasses can access to set up the selection o...
int Ng() const
Return the number of axillary response functions g(j)(...) supported (Ng &gt;= 0).
bool supports(EDerivativeMultiVectorOrientation mvOrientation) const
EDerivativeMultiVectorOrientation getOrientation() const
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Create a more detailed description along about this object and the ModelEvaluator that created it...
RCP< Stokhos::ProductEpetraMultiVector > getMultiVector() const
RCP< MultiVectorBase< Scalar > > getMultiVector() const
void set_DgDx_properties(int j, const DerivativeProperties &properties)
MPDerivative(const RCP< Stokhos::ProductEpetraOperator > &lo)
void set_DfDp_properties(int l, const DerivativeProperties &properties)
Base class for all linear operators that can support a high-level solve operation.
bool is_null(const boost::shared_ptr< T > &p)
void set_step_size(Scalar step_size)
Precondition: supports(IN_ARG_step_size)==true.
Scalar get_beta() const
Precondition: supports(IN_ARG_beta)==true.
RCP< Stokhos::ProductEpetraVector > get_g_mp(int j) const
Precondition: supports(OUT_ARG_g_mp)==true..
void set_x_dot_dot(const RCP< const VectorBase< Scalar > > &x_dot_dot)
Precondition: supports(IN_ARG_x_dot_dot)==true.
void setArgs(const OutArgs< Scalar > &outArgs, bool ignoreUnsupported=false)
Set all arguments fron outArgs into *this.
bool supports() const
Determines if an extended input argument of type ObjectType is supported.
ScalarMag get_t() const
.Precondition: supports(IN_ARG_t)==true
void _set_DfDp_properties(int l, const DerivativeProperties &properties)
Concrete aggregate class for all output arguments computable by a ModelEvaluator subclass object...
Derivative< Scalar > get_DfDp(int l) const
Precondition: supports(OUT_ARG_DfDp,l)==true.
void set_g(int j, const Evaluation< VectorBase< Scalar > > &g_j)
Precondition: supports(OUT_ARG_g)==true.
RCP< const VectorBase< Scalar > > get_x_dot() const
Precondition: supports(IN_ARG_x_dot)==true.
MPDerivative(const RCP< Stokhos::ProductEpetraMultiVector > &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL)
void setModelEvalDescription(const std::string &modelEvalDescription)
void set_W_mp(const RCP< Stokhos::ProductEpetraOperator > &W_mp)
Precondition: supports(OUT_ARG_W_mp)==true.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
void _set_DgDx_dot_properties(int j, const DerivativeProperties &properties)
void set_W_prec(const RCP< PreconditionerBase< Scalar > > &W_prec)
Precondition: supports(OUT_ARG_W_op)==true.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Create a more detailed description along about this object and the ModelEvaluator that created it...
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
void set(const RCP< const ObjectType > &uo)
Set an extended output argument of type ObjectType in OutArgs. Precondition: supports()==true.
void changeOrientation(const EDerivativeMultiVectorOrientation orientation)
void describe(Teuchos::FancyOStream &, const Teuchos::EVerbosityLevel) const
void set_x_dot_mp(const RCP< const Stokhos::ProductEpetraVector > &x_dot_mp)
Precondition: supports(IN_ARG_x_dot_mp)==true.
Simple aggregate class that stores a derivative object as a general linear operator or as a multi-vec...
void set(const RCP< const ObjectType > &uo)
Set an extended input object of type ObjectType in the InArgs. Precondition: supports()==true.
bool isSameSupport(const DerivativeSupport &derivSupport) const
Evaluation< VectorBase< Scalar > > get_g(int j) const
Precondition: supports(OUT_ARG_g)==true..
DerivativeMultiVector(const RCP< MultiVectorBase< Scalar > > &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL)
Evaluation< VectorBase< Scalar > > get_f() const
Precondition: supports(OUT_ARG_f)==true.
Jacobian form DhDz (nz columns of h_space vectors)
T * get() const
RCP< const ObjectType > get() const
Get an extended input object of type ObjectType&gt;/tt&gt; from the InArgs. Precondition: supports()==true...
RCP< const Stokhos::ProductEpetraVector > get_x_mp() const
Precondition: supports(IN_ARG_x_mp)==true.
void _setSupports(EOutArgsMembers arg, bool supports)
MPDerivative(const MPDerivativeMultiVector &dmv)
Derivative(const RCP< MultiVectorBase< Scalar > > &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL)
Evaluation(const RCP< ObjType > &obj)
Implicit conversion from RCP&lt;ObjType&gt;.
Simple interface class to access a precreated preconditioner as one or more linear operators objects ...
DerivativeProperties get_DgDx_dot_properties(int j) const
Return the know properties of DgDx_dot(j) (precondition: supports(OUT_ARG_DgDx_dot,j)==true).
DerivativeSupport & plus(EDerivativeMultiVectorOrientation mvOrientation)
Simple aggregate class for a derivative object represented as a column-wise multi-vector or its trans...
Derivative< Scalar > get_DgDp(int j, int l) const
Precondition: supports(OUT_ARG_DgDp,j,l)==true.
bool isSupportedBy(const DerivativeSupport &derivSupport) const
Returns true if the form of the derivative contained here is supported by deriveSupport.
void changeOrientation(const EDerivativeMultiVectorOrientation orientation)
RCP< const ObjectType > get() const
Get an extended output argument of type ObjectType from OutArgs. Precondition: supports()==true.
Gradient form DhDz^T (nh columns of z_space vectors)
bool isSupportedBy(const DerivativeSupport &derivSupport) const
Returns true if the form of the derivative contained here is supported by deriveSupport.
DerivativeProperties get_DgDx_properties(int j) const
Return the know properties of DgDx(j) (precondition: supports(OUT_ARG_DgDx,j)==true).
Evaluation(const RCP< ObjType > &obj, EEvalType evalType)
MPDerivativeMultiVector getDerivativeMultiVector() const
void set_W_properties(const DerivativeProperties &properties)
void setSupports(EInArgsMembers arg, bool supports=true)
int Np() const
Return the number of parameter subvectors p(l) supported (Np &gt;= 0).
void set_stage_number(Scalar stage_number)
Precondition: supports(IN_ARG_stage_number)==true.
void set_x(const RCP< const VectorBase< Scalar > > &x)
Precondition: supports(IN_ARG_x)==true.
Simple aggregate class for a derivative object represented as a column-wise multi-vector or its trans...
Interface for a collection of column vectors called a multi-vector.
void setArgs(const InArgs< Scalar > &inArgs, bool ignoreUnsupported=false, bool cloneObjects=false)
Set non-null arguments (does not overwrite non-NULLs with NULLs) .
void set_DgDp(int j, int l, const Derivative< Scalar > &DgDp_j_l)
Precondition: supports(OUT_ARG_DgDp,j,l)==true.
EDerivativeMultiVectorOrientation getMultiVectorOrientation() const
void set_DgDp_properties(int j, int l, const DerivativeProperties &properties)
Teuchos::ScalarTraits< Scalar >::magnitudeType ScalarMag
RCP< Stokhos::ProductEpetraOperator > getLinearOp() const
DerivativeSupport(EDerivativeMultiVectorOrientation mvOrientation)
DerivativeMultiVector< Scalar > getDerivativeMultiVector() const
RCP< const Stokhos::ProductEpetraVector > get_x_dot_mp() const
Precondition: supports(IN_ARG_x_dotmp)==true.
Derivative(const DerivativeMultiVector< Scalar > &dmv)
void _setModelEvalDescription(const std::string &modelEvalDescription)
Abstract interface for finite-dimensional dense vectors.
TEUCHOSCORE_LIB_DLL_EXPORT std::string toString(const EVerbosityLevel verbLevel)
Simple public strict containing properties of a derivative object.
void _setSupports(EInArgsMembers arg, bool supports)
void describe(Teuchos::FancyOStream &, const Teuchos::EVerbosityLevel) const
RCP< T > & operator=(const RCP< T > &r_ptr)
void assertSameSupport(const OutArgs< Scalar > &outArgs) const
Assert that two OutArgs objects have the same support.
Scalar get_W_x_dot_dot_coeff() const
Precondition: supports(IN_ARG_W_x_dot_dot_coeff)==true.
void set_x_dot(const RCP< const VectorBase< Scalar > > &x_dot)
Precondition: supports(IN_ARG_x_dot)==true.
Base class for all linear operators.
RCP< Stokhos::ProductEpetraOperator > get_W_mp() const
Precondition: supports(OUT_ARG_W_mp)==true.
DerivativeProperties get_DgDp_properties(int j, int l) const
Return the know properties of DgDp(j,l) (precondition: supports(OUT_ARG_DgDp,j,l)==true).
Derivative(const RCP< LinearOpBase< Scalar > > &lo)
void set_DgDx_dot_properties(int j, const DerivativeProperties &properties)
bool isFailed() const
Return if the evaluation failed or not.
const RCP< T > & assert_not_null() const
void _set_DgDx_properties(int j, const DerivativeProperties &properties)
void set_g_mp(int j, const RCP< Stokhos::ProductEpetraVector > &g_mp_j)
Precondition: supports(OUT_ARG_g_mp)==true.
DerivativeProperties(EDerivativeLinearity in_linearity, ERankStatus in_rank, bool in_supportsAdjoint)
Base subclass for ModelEvaluator that defines some basic types.
void set_t(ScalarMag t)
Precondition: supports(IN_ARG_t)==true.
void set_x_mp(const RCP< const Stokhos::ProductEpetraVector > &x_mp)
Precondition: supports(IN_ARG_x_mp)==true.
void set_DgDx_dot(int j, const Derivative< Scalar > &DgDx_dot_j)
Precondition: supports(OUT_ARG_DgDx_dot,j)==true.
void assertSameSupport(const InArgs< Scalar > &inArgs) const
Assert that two InArgs objects have the same support.
void set_p(int l, const RCP< const VectorBase< Scalar > > &p_l)
Set p(l) where 0 &lt;= l &amp;&amp; l &lt; this-&gt;Np().
void setSupports(EOutArgsMembers arg, bool supports=true)
RCP< LinearOpWithSolveBase< Scalar > > get_W() const
Precondition: supports(OUT_ARG_W)==true.
#define TEUCHOS_UNREACHABLE_RETURN(dummyReturnVal)
void _set_DgDp_properties(int j, int l, const DerivativeProperties &properties)
void set_W(const RCP< LinearOpWithSolveBase< Scalar > > &W)
Precondition: supports(OUT_ARG_W)==true.
Scalar get_alpha() const
Precondition: supports(IN_ARG_alpha)==true.
void setFailed() const
Set that the evaluation as a whole failed.
bool supports() const
Determines if an extended output argument of type ObjectType is supported.
RCP< Stokhos::ProductEpetraMultiVector > getMultiVector() const
Scalar get_stage_number() const
Precondition: supports(IN_ARG_stage_number)==true.
RCP< Stokhos::ProductEpetraVector > get_f_mp() const
Precondition: supports(OUT_ARG_f_mp)==true.
void set_alpha(Scalar alpha)
Precondition: supports(IN_ARG_alpha)==true.
void _set_W_properties(const DerivativeProperties &properties)
Derivative< Scalar > get_DgDx_dot(int j) const
Precondition: supports(OUT_ARG_DgDx_dot,j)==true.
void set_DfDp(int l, const Derivative< Scalar > &DfDp_l)
Precondition: supports(OUT_ARG_DfDp,l)==true.
EDerivativeMultiVectorOrientation getOrientation() const
RCP< PreconditionerBase< Scalar > > get_W_prec() const
Precondition: supports(OUT_ARG_W_op)==true.
const Derivative< Scalar > & assert_not_null() const
void set_f_mp(const RCP< Stokhos::ProductEpetraVector > &f_mp)
Precondition: supports(OUT_ARG_f_mp)==true.
Determines the forms of a general derivative that are supported.
int Np() const
Return the number of parameter subvectors p(l) supported (Np &gt;= 0).
Scalar get_step_size() const
Precondition: supports(IN_ARG_step_size)==true.
RCP< const VectorBase< Scalar > > get_x_dot_dot() const
Precondition: supports(IN_ARG_x_dot_dot)==true.
void set_f(const Evaluation< VectorBase< Scalar > > &f)
Precondition: supports(OUT_ARG_f)==true.
void set_beta(Scalar beta)
Precondition: supports(IN_ARG_beta)==true.
void set_DgDx(int j, const Derivative< Scalar > &DgDx_j)
Precondition: supports(OUT_ARG_DgDx,j)==true.
void setModelEvalDescription(const std::string &modelEvalDescription)
Type to embed evaluation accuracy with an RCP-managed object.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Simple aggregate class that stores a derivative object as a general linear operator or as a multi-vec...
const DerivativeMultiVector< Scalar > & assert_not_null() const
void set_W_x_dot_dot_coeff(Scalar W_x_dot_dot_coeff)
Precondition: supports(IN_ARG_W_x_dot_dot_coeff)==true.
MPDerivativeMultiVector(const RCP< Stokhos::ProductEpetraMultiVector > &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL, const Teuchos::Array< int > &paramIndexes=Teuchos::Array< int >())
RCP< LinearOpBase< Scalar > > get_W_op() const
Precondition: supports(OUT_ARG_W_op)==true.
void set_W_op(const RCP< LinearOpBase< Scalar > > &W_op)
Precondition: supports(OUT_ARG_W_op)==true.
EDerivativeMultiVectorOrientation getMultiVectorOrientation() const
DerivativeProperties get_DfDp_properties(int l) const
Return the know properties of DfDp(l) (precondition: supports(OUT_ARG_DfDp,l)==true).
RCP< const VectorBase< Scalar > > get_x() const
Precondition: supports(IN_ARG_x)==true.
void _setModelEvalDescription(const std::string &modelEvalDescription)
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
RCP< LinearOpBase< Scalar > > getLinearOp() const
RCP< const VectorBase< Scalar > > get_p(int l) const
Get p(l) where 0 &lt;= l &amp;&amp; l &lt; this-&gt;Np().
Protected subclass of OutArgs that only ModelEvaluator subclasses can access to set up the selection ...
DerivativeProperties get_W_properties() const
Return the known properties of W (precondition: supports(OUT_ARG_f)==true).
RCP< MultiVectorBase< Scalar > > getMultiVector() const
Derivative< Scalar > get_DgDx(int j) const
Precondition: supports(OUT_ARG_DgDx,j)==true.
void reset(const RCP< ObjType > &obj, EEvalType evalType)
Concrete aggregate class for all input arguments computable by a ModelEvaluator subclass object...