10 #ifndef THYRA_MODEL_EVALUATOR_BASE_DECL_HPP
11 #define THYRA_MODEL_EVALUATOR_BASE_DECL_HPP
14 #include "Thyra_LinearOpWithSolveBase.hpp"
15 #include "Teuchos_Describable.hpp"
16 #include "Teuchos_any.hpp"
17 #include "Teuchos_Assert.hpp"
19 #ifdef HAVE_THYRA_ME_POLYNOMIAL
20 # include "Teuchos_Polynomial.hpp"
24 class ProductEpetraVector;
25 class ProductEpetraMultiVector;
26 class ProductEpetraOperator;
126 template<
class Scalar>
173 template<
typename ObjectType>
176 template<
typename ObjectType>
179 template<
typename ObjectType>
182 #ifdef HAVE_THYRA_ME_POLYNOMIAL
193 #endif // HAVE_THYRA_ME_POLYNOMIAL
244 bool cloneObjects =
false
269 template<
typename ObjectType>
278 std::string modelEvalDescription_;
289 #ifdef HAVE_THYRA_ME_POLYNOMIAL
292 #endif // HAVE_THYRA_ME_POLYNOMIAL
298 Scalar W_x_dot_dot_coeff_;
300 Scalar stage_number_;
306 void assert_l(
int l)
const;
307 void assert_j(
int j)
const;
309 std::map<std::string,Teuchos::any> extended_inargs_;
325 template<
class ObjType>
330 : evalType_(EVAL_TYPE_EXACT) {}
335 :
RCP<ObjType>(obj), evalType_(EVAL_TYPE_EXACT) {}
338 :
RCP<ObjType>(obj), evalType_(evalType) {}
343 { this->
operator=(obj); evalType_ = evalType; }
367 :supportsLinearOp_(false), supportsMVByCol_(false), supportsTransMVByRow_(false)
371 :supportsLinearOp_(true), supportsMVByCol_(false), supportsTransMVByRow_(false)
375 :supportsLinearOp_(false), supportsMVByCol_(mvOrientation==
DERIV_MV_BY_COL)
380 { supportsLinearOp_ =
true;
return *
this; }
384 switch(mvOrientation) {
393 {
return ( !supportsLinearOp_ && !supportsMVByCol_ && !supportsTransMVByRow_ ); }
396 {
return supportsLinearOp_; }
400 switch(mvOrientation) {
411 supportsLinearOp_ == derivSupport.supportsLinearOp_
412 && supportsMVByCol_ == derivSupport.supportsMVByCol_
413 && supportsTransMVByRow_ == derivSupport.supportsTransMVByRow_
419 bool supportsLinearOp_;
420 bool supportsMVByCol_;
421 bool supportsTransMVByRow_;
456 bool in_supportsAdjoint
466 template<
class Scalar>
480 { orientation_ = orientation; };
483 { mv_.assert_not_null();
return *
this; }
489 {
return orientation_; }
504 template<
class Scalar>
516 ) : dmv_(mv,orientation) {}
522 {
return ( lo_.get()==NULL && dmv_.getMultiVector().get()==NULL ); }
525 { dmv_.assert_not_null(); lo_.assert_not_null();
return *
this; }
531 {
return dmv_.getMultiVector(); }
534 {
return dmv_.getOrientation(); }
544 if (derivSupport.
none())
580 ) : mv_(mv.
assert_not_null()), orientation_(orientation), paramIndexes_(paramIndexes) {}
583 { orientation_ = orientation; };
592 {
return orientation_; }
595 {
return paramIndexes_; }
622 ) : dmv_(mv,orientation) {}
650 if (derivSupport.
none())
705 #ifdef Thyra_BUILD_HESSIAN_SUPPORT
707 enum EOutArgs_hess_vec_prod_f_xx {
708 OUT_ARG_hess_vec_prod_f_xx
712 enum EOutArgs_hess_vec_prod_f_xp {
713 OUT_ARG_hess_vec_prod_f_xp
717 enum EOutArgs_hess_vec_prod_f_px {
718 OUT_ARG_hess_vec_prod_f_px
722 enum EOutArgs_hess_vec_prod_f_pp {
723 OUT_ARG_hess_vec_prod_f_pp
727 enum EOutArgs_hess_vec_prod_g_xx {
728 OUT_ARG_hess_vec_prod_g_xx
732 enum EOutArgs_hess_vec_prod_g_xp {
733 OUT_ARG_hess_vec_prod_g_xp
737 enum EOutArgs_hess_vec_prod_g_px {
738 OUT_ARG_hess_vec_prod_g_px
742 enum EOutArgs_hess_vec_prod_g_pp {
743 OUT_ARG_hess_vec_prod_g_pp
747 enum EOutArgs_hess_f_xx {
752 enum EOutArgs_hess_f_xp {
757 enum EOutArgs_hess_f_pp {
762 enum EOutArgs_hess_g_xx {
767 enum EOutArgs_hess_g_xp {
772 enum EOutArgs_hess_g_pp {
790 #endif // ifdef Thyra_BUILD_HESSIAN_SUPPORT
869 template<
class Scalar>
895 #ifdef Thyra_BUILD_HESSIAN_SUPPORT
897 bool supports(EOutArgs_hess_vec_prod_f_xx arg)
const;
900 bool supports(EOutArgs_hess_vec_prod_f_xp arg,
int l)
const;
903 bool supports(EOutArgs_hess_vec_prod_f_px arg,
int l)
const;
906 bool supports(EOutArgs_hess_vec_prod_f_pp arg,
int l1,
int l2)
const;
909 bool supports(EOutArgs_hess_vec_prod_g_xx arg,
int j)
const;
912 bool supports(EOutArgs_hess_vec_prod_g_xp arg,
int j,
int l)
const;
915 bool supports(EOutArgs_hess_vec_prod_g_px arg,
int j,
int l)
const;
918 bool supports(EOutArgs_hess_vec_prod_g_pp arg,
int j,
int l1,
int l2)
const;
920 bool supports(EOutArgs_hess_f_xx arg)
const;
923 bool supports(EOutArgs_hess_f_xp arg,
int l)
const;
926 bool supports(EOutArgs_hess_f_pp arg,
int l1,
int l2)
const;
929 bool supports(EOutArgs_hess_g_xx arg,
int j)
const;
932 bool supports(EOutArgs_hess_g_xp arg,
int j,
int l)
const;
935 bool supports(EOutArgs_hess_g_pp arg,
int j,
int l1,
int l2)
const;
937 bool supports(EOutArgs_H_xx arg)
const;
940 bool supports(EOutArgs_H_xp arg,
int l)
const;
943 bool supports(EOutArgs_H_pp arg,
int l1,
int l2)
const;
944 #endif // ifdef Thyra_BUILD_HESSIAN_SUPPORT
960 template<
typename ObjectType>
963 template<
typename ObjectType>
966 template<
typename ObjectType>
1027 #ifdef Thyra_BUILD_HESSIAN_SUPPORT
1103 #endif // ifdef Thyra_BUILD_HESSIAN_SUPPORT
1105 void set_DfDp_mp(
int l,
const MPDerivative &DfDp_mp_l);
1108 void set_DgDx_dot_mp(
int j,
const MPDerivative &DgDx_dot_mp_j);
1111 void set_DgDx_mp(
int j,
const MPDerivative &DgDx_mp_j);
1114 void set_DgDp_mp(
int j,
int l,
const MPDerivative &DgDp_mp_j_l );
1118 #ifdef HAVE_THYRA_ME_POLYNOMIAL
1123 #endif // HAVE_THYRA_ME_POLYNOMIAL
1169 template<
typename ObjectType>
1180 #ifdef Thyra_BUILD_HESSIAN_SUPPORT
1183 void _setSupports( EOutArgs_hess_vec_prod_f_xx arg,
bool supports );
1185 void _setSupports( EOutArgs_hess_vec_prod_f_xp arg,
int l,
bool supports );
1187 void _setSupports( EOutArgs_hess_vec_prod_f_px arg,
int l,
bool supports );
1189 void _setSupports( EOutArgs_hess_vec_prod_f_pp arg,
int l1,
int l2,
bool supports );
1191 void _setSupports( EOutArgs_hess_vec_prod_g_xx arg,
int j,
bool supports );
1193 void _setSupports( EOutArgs_hess_vec_prod_g_xp arg,
int j,
int l,
bool supports );
1195 void _setSupports( EOutArgs_hess_vec_prod_g_px arg,
int j,
int l,
bool supports );
1197 void _setSupports( EOutArgs_hess_vec_prod_g_pp arg,
int j,
int l1,
int l2,
bool supports );
1200 void _setSupports( EOutArgs_hess_f_xx arg,
bool supports );
1202 void _setSupports( EOutArgs_hess_f_xp arg,
int l,
bool supports );
1204 void _setSupports( EOutArgs_hess_f_pp arg,
int l1,
int l2,
bool supports );
1206 void _setSupports( EOutArgs_hess_g_xx arg,
int j,
bool supports );
1208 void _setSupports( EOutArgs_hess_g_xp arg,
int j,
int l,
bool supports );
1210 void _setSupports( EOutArgs_hess_g_pp arg,
int j,
int l1,
int l2,
bool supports );
1214 void _setSupports( EOutArgs_H_xp arg,
int l,
bool supports );
1216 void _setSupports( EOutArgs_H_pp arg,
int l1,
int l2,
bool supports );
1218 #endif // ifdef Thyra_BUILD_HESSIAN_SUPPORT
1248 #ifdef Thyra_BUILD_HESSIAN_SUPPORT
1250 void _setHessianSupports(
const bool supports );
1251 #endif // ifdef Thyra_BUILD_HESSIAN_SUPPORT
1259 #ifdef Thyra_BUILD_HESSIAN_SUPPORT
1263 #endif // ifdef Thyra_BUILD_HESSIAN_SUPPORT
1266 std::string modelEvalDescription_;
1273 #ifdef Thyra_BUILD_HESSIAN_SUPPORT
1275 bool supports_hess_f_xx_;
1276 hess_supports_t supports_hess_f_xp_;
1277 hess_supports_t supports_hess_f_pp_;
1278 hess_supports_t supports_hess_g_xx_;
1279 hess_supports_t supports_hess_g_xp_;
1280 hess_supports_t supports_hess_g_pp_;
1281 bool supports_H_xx_;
1282 hess_supports_t supports_H_xp_;
1283 hess_supports_t supports_H_pp_;
1285 bool supports_hess_vec_prod_f_xx_;
1286 hess_supports_t supports_hess_vec_prod_f_xp_;
1287 hess_supports_t supports_hess_vec_prod_f_px_;
1288 hess_supports_t supports_hess_vec_prod_f_pp_;
1289 hess_supports_t supports_hess_vec_prod_g_xx_;
1290 hess_supports_t supports_hess_vec_prod_g_xp_;
1291 hess_supports_t supports_hess_vec_prod_g_px_;
1292 hess_supports_t supports_hess_vec_prod_g_pp_;
1294 #endif // ifdef Thyra_BUILD_HESSIAN_SUPPORT
1311 #ifdef Thyra_BUILD_HESSIAN_SUPPORT
1324 hess_vec_t hess_vec_prod_f_xp_;
1325 hess_vec_t hess_vec_prod_f_px_;
1326 hess_vec_t hess_vec_prod_f_pp_;
1328 hess_vec_t hess_vec_prod_g_xx_;
1329 hess_vec_t hess_vec_prod_g_xp_;
1330 hess_vec_t hess_vec_prod_g_px_;
1331 hess_vec_t hess_vec_prod_g_pp_;
1333 #endif // ifdef Thyra_BUILD_HESSIAN_SUPPORT
1352 #ifdef HAVE_THYRA_ME_POLYNOMIAL
1354 #endif // HAVE_THYRA_ME_POLYNOMIAL
1355 mutable bool isFailed_;
1357 std::map<std::string,Teuchos::any> extended_outargs_;
1361 void assert_supports(
1365 void assert_supports(
1369 void assert_supports(
1373 void assert_supports(
1378 #ifdef Thyra_BUILD_HESSIAN_SUPPORT
1380 void assert_supports(
1381 EOutArgs_hess_vec_prod_f_xx arg
1383 void assert_supports(
1384 EOutArgs_hess_vec_prod_f_xp arg,
int l
1386 void assert_supports(
1387 EOutArgs_hess_vec_prod_f_px arg,
int l
1389 void assert_supports(
1390 EOutArgs_hess_vec_prod_f_pp arg,
int l1,
int l2
1392 void assert_supports(
1393 EOutArgs_hess_vec_prod_g_xx arg,
int j
1395 void assert_supports(
1396 EOutArgs_hess_vec_prod_g_xp arg,
int j,
int l
1398 void assert_supports(
1399 EOutArgs_hess_vec_prod_g_px arg,
int j,
int l
1401 void assert_supports(
1402 EOutArgs_hess_vec_prod_g_pp arg,
int j,
int l1,
int l2
1405 void assert_supports(
1406 EOutArgs_hess_f_xx arg
1408 void assert_supports(
1409 EOutArgs_hess_f_xp arg,
int l
1411 void assert_supports(
1412 EOutArgs_hess_f_pp arg,
int l1,
int l2
1414 void assert_supports(
1415 EOutArgs_hess_g_xx arg,
int j
1417 void assert_supports(
1418 EOutArgs_hess_g_xp arg,
int j,
int l
1420 void assert_supports(
1421 EOutArgs_hess_g_pp arg,
int j,
int l1,
int l2
1423 void assert_supports(
1426 void assert_supports(
1427 EOutArgs_H_xp arg,
int l
1429 void assert_supports(
1430 EOutArgs_H_pp arg,
int l1,
int l2
1433 #endif // ifdef Thyra_BUILD_HESSIAN_SUPPORT
1436 void assert_supports(
1440 void assert_supports(
1444 void assert_supports(
1448 void assert_supports(
1453 void assert_l(
int l)
const;
1454 void assert_j(
int j)
const;
1460 #ifdef HAVE_PROTECTED_NESTED_TEMPLATE_CLASS_ACCESS
1474 template<
class Scalar>
1492 template<
typename ObjectType>
1507 template<
class Scalar>
1529 #ifdef Thyra_BUILD_HESSIAN_SUPPORT
1545 void setSupports(EOutArgs_hess_vec_prod_g_pp arg,
int j,
int l1,
int l2,
bool supports =
true );
1564 #endif // ifdef Thyra_BUILD_HESSIAN_SUPPORT
1567 template<
typename ObjectType>
1599 #ifdef Thyra_BUILD_HESSIAN_SUPPORT
1601 void setHessianSupports(
const bool supports =
true );
1602 #endif // ifdef Thyra_BUILD_HESSIAN_SUPPORT
1639 getOtherDerivativeMultiVectorOrientation(
1651 template<
class Scalar>
1652 template<
typename ObjectType>
1655 std::map<std::string,Teuchos::any>::const_iterator search =
1656 extended_inargs_.find(
typeid(ObjectType).name());
1658 if (search == extended_inargs_.end())
1664 template<
class Scalar>
1665 template<
typename ObjectType>
1668 std::map<std::string,Teuchos::any>::iterator search = extended_inargs_.find(
typeid(ObjectType).name());
1671 "ERROR: InArgs::set<ObjectType>() was called with unsupported extended data type \""
1672 <<
typeid(ObjectType).name() <<
"\"!");
1677 template<
class Scalar>
1678 template<
typename ObjectType>
1682 std::map<std::string,Teuchos::any>::const_iterator search = extended_inargs_.find(
typeid(ObjectType).name());
1685 "ERROR: InArgs::get<ObjectType>() was called with unsupported extended data type \""
1686 <<
typeid(ObjectType).name() <<
"\"!");
1691 template<
class Scalar>
1692 template<
class ObjectType>
1696 this->
template _setSupports<ObjectType>(in_supports);
1699 template<
class Scalar>
1700 template<
class ObjectType>
1709 this->extended_inargs_[
typeid(ObjectType).name()] =
Teuchos::any();
1712 std::map<std::string,Teuchos::any>::iterator search =
1713 this->extended_inargs_.find(
typeid(ObjectType).name());
1715 if (search != this->extended_inargs_.end())
1716 this->extended_inargs_.erase(
typeid(ObjectType).name());
1721 template<
class Scalar>
1722 template<
typename ObjectType>
1725 std::map<std::string,Teuchos::any>::const_iterator search =
1726 extended_outargs_.find(
typeid(ObjectType).name());
1728 if (search == extended_outargs_.end())
1734 template<
class Scalar>
1735 template<
typename ObjectType>
1738 std::map<std::string,Teuchos::any>::iterator search = extended_outargs_.find(
typeid(ObjectType).name());
1741 "ERROR: OutArgs::set<ObjectType>() was called with unsupported extended data type \""
1742 <<
typeid(ObjectType).name() <<
"\"!");
1747 template<
class Scalar>
1748 template<
typename ObjectType>
1752 std::map<std::string,Teuchos::any>::const_iterator search = extended_outargs_.find(
typeid(ObjectType).name());
1755 "ERROR: OutArgs::get<ObjectType>() was called with unsupported extended data type \""
1756 <<
typeid(ObjectType).name() <<
"\"!");
1761 template<
class Scalar>
1762 template<
class ObjectType>
1766 this->
template _setSupports<ObjectType>(in_supports);
1769 template<
class Scalar>
1770 template<
class ObjectType>
1779 this->extended_outargs_[
typeid(ObjectType).name()] =
Teuchos::any();
1782 std::map<std::string,Teuchos::any>::iterator search =
1783 this->extended_outargs_.find(
typeid(ObjectType).name());
1785 if (search != this->extended_outargs_.end())
1786 this->extended_outargs_.erase(
typeid(ObjectType).name());
1799 case ModelEvaluatorBase::IN_ARG_x_dot_dot:
1800 return "IN_ARG_x_dot_dot";
1801 case ModelEvaluatorBase::IN_ARG_x_dot:
1802 return "IN_ARG_x_dot";
1803 case ModelEvaluatorBase::IN_ARG_x:
1805 case ModelEvaluatorBase::IN_ARG_x_dot_poly:
1806 return "IN_ARG_x_dot_poly";
1807 case ModelEvaluatorBase::IN_ARG_x_poly:
1808 return "IN_ARG_x_poly";
1809 case ModelEvaluatorBase::IN_ARG_x_dot_mp:
1810 return "IN_ARG_x_dot_mp";
1811 case ModelEvaluatorBase::IN_ARG_x_mp:
1812 return "IN_ARG_x_mp";
1813 case ModelEvaluatorBase::IN_ARG_t:
1815 case ModelEvaluatorBase::IN_ARG_alpha:
1816 return "IN_ARG_alpha";
1817 case ModelEvaluatorBase::IN_ARG_beta:
1818 return "IN_ARG_beta";
1819 case ModelEvaluatorBase::IN_ARG_W_x_dot_dot_coeff:
1820 return "IN_ARG_W_x_dot_dot_coeff";
1821 case ModelEvaluatorBase::IN_ARG_step_size:
1822 return "IN_ARG_step_size";
1823 case ModelEvaluatorBase::IN_ARG_stage_number:
1824 return "IN_ARG_stage_number";
1825 #ifdef TEUCHOS_DEBUG
1838 case ModelEvaluatorBase::OUT_ARG_f:
1840 case ModelEvaluatorBase::OUT_ARG_W:
1842 case ModelEvaluatorBase::OUT_ARG_f_mp:
1843 return "OUT_ARG_f_mp";
1844 case ModelEvaluatorBase::OUT_ARG_W_mp:
1845 return "OUT_ARG_W_mp";
1846 case ModelEvaluatorBase::OUT_ARG_W_op:
1847 return "OUT_ARG_W_op";
1848 case ModelEvaluatorBase::OUT_ARG_W_prec:
1849 return "OUT_ARG_W_prec";
1850 case ModelEvaluatorBase::OUT_ARG_f_poly:
1851 return "OUT_ARG_f_poly";
1852 #ifdef TEUCHOS_DEBUG
1863 ModelEvaluatorBase::EDerivativeMultiVectorOrientation orientation
1866 switch(orientation) {
1867 case ModelEvaluatorBase::DERIV_MV_BY_COL:
1868 return "DERIV_MV_BY_COL";
1869 case ModelEvaluatorBase::DERIV_TRANS_MV_BY_ROW:
1870 return "DERIV_TRANS_MV_BY_ROW";
1871 #ifdef TEUCHOS_DEBUG
1882 Thyra::getOtherDerivativeMultiVectorOrientation(
1883 ModelEvaluatorBase::EDerivativeMultiVectorOrientation orientation
1886 switch(orientation) {
1887 case ModelEvaluatorBase::DERIV_MV_BY_COL:
1888 return ModelEvaluatorBase::DERIV_TRANS_MV_BY_ROW;
1889 case ModelEvaluatorBase::DERIV_TRANS_MV_BY_ROW:
1890 return ModelEvaluatorBase::DERIV_MV_BY_COL;
1891 #ifdef TEUCHOS_DEBUG
1896 return ModelEvaluatorBase::DERIV_MV_BY_COL;
1900 #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 >= 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
std::string description() const
void set_DgDx_properties(int j, const DerivativeProperties &properties)
void _set_Np_Ng(int Np, int Ng)
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< const VectorBase< Scalar > > get_f_multiplier() const
Precondition: supports(IN_ARG_x)==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
static const int NUM_E_IN_ARGS_MEMBERS
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.
EDerivativeMultiVectorOrientation
std::string modelEvalDescription() const
MPDerivative(const RCP< Stokhos::ProductEpetraMultiVector > &mv, const EDerivativeMultiVectorOrientation orientation=DERIV_MV_BY_COL)
static const int NUM_E_OUT_ARGS_MEMBERS
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...
void set_Np_Ng(int Np, int Ng)
EEvalType getType() const
void _setUnsupportsAndRelated(EInArgsMembers arg)
#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
MPDerivativeMultiVector()
void set_x_dot_mp(const RCP< const Stokhos::ProductEpetraVector > &x_dot_mp)
Precondition: supports(IN_ARG_x_dot_mp)==true.
void _setUnsupportsAndRelated(EInArgsMembers arg)
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)
RCP< const ObjectType > get() const
Get an extended input object of type ObjectType>/tt> from the InArgs. Precondition: supports()==true...
EDerivativeLinearity linearity
RCP< const Stokhos::ProductEpetraVector > get_x_mp() const
Precondition: supports(IN_ARG_x_mp)==true.
std::string description() const
Do an exact evaluation (default)
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<ObjType>.
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 >= 0).
void set_stage_number(Scalar stage_number)
Precondition: supports(IN_ARG_stage_number)==true.
An approx. eval. for a F.D. deriv.
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...
void setUnsupportsAndRelated(EInArgsMembers arg)
Interface for a collection of column vectors called a multi-vector.
void setUnsupportsAndRelated(EInArgsMembers arg)
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.
void set_g_multiplier(int j, const RCP< const VectorBase< Scalar > > &g_multiplier)
Precondition: supports(IN_ARG_x)==true.
std::string description() const
Derivative(const DerivativeMultiVector< Scalar > &dmv)
const MPDerivativeMultiVector & assert_not_null() const
void _setModelEvalDescription(const std::string &modelEvalDescription)
Abstract interface for finite-dimensional dense vectors.
void set_Np_Ng(int Np, int Ng)
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.
EEvalType
The type of an evaluation.
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.
DerivativeSupport(EDerivativeLinearOp)
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)
std::string description() const
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_p_direction(int l, const RCP< const MultiVectorBase< Scalar > > &p_direction_l)
Precondition: supports(IN_ARG_x)==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 <= l && l < this->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.
int Ng() const
Return the number of axillary response functions g(j)(...) supported (Ng >= 0).
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
void _set_Np_Ng(int Np, int Ng)
Scalar get_stage_number() const
Precondition: supports(IN_ARG_stage_number)==true.
std::string description() const
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_f_multiplier(const RCP< const VectorBase< Scalar > > &f_multiplier)
Precondition: supports(IN_ARG_x)==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.
ModelEvaluatorBase()
constructor
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.
void set_x_direction(const RCP< const MultiVectorBase< Scalar > > &x_direction)
Precondition: supports(IN_ARG_x)==true.
std::string description() const
Determines the forms of a general derivative that are supported.
std::string description() const
int Np() const
Return the number of parameter subvectors p(l) supported (Np >= 0).
Scalar get_step_size() const
Precondition: supports(IN_ARG_step_size)==true.
RCP< const MultiVectorBase< Scalar > > get_p_direction(int l) const
Get p(l) where 0 <= l && l < this->Np().
RCP< const VectorBase< Scalar > > get_x_dot_dot() const
Precondition: supports(IN_ARG_x_dot_dot)==true.
DerivativeSupport & plus(EDerivativeLinearOp)
RCP< const VectorBase< Scalar > > get_g_multiplier(int j) const
Precondition: supports(IN_ARG_x)==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
std::string modelEvalDescription() 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 > ¶mIndexes=Teuchos::Array< int >())
RCP< LinearOpBase< Scalar > > get_W_op() const
Precondition: supports(OUT_ARG_W_op)==true.
RCP< const MultiVectorBase< Scalar > > get_x_direction() const
Precondition: supports(IN_ARG_x)==true.
bool supports(EDerivativeLinearOp) const
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)
const Teuchos::Array< int > & getParamIndexes() const
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
const MPDerivative & assert_not_null() const
RCP< LinearOpBase< Scalar > > getLinearOp() const
RCP< const VectorBase< Scalar > > get_p(int l) const
Get p(l) where 0 <= l && l < this->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
Evaluation(Teuchos::ENull)
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...