42 #ifndef THYRA_MODEL_EVALUATOR_BASE_DEF_HPP
43 #define THYRA_MODEL_EVALUATOR_BASE_DEF_HPP
46 #include "Thyra_ModelEvaluatorBase_decl.hpp"
47 #include "Thyra_MultiVectorBase.hpp"
48 #include "Thyra_VectorBase.hpp"
49 #include "Thyra_MultiVectorStdOps.hpp"
50 #include "Thyra_VectorStdOps.hpp"
56 namespace ModelEvaluatorHelperPack {
59 template<
class Scalar>
61 RCP<const Thyra::VectorBase<Scalar> >
68 return vec->clone_v();
72 template<
class Scalar>
74 RCP<const Thyra::MultiVectorBase<Scalar> >
81 return vec->clone_mv();
86 RCP<const Stokhos::ProductEpetraVector >
88 const RCP<const Stokhos::ProductEpetraVector > &vec,
94 printf(
"Warning: clone_v not implemented for ProductEpetraVector: %s %d\n",__FILE__,__LINE__);
108 template<
class Scalar>
110 :modelEvalDescription_(
"WARNING! THIS INARGS OBJECT IS UNINITIALIZED!")
118 step_size_ = ST::zero();
119 stage_number_ = ST::one();
123 template<
class Scalar>
125 {
return p_.size(); }
127 template<
class Scalar>
129 {
return g_multiplier_.size(); }
131 template<
class Scalar>
136 ,
"model = \'"<<modelEvalDescription_
137 <<
"\': Error, arg="<<
toString(arg)<<
" is invalid!"
139 return supports_[arg];
142 template<
class Scalar>
146 return supports_p_mp_[l];
149 template<
class Scalar>
155 template<
class Scalar>
160 template<
class Scalar>
167 template<
class Scalar>
173 template<
class Scalar>
177 { assert_supports(
IN_ARG_x); x_ = x; }
180 template<
class Scalar>
183 { assert_supports(
IN_ARG_x);
return x_; }
186 template<
class Scalar>
190 { assert_supports(
IN_ARG_x); x_direction_ = x_direction; }
193 template<
class Scalar>
197 { assert_l(l); p_direction_[l] = p_direction_l; }
200 template<
class Scalar>
203 { assert_supports(
IN_ARG_x);
return x_direction_; }
206 template<
class Scalar>
209 { assert_l(l);
return p_direction_[l]; }
212 template<
class Scalar>
219 template<
class Scalar>
225 template<
class Scalar>
232 template<
class Scalar>
237 template<
class Scalar>
241 { assert_supports(
IN_ARG_x); f_multiplier_ = f_multiplier; }
243 template<
class Scalar>
246 { assert_supports(
IN_ARG_x);
return f_multiplier_; }
248 template<
class Scalar>
255 g_multiplier_[j] = g_multiplier;
258 template<
class Scalar>
264 return g_multiplier_[j];
267 #ifdef HAVE_THYRA_ME_POLYNOMIAL
269 template<
class Scalar>
276 template<
class Scalar>
282 template<
class Scalar>
283 void ModelEvaluatorBase::InArgs<Scalar>::set_x_poly(
289 template<
class Scalar>
290 RCP<const Teuchos::Polynomial< VectorBase<Scalar> > >
291 ModelEvaluatorBase::InArgs<Scalar>::get_x_poly()
const
295 #endif // HAVE_THYRA_ME_POLYNOMIAL
297 template<
class Scalar>
301 { assert_l(l); p_[l] = p_l; }
304 template<
class Scalar>
307 { assert_l(l);
return p_[l]; }
310 template<
class Scalar>
314 { assert_supports(
IN_ARG_p_mp, l); p_mp_[l] = p_mp_l; }
316 template<
class Scalar>
319 { assert_supports(
IN_ARG_p_mp, l);
return p_mp_[l]; }
322 template<
class Scalar>
324 { assert_supports(
IN_ARG_t); t_ = t; }
327 template<
class Scalar>
330 { assert_supports(
IN_ARG_t);
return t_; }
333 template<
class Scalar>
338 template<
class Scalar>
343 template<
class Scalar>
348 template<
class Scalar>
352 template<
class Scalar>
357 template<
class Scalar>
361 template<
class Scalar>
365 template<
class Scalar>
369 template<
class Scalar>
374 template<
class Scalar>
379 template<
class Scalar>
381 const InArgs<Scalar>& inArgs,
bool ignoreUnsupported,
bool cloneObjects
384 using ModelEvaluatorHelperPack::condCloneVec;
385 using ModelEvaluatorHelperPack::condCloneMultiVec;
386 using ModelEvaluatorHelperPack::condCloneVec_mp;
389 set_x_dot_dot(condCloneVec(inArgs.
get_x_dot_dot(),cloneObjects));
393 set_x_dot(condCloneVec(inArgs.
get_x_dot(),cloneObjects));
397 set_x_dot_mp(condCloneVec_mp(inArgs.
get_x_dot_mp(),cloneObjects));
400 if(supports(
IN_ARG_x) || !ignoreUnsupported)
401 set_x(condCloneVec(inArgs.
get_x(),cloneObjects));
405 set_x_mp(condCloneVec_mp(inArgs.
get_x_mp(),cloneObjects));
408 if(supports(
IN_ARG_x) || !ignoreUnsupported)
409 set_x_direction(condCloneMultiVec(inArgs.
get_x_direction(),cloneObjects));
412 if(supports(
IN_ARG_x) || !ignoreUnsupported)
415 const int min_Ng = TEUCHOS_MIN(this->Ng(),inArgs.
Ng());
416 for (
int j = 0; j < min_Ng; ++j) {
420 #ifdef HAVE_THYRA_ME_POLYNOMIAL
424 cloneObjects &&
"Have not implemented cloning for x_dot_poly yet!" );
425 set_x_dot_poly(inArgs.get_x_dot_poly());
431 cloneObjects &&
"Have not implemented cloning for x_poly yet!" );
432 set_x_poly(inArgs.get_x_poly());
435 #endif // HAVE_THYRA_ME_POLYNOMIAL
436 const int min_Np = TEUCHOS_MIN(this->Np(),inArgs.
Np());
437 for (
int l = 0; l < min_Np; ++l) {
439 set_p(l,condCloneVec(inArgs.
get_p(l),cloneObjects));
441 for (
int l = 0; l < min_Np; ++l) {
443 set_p_direction(l,condCloneMultiVec(inArgs.
get_p_direction(l),cloneObjects));
445 for (
int l = 0; l < min_Np; ++l) {
447 if (
nonnull(inArgs.get_p_mp(l)))
448 set_p_mp(l,condCloneVec_mp(inArgs.get_p_mp(l),cloneObjects));
452 if(supports(
IN_ARG_t) || !ignoreUnsupported)
453 set_t(inArgs.
get_t());
476 if (extended_inargs_.size() > 0)
479 "Extended InArgs does not support cloning!");
480 this->extended_inargs_ = inArgs.extended_inargs_;
484 template<
class Scalar>
491 const std::string inArg_name =
toString(inArg_arg);
493 supports(inArg_arg) != inArgs.
supports(inArg_arg), std::logic_error,
494 "Error, the input argument "<<inArg_name<<
" with support "<<inArgs.
supports(inArg_arg)<<
"\n"
495 "in the InArgs object for the model:\n\n"
497 "is not the same the argument "<<inArg_name<<
" with support "<<supports(inArg_arg)<<
"\n"
498 "in the InArgs object for the model:\n\n"
499 " "<<modelEvalDescription()<<
"\n\n"
500 "and these two InArgs objects are not compatible!"
507 template<
class Scalar>
510 return modelEvalDescription_;
514 template<
class Scalar>
518 std::ostringstream oss;
520 <<
"Thyra::ModelEvaluatorBase::InArgs<"<<ST::name()<<
">"
522 <<
"model="<<modelEvalDescription_
529 template<
class Scalar>
537 using Teuchos::describe;
556 *out <<
"Thyra::ModelEvaluatorBase::InArgs<"<<ST::name()<<
">:\n";
559 *out <<
"model = " << modelEvalDescription_ <<
"\n";
560 *out <<
"Np = " << Np() <<
"\n";
564 *out <<
"x_dot_dot = " << Teuchos::describe(*x_dot_dot,x_verbLevel);
566 *out <<
"||x_dot_dot|| = " << norm(*x_dot_dot) << endl;
571 *out <<
"x_dot = " << Teuchos::describe(*x_dot,x_verbLevel);
573 *out <<
"||x_dot|| = " << norm(*x_dot) << endl;
578 *out <<
"x = " << Teuchos::describe(*x,x_verbLevel);
580 *out <<
"||x|| = " << norm(*x) << endl;
584 for(
int l = 0; l < Np(); ++l ) {
586 if ( !
is_null(p_l = this->get_p(l)) ) {
587 *out <<
"p("<<l<<
") = " << Teuchos::describe(*p_l,p_verbLevel);
589 *out <<
"||p("<<l<<
")|| = " << norm(*p_l) << endl;
596 *out <<
"t = " << t_ << endl;
599 *out <<
"alpha = " << alpha_ << endl;
602 *out <<
"beta = " << beta_ << endl;
605 *out <<
"W_x_dot_dot_coeff = " << W_x_dot_dot_coeff_ << endl;
608 *out <<
"step_size = " << step_size_ << endl;
611 *out <<
"stage_number = " << stage_number_ << endl;
618 template<
class Scalar>
620 const std::string &modelEvalDescription_in
623 modelEvalDescription_ = modelEvalDescription_in;
627 template<
class Scalar>
631 p_direction_.resize(Np_in);
633 supports_p_mp_.resize(Np_in);
634 g_multiplier_.resize(Ng_in);
638 template<
class Scalar>
645 ,
"model = \'"<<modelEvalDescription_
646 <<
"\': Error, arg="<<
toString(arg)<<
" is invalid!");
647 supports_[arg] = supports_in;
650 template<
class Scalar>
656 supports_p_mp_[l] = supports_in;
660 template<
class Scalar>
666 &inArgs.supports_[0],
668 this->_set_Np_Ng( Np_in >= 0 ? Np_in : inArgs.
Np(), inArgs.
Ng() );
672 template<
class Scalar>
691 true ,std::logic_error,
692 "Error, can not handle args other than IN_ARG_x yet!"
695 this->_setSupports(arg,
false);
699 template<
class Scalar>
705 !supports_[arg], std::logic_error
706 ,
"Thyra::ModelEvaluatorBase::InArgs<"
708 "model = \'"<<modelEvalDescription_<<
"\': Error, "
709 "The argument arg = " <<
toString(arg) <<
" is not supported!"
713 template<
class Scalar>
720 !supports_p_mp_[l], std::logic_error
721 ,
"Thyra::ModelEvaluatorBase::InArgs<"
723 "model = \'"<<modelEvalDescription_<<
"\': Error, "
724 "The argument p_mp(l) with index l = " << l <<
" is not supported!"
729 template<
class Scalar>
730 void ModelEvaluatorBase::InArgs<Scalar>::assert_l(
int l)
const
733 !( 0 <= l && l < Np() ), std::logic_error
734 ,
"Thyra::ModelEvaluatorBase::InArgs<Scalar>::assert_l(l):\n\n"
735 " model = \'"<<modelEvalDescription_<<
"\':\n\n"
736 "Error, The parameter l = " << l <<
" is not in the range [0,"<<Np()<<
")!"
740 template<
class Scalar>
741 void ModelEvaluatorBase::InArgs<Scalar>::assert_j(
int j)
const
744 !( 0 <= j && j < Ng() ), std::logic_error
745 ,
"Thyra::ModelEvaluatorBase::InArgs<Scalar>::assert_j(j):\n\n"
746 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
747 "Error, The auxiliary function g("<<j<<
")"
748 " is not in the range [0,"<<Ng()<<
")!"
757 template<
class Scalar>
761 std::ostringstream oss;
762 oss <<
"DerivativeMultiVector{";
763 if (
is_null(getMultiVector())) {
768 <<
"multiVec=" << getMultiVector()->description()
769 <<
",orientation=" <<
toString(getOrientation());
776 template<
class Scalar>
782 using Teuchos::describe;
784 out <<
"DerivativeMultiVector\n";
788 <<
describe(*getMultiVector(),verbLevel)
790 <<
toString(getOrientation()) << endl;
807 template<
class Scalar>
812 std::ostringstream oss;
813 oss <<
"Derivative{";
817 else if (!
is_null(getLinearOp())) {
818 oss <<
"linearOp=" << getLinearOp()->description();
821 oss <<
"derivMultiVec=" << getDerivativeMultiVector().description();
828 template<
class Scalar>
834 using Teuchos::describe;
836 out <<
"Derivative:";
840 else if (!
is_null(getLinearOp())) {
843 <<
"linearOp = " <<
describe(*getLinearOp(),verbLevel);
848 <<
"derivMultiVec = ";
849 getDerivativeMultiVector().describe(out,verbLevel);
859 template<
class Scalar>
861 :modelEvalDescription_(
"WARNING! THIS OUTARGS OBJECT IS UNINITIALIZED!"),
869 template<
class Scalar>
871 {
return DfDp_.size(); }
874 template<
class Scalar>
876 {
return g_.size(); }
879 template<
class Scalar>
886 ,
"model = \'"<<modelEvalDescription_
887 <<
"\': Error, arg="<<
toString(arg)<<
" is invalid!"
889 return supports_[arg];
893 template<
class Scalar>
900 return supports_DfDp_[l];
904 template<
class Scalar>
911 return supports_DgDx_dot_[j];
915 template<
class Scalar>
922 return supports_DgDx_[j];
926 template<
class Scalar>
934 return supports_DgDp_[ j*Np() + l ];
938 template<
class Scalar>
943 return supports_hess_vec_prod_f_xx_;
946 template<
class Scalar>
952 return supports_hess_vec_prod_f_xp_[l];
955 template<
class Scalar>
961 return supports_hess_vec_prod_f_px_[l];
964 template<
class Scalar>
971 return supports_hess_vec_prod_f_pp_[ l1*Np() + l2 ];
974 template<
class Scalar>
980 return supports_hess_vec_prod_g_xx_[j];
983 template<
class Scalar>
990 return supports_hess_vec_prod_g_xp_[ j*Np() + l ];
993 template<
class Scalar>
1000 return supports_hess_vec_prod_g_px_[ j*Np() + l ];
1003 template<
class Scalar>
1011 return supports_hess_vec_prod_g_pp_[ j*Np()*Np() + l1*Np() + l2 ];
1014 template<
class Scalar>
1019 return supports_hess_f_xx_;
1022 template<
class Scalar>
1028 return supports_hess_f_xp_[l];
1031 template<
class Scalar>
1038 return supports_hess_f_pp_[ l1*Np() + l2 ];
1041 template<
class Scalar>
1046 return supports_H_xx_;
1049 template<
class Scalar>
1055 return supports_H_xp_[l];
1058 template<
class Scalar>
1065 return supports_H_pp_[ l1*Np() + l2 ];
1068 template<
class Scalar>
1074 return supports_hess_g_xx_[j];
1077 template<
class Scalar>
1084 return supports_hess_g_xp_[ j*Np() + l ];
1087 template<
class Scalar>
1095 return supports_hess_g_pp_[ j*Np()*Np() + l1*Np() + l2 ];
1099 template<
class Scalar>
1106 return supports_g_mp_[j];
1109 template<
class Scalar>
1116 return supports_DfDp_mp_[l];
1120 template<
class Scalar>
1121 const ModelEvaluatorBase::DerivativeSupport&
1127 return supports_DgDx_dot_mp_[j];
1131 template<
class Scalar>
1132 const ModelEvaluatorBase::DerivativeSupport&
1138 return supports_DgDx_mp_[j];
1142 template<
class Scalar>
1143 const ModelEvaluatorBase::DerivativeSupport&
1150 return supports_DgDp_mp_[ j*Np() + l ];
1155 template<
class Scalar>
1165 template<
class Scalar>
1174 template<
class Scalar>
1184 template<
class Scalar>
1193 template<
class Scalar>
1203 template<
class Scalar>
1212 template<
class Scalar>
1222 template<
class Scalar>
1231 template<
class Scalar>
1241 template<
class Scalar>
1250 template<
class Scalar>
1260 template<
class Scalar>
1269 template<
class Scalar>
1279 template<
class Scalar>
1288 template<
class Scalar>
1298 template<
class Scalar>
1307 template<
class Scalar>
1312 return W_properties_;
1316 template<
class Scalar>
1326 template<
class Scalar>
1335 template<
class Scalar>
1340 return DfDp_properties_[l];
1344 template<
class Scalar>
1350 DfDp_mp_[l] = DfDp_mp_l;
1354 template<
class Scalar>
1363 template<
class Scalar>
1364 ModelEvaluatorBase::DerivativeProperties
1365 ModelEvaluatorBase::OutArgs<Scalar>::get_DfDp_mp_properties(
int l)
const
1368 return DfDp_mp_properties_[l];
1372 template<
class Scalar>
1378 DgDx_dot_[j] = DgDx_dot_j;
1382 template<
class Scalar>
1387 return DgDx_dot_[j];
1391 template<
class Scalar>
1396 return DgDx_dot_properties_[j];
1400 template<
class Scalar>
1406 DgDx_dot_mp_[j] = DgDx_dot_mp_j;
1410 template<
class Scalar>
1415 return DgDx_dot_mp_[j];
1419 template<
class Scalar>
1420 ModelEvaluatorBase::DerivativeProperties
1421 ModelEvaluatorBase::OutArgs<Scalar>::get_DgDx_dot_mp_properties(
int j)
const
1424 return DgDx_dot_mp_properties_[j];
1428 template<
class Scalar>
1438 template<
class Scalar>
1447 template<
class Scalar>
1452 return DgDx_properties_[j];
1456 template<
class Scalar>
1462 DgDx_mp_[j] = DgDx_mp_j;
1466 template<
class Scalar>
1475 template<
class Scalar>
1476 ModelEvaluatorBase::DerivativeProperties
1477 ModelEvaluatorBase::OutArgs<Scalar>::get_DgDx_mp_properties(
int j)
const
1480 return DgDx_mp_properties_[j];
1484 template<
class Scalar>
1490 DgDp_[ j*Np() + l ] = DgDp_j_l;
1494 template<
class Scalar>
1499 return DgDp_[ j*Np() + l ];
1503 template<
class Scalar>
1508 return DgDp_properties_[ j*Np() + l ];
1512 template<
class Scalar>
1518 DgDp_mp_[ j*Np() + l ] = DgDp_mp_j_l;
1522 template<
class Scalar>
1527 return DgDp_mp_[ j*Np() + l ];
1531 template<
class Scalar>
1532 ModelEvaluatorBase::DerivativeProperties
1533 ModelEvaluatorBase::OutArgs<Scalar>::get_DgDp_mp_properties(
int j,
int l)
const
1536 return DgDp_mp_properties_[ j*Np() + l ];
1540 template<
class Scalar>
1546 hess_vec_prod_f_xx_ = hess_vec_prod_f_xx;
1549 template<
class Scalar>
1555 hess_vec_prod_f_xp_[l] = hess_vec_prod_f_xp_l;
1558 template<
class Scalar>
1564 hess_vec_prod_f_px_[l] = hess_vec_prod_f_px_l;
1567 template<
class Scalar>
1573 hess_vec_prod_f_pp_[ l1*Np() + l2 ] = hess_vec_prod_f_pp_l1_l2;
1576 template<
class Scalar>
1581 return hess_vec_prod_f_xx_;
1584 template<
class Scalar>
1589 return hess_vec_prod_f_xp_[l];
1592 template<
class Scalar>
1597 return hess_vec_prod_f_px_[l];
1600 template<
class Scalar>
1605 return hess_vec_prod_f_pp_[ l1*Np() + l2 ];
1609 template<
class Scalar>
1615 hess_vec_prod_g_xx_[j] = hess_vec_prod_g_xx_j;
1618 template<
class Scalar>
1624 hess_vec_prod_g_xp_[ j*Np() + l ] = hess_vec_prod_g_xp_j_l;
1627 template<
class Scalar>
1633 hess_vec_prod_g_px_[ j*Np() + l ] = hess_vec_prod_g_px_j_l;
1636 template<
class Scalar>
1642 hess_vec_prod_g_pp_[ j*Np()*Np() + l1*Np() + l2 ] = hess_vec_prod_g_pp_j_l1_l2;
1645 template<
class Scalar>
1650 return hess_vec_prod_g_xx_[j];
1653 template<
class Scalar>
1658 return hess_vec_prod_g_xp_[ j*Np() + l ];
1661 template<
class Scalar>
1666 return hess_vec_prod_g_px_[ j*Np() + l ];
1669 template<
class Scalar>
1674 return hess_vec_prod_g_pp_[ j*Np()*Np() + l1*Np() + l2 ];
1677 template<
class Scalar>
1683 hess_f_xx_ = hess_f_xx;
1686 template<
class Scalar>
1692 hess_f_xp_[l] = hess_f_xp_l;
1695 template<
class Scalar>
1701 hess_f_pp_[ l1*Np() + l2 ] = hess_f_pp_l1_l2;
1704 template<
class Scalar>
1712 template<
class Scalar>
1717 return hess_f_xp_[l];
1720 template<
class Scalar>
1725 return hess_f_pp_[ l1*Np() + l2 ];
1728 template<
class Scalar>
1734 hess_g_xx_[j] = hess_g_xx_j;
1737 template<
class Scalar>
1743 hess_g_xp_[ j*Np() + l ] = hess_g_xp_j_l;
1746 template<
class Scalar>
1752 hess_g_pp_[ j*Np()*Np() + l1*Np() + l2 ] = hess_g_pp_j_l1_l2;
1755 template<
class Scalar>
1760 return hess_g_xx_[j];
1763 template<
class Scalar>
1768 return hess_g_xp_[ j*Np() + l ];
1771 template<
class Scalar>
1776 return hess_g_pp_[ j*Np()*Np() + l1*Np() + l2 ];
1779 template<
class Scalar>
1788 template<
class Scalar>
1797 template<
class Scalar>
1803 H_pp_[ l1*Np() + l2 ] = H_pp_l1_l2;
1806 template<
class Scalar>
1814 template<
class Scalar>
1822 template<
class Scalar>
1827 return H_pp_[ l1*Np() + l2 ];
1831 #ifdef HAVE_THYRA_ME_POLYNOMIAL
1834 template<
class Scalar>
1843 template<
class Scalar>
1851 #endif // HAVE_THYRA_ME_POLYNOMIAL
1854 template<
class Scalar>
1860 const int min_Np = TEUCHOS_MIN(this->Np(),inputOutArgs.
Np());
1861 const int min_Ng = TEUCHOS_MIN(this->Ng(),inputOutArgs.
Ng());
1864 if ( supports(
OUT_ARG_f) || !ignoreUnsupported )
1865 set_f(inputOutArgs.
get_f());
1871 #ifdef HAVE_THYRA_ME_POLYNOMIAL
1875 set_f_poly(inputOutArgs.get_f_poly());
1877 #endif // HAVE_THYRA_ME_POLYNOMIAL
1879 for (
int j = 0; j < min_Ng; ++j ) {
1881 set_g(j,inputOutArgs.
get_g(j));
1883 for (
int j = 0; j < min_Ng; ++j ) {
1886 set_g_mp(j,inputOutArgs.
get_g_mp(j));
1891 if ( supports(
OUT_ARG_W) || !ignoreUnsupported )
1892 set_W(inputOutArgs.
get_W());
1909 for (
int l = 0; l < min_Np; ++l ) {
1910 MEB::Derivative<Scalar> DfDp_l;
1912 && !(DfDp_l=inputOutArgs.
get_DfDp(l)).isEmpty() )
1914 if ( DfDp_l.isSupportedBy(supports(
OUT_ARG_DfDp,l)) || !ignoreUnsupported )
1918 for (
int l = 0; l < min_Np; ++l ) {
1919 MEB::MPDerivative DfDp_mp_l;
1921 && !(DfDp_mp_l=inputOutArgs.get_DfDp_mp(l)).isEmpty() )
1923 if ( DfDp_mp_l.isSupportedBy(supports(
OUT_ARG_DfDp_mp,l)) || !ignoreUnsupported )
1924 set_DfDp_mp(l,DfDp_mp_l);
1928 for (
int j = 0; j < min_Ng; ++j ) {
1930 MEB::Derivative<Scalar> DgDx_dot_j;
1932 && !(DgDx_dot_j=inputOutArgs.
get_DgDx_dot(j)).isEmpty() )
1934 if( DgDx_dot_j.isSupportedBy(supports(
OUT_ARG_DgDx_dot,j)) || !ignoreUnsupported )
1935 set_DgDx_dot(j,DgDx_dot_j);
1938 MEB::Derivative<Scalar> DgDx_j;
1940 && !(DgDx_j=inputOutArgs.
get_DgDx(j)).isEmpty() ) {
1941 if ( DgDx_j.isSupportedBy(supports(
OUT_ARG_DgDx,j)) || !ignoreUnsupported )
1945 for (
int j = 0; j < min_Ng; ++j ) {
1947 MEB::MPDerivative DgDx_dot_mp_j;
1949 && !(DgDx_dot_mp_j=inputOutArgs.get_DgDx_dot_mp(j)).isEmpty() )
1952 set_DgDx_dot_mp(j,DgDx_dot_mp_j);
1955 MEB::MPDerivative DgDx_mp_j;
1957 && !(DgDx_mp_j=inputOutArgs.get_DgDx_mp(j)).isEmpty() ) {
1958 if ( DgDx_mp_j.isSupportedBy(supports(
OUT_ARG_DgDx_mp,j)) || !ignoreUnsupported )
1959 set_DgDx_mp(j,DgDx_mp_j);
1963 for (
int l = 0; l < min_Np; ++l ) {
1964 for (
int j = 0; j < min_Ng; ++j ) {
1965 MEB::Derivative<Scalar> DgDp_j_l;
1967 && !(DgDp_j_l=inputOutArgs.
get_DgDp(j,l)).isEmpty() )
1969 if ( DgDp_j_l.isSupportedBy(supports(
OUT_ARG_DgDp,j,l)) || !ignoreUnsupported )
1970 set_DgDp(j,l,DgDp_j_l);
1974 for (
int l = 0; l < min_Np; ++l ) {
1975 for (
int j = 0; j < min_Ng; ++j ) {
1976 MEB::MPDerivative DgDp_mp_j_l;
1978 && !(DgDp_mp_j_l=inputOutArgs.get_DgDp_mp(j,l)).isEmpty() )
1980 if ( DgDp_mp_j_l.isSupportedBy(supports(
OUT_ARG_DgDp_mp,j,l)) || !ignoreUnsupported )
1981 set_DgDp_mp(j,l,DgDp_mp_j_l);
1991 for (
int l1 = 0; l1 < min_Np; ++l1 ) {
2000 for (
int l2 = 0; l2 < min_Np; ++l2 ) {
2009 for (
int j = 0; j < min_Ng; ++j ) {
2014 for (
int l1 = 0; l1 < min_Np; ++l1 ) {
2023 for (
int l2 = 0; l2 < min_Np; ++l2 ) {
2037 for (
int l1 = 0; l1 < min_Np; ++l1 ) {
2042 for (
int l2 = 0; l2 < min_Np; ++l2 ) {
2051 for (
int j = 0; j < min_Ng; ++j ) {
2056 for (
int l1 = 0; l1 < min_Np; ++l1 ) {
2061 for (
int l2 = 0; l2 < min_Np; ++l2 ) {
2075 for (
int l1 = 0; l1 < min_Np; ++l1 ) {
2078 set_H_xp(l1,inputOutArgs.
get_H_xp(l1));
2080 for (
int l2 = 0; l2 < min_Np; ++l2 ) {
2082 if ( supports(
OUT_ARG_H_pp,l1,l2) || !ignoreUnsupported )
2083 set_H_pp(l1,l2,inputOutArgs.
get_H_pp(l1,l2));
2089 this->extended_outargs_ = inputOutArgs.extended_outargs_;
2095 template<
class Scalar>
2101 assign(this->get_f().ptr(),ST::nan());
2103 for(
int j = 0; j < this->Ng(); ++j ) {
2105 assign(this->get_g(j).ptr(),ST::nan());
2111 template<
class Scalar>
2118 template<
class Scalar>
2127 for (
int l = 0; l < Np(); ++l ) {
2128 if (!DfDp_[l].isEmpty())
2131 #ifdef HAVE_THYRA_ME_POLYNOMIAL
2134 #endif // HAVE_THYRA_ME_POLYNOMIAL
2135 for (
int j = 0; j < Ng(); ++j ) {
2138 if (!DgDx_dot_[j].isEmpty())
2140 if (!DgDx_[j].isEmpty())
2142 for (
int l = 0; l < Np(); ++l ) {
2143 if (!DgDp_[j*Np()+l].isEmpty())
2151 template<
class Scalar>
2159 const std::string outArg_name =
toString(outArg_arg);
2161 supports(outArg_arg) != outArgs.
supports(outArg_arg), std::logic_error,
2162 "Error, the output argument "<<outArg_name<<
" with support "<<outArgs.
supports(outArg_arg)<<
"\n"
2163 "in the OutArgs object for the model:\n\n"
2165 "is not the same the argument "<<outArg_name<<
" with support "<<supports(outArg_arg)<<
"\n"
2166 "in the OutArgs object for the model:\n\n"
2167 " "<<modelEvalDescription()<<
"\n\n"
2168 "and these two OutArgs objects are not compatible!"
2172 const int l_Np = this->Np();
2173 const int l_Ng = this->Ng();
2178 for (
int l = 0; l < l_Np; ++l ) {
2182 "Error, the support for DfDp("<<l<<
") is not the same for the models\n\n"
2185 " "<<modelEvalDescription()<<
"\n\n"
2186 "and these two OutArgs objects are not compatible!"
2191 for (
int j = 0; j < l_Ng; ++j ) {
2195 "Error, the support for DgDx_dot("<<j<<
") is not the same for the models\n\n"
2198 " "<<modelEvalDescription()<<
"\n\n"
2199 "and these two OutArgs objects are not compatible!"
2204 "Error, the support for DgDx("<<j<<
") is not the same for the models\n\n"
2207 " "<<modelEvalDescription()<<
"\n\n"
2208 "and these two OutArgs objects are not compatible!"
2210 for (
int l = 0; l < l_Np; ++l ) {
2214 "Error, the support for DgDp("<<j<<
","<<l<<
") is not the same for the models\n\n"
2217 " "<<modelEvalDescription()<<
"\n\n"
2218 "and these two OutArgs objects are not compatible!"
2225 template<
class Scalar>
2228 return modelEvalDescription_;
2232 template<
class Scalar>
2236 std::ostringstream oss;
2238 <<
"Thyra::ModelEvaluatorBase::OutArgs<"<<ST::name()<<
">"
2240 <<
"model="<<modelEvalDescription_
2248 template<
class Scalar>
2255 using Teuchos::describe;
2261 typedef MEB::Derivative<Scalar> Deriv;
2270 *out <<
"Thyra::ModelEvaluatorBase::OutArgs<"<<ST::name()<<
">:\n";
2273 *out <<
"model = " << modelEvalDescription_ <<
"\n";
2274 *out <<
"Np = " << Np() <<
"\n";
2275 *out <<
"Ng = " << Ng() <<
"\n";
2279 *out <<
"f = " << Teuchos::describe(*f,verbLevel);
2282 for(
int j = 0; j < Ng(); ++j ) {
2284 if (!
is_null(g_j=this->get_g(j)))
2285 *out <<
"g("<<j<<
") = " << Teuchos::describe(*g_j,verbLevel);
2290 *out <<
"W = " << Teuchos::describe(*W,verbLevel);
2295 *out <<
"W_op = " << Teuchos::describe(*W_op,verbLevel);
2298 for(
int l = 0; l < Np(); ++l ) {
2302 && !(DfDp_l=get_DfDp(l)).isEmpty()
2305 *out <<
"DfDp("<<l<<
") = ";
2306 DfDp_l.describe(*out,verbLevel);
2310 for(
int j = 0; j < Ng(); ++j ) {
2315 && !(DgDx_dot_j=get_DgDx_dot(j)).isEmpty()
2318 *out <<
"DgDx_dot("<<j<<
") = ";
2319 DgDx_dot_j.describe(*out,verbLevel);
2325 && !(DgDx_j=get_DgDx(j)).isEmpty()
2328 *out <<
"DgDx("<<j<<
") = ";
2329 DgDx_j.describe(*out,verbLevel);
2332 for(
int l = 0; l < Np(); ++l ) {
2337 && !(DgDp_j_l=get_DgDp(j,l)).isEmpty()
2340 *out <<
"DgDp("<<j<<
","<<l<<
") = ";
2341 DgDp_j_l.describe(*out,verbLevel);
2355 template<
class Scalar>
2357 const std::string &modelEvalDescription_in
2360 modelEvalDescription_ = modelEvalDescription_in;
2363 template<
class Scalar>
2367 supports_DfDp_.resize(Np_in);
2369 DfDp_properties_.resize(Np_in); std::fill_n(DfDp_properties_.begin(),Np_in,
DerivativeProperties());
2371 supports_DfDp_mp_.resize(Np_in);
2372 DfDp_mp_.resize(Np_in); std::fill_n(DfDp_mp_.begin(),Np_in,
MPDerivative());
2373 DfDp_mp_properties_.resize(Np_in); std::fill_n(DfDp_mp_properties_.begin(),Np_in,
DerivativeProperties());
2376 g_.resize(Ng_in); std::fill_n(g_.begin(),Ng_in,Teuchos::null);
2377 supports_DgDx_dot_.resize(Ng_in);
2379 DgDx_dot_properties_.resize(Ng_in); std::fill_n(DgDx_dot_properties_.begin(),Ng_in,
DerivativeProperties());
2380 supports_DgDx_.resize(Ng_in);
2382 DgDx_properties_.resize(Ng_in); std::fill_n(DgDx_properties_.begin(),Ng_in,
DerivativeProperties());
2384 supports_hess_vec_prod_g_xx_.resize(Ng_in);
2387 supports_hess_g_xx_.resize(Ng_in);
2390 g_mp_.resize(Ng_in); std::fill_n(g_mp_.begin(),Ng_in,Teuchos::null);
2391 supports_g_mp_.resize(Ng_in);
2392 supports_DgDx_dot_mp_.resize(Ng_in);
2393 DgDx_dot_mp_.resize(Ng_in); std::fill_n(DgDx_dot_mp_.begin(),Ng_in,
MPDerivative());
2394 DgDx_dot_mp_properties_.resize(Ng_in); std::fill_n(DgDx_dot_mp_properties_.begin(),Ng_in,
DerivativeProperties());
2395 supports_DgDx_mp_.resize(Ng_in);
2396 DgDx_mp_.resize(Ng_in); std::fill_n(DgDx_mp_.begin(),Ng_in,
MPDerivative());
2397 DgDx_mp_properties_.resize(Ng_in); std::fill_n(DgDx_mp_properties_.begin(),Ng_in,
DerivativeProperties());
2400 const int Np = Np_in;
2401 const int NpNp = Np_in*Np_in;
2403 supports_hess_vec_prod_f_xp_.resize(Np);
2406 supports_hess_vec_prod_f_px_.resize(Np);
2409 supports_hess_vec_prod_f_pp_.resize(NpNp);
2412 supports_hess_f_xp_.resize(Np);
2415 supports_hess_f_pp_.resize(NpNp);
2418 supports_H_xp_.resize(Np);
2421 supports_H_pp_.resize(NpNp);
2424 if(Np_in && Ng_in) {
2425 const int NpNg = Np_in*Ng_in;
2426 const int NpNpNg = Np_in*Np_in*Ng_in;
2427 supports_DgDp_.resize(NpNg);
2429 DgDp_properties_.resize(NpNg); std::fill_n(DgDp_properties_.begin(),NpNg,
DerivativeProperties());
2431 supports_hess_vec_prod_g_xp_.resize(NpNg);
2434 supports_hess_vec_prod_g_px_.resize(NpNg);
2437 supports_hess_vec_prod_g_pp_.resize(NpNpNg);
2440 supports_hess_g_xp_.resize(NpNg);
2443 supports_hess_g_pp_.resize(NpNpNg);
2446 supports_DgDp_mp_.resize(NpNg);
2447 DgDp_mp_.resize(NpNg); std::fill_n(DgDp_mp_.begin(),NpNg,
MPDerivative());
2448 DgDp_mp_properties_.resize(NpNg); std::fill_n(DgDp_mp_properties_.begin(),NpNg,
DerivativeProperties());
2453 template<
class Scalar>
2459 ,
"model = \'"<<modelEvalDescription_
2460 <<
"\': Error, arg="<<
toString(arg)<<
" is invalid!"
2462 supports_[arg] = supports_in;
2466 template<
class Scalar>
2473 supports_DfDp_[l] = supports_in;
2477 template<
class Scalar>
2483 supports_DgDx_dot_[j] = supports_in;
2487 template<
class Scalar>
2493 supports_DgDx_[j] = supports_in;
2497 template<
class Scalar>
2502 supports_hess_vec_prod_f_xx_ = supports_in;
2505 template<
class Scalar>
2511 supports_hess_vec_prod_f_xp_[l] = supports_in;
2514 template<
class Scalar>
2520 supports_hess_vec_prod_f_px_[l] = supports_in;
2523 template<
class Scalar>
2530 supports_hess_vec_prod_f_pp_[ l1*Np()+ l2 ] = supports_in;
2533 template<
class Scalar>
2540 supports_DgDp_[ j*Np()+ l ] = supports_in;
2544 template<
class Scalar>
2550 supports_hess_vec_prod_g_xx_[j] = supports_in;
2553 template<
class Scalar>
2560 supports_hess_vec_prod_g_xp_[ j*Np()+ l ] = supports_in;
2563 template<
class Scalar>
2570 supports_hess_vec_prod_g_px_[ j*Np()+ l ] = supports_in;
2573 template<
class Scalar>
2581 supports_hess_vec_prod_g_pp_[ j*Np()*Np()+ l1*Np() + l2 ] = supports_in;
2585 template<
class Scalar>
2590 supports_hess_f_xx_ = supports_in;
2593 template<
class Scalar>
2599 supports_hess_f_xp_[l] = supports_in;
2602 template<
class Scalar>
2609 supports_hess_f_pp_[ l1*Np()+ l2 ] = supports_in;
2612 template<
class Scalar>
2618 supports_hess_g_xx_[j] = supports_in;
2621 template<
class Scalar>
2628 supports_hess_g_xp_[ j*Np()+ l ] = supports_in;
2631 template<
class Scalar>
2639 supports_hess_g_pp_[ j*Np()*Np()+ l1*Np() + l2 ] = supports_in;
2642 template<
class Scalar>
2647 supports_H_xx_ = supports_in;
2650 template<
class Scalar>
2656 supports_H_xp_[l] = supports_in;
2659 template<
class Scalar>
2666 supports_H_pp_[ l1*Np()+ l2 ] = supports_in;
2670 template<
class Scalar>
2677 supports_g_mp_[j] = supports_in;
2681 template<
class Scalar>
2688 supports_DfDp_mp_[l] = supports_in;
2692 template<
class Scalar>
2698 supports_DgDx_dot_mp_[j] = supports_in;
2702 template<
class Scalar>
2708 supports_DgDx_mp_[j] = supports_in;
2712 template<
class Scalar>
2719 supports_DgDp_mp_[ j*Np()+ l ] = supports_in;
2723 template<
class Scalar>
2728 W_properties_ = properties;
2732 template<
class Scalar>
2738 DfDp_properties_[l] = properties;
2742 template<
class Scalar>
2748 DgDx_dot_properties_[j] = properties;
2752 template<
class Scalar>
2758 DgDx_properties_[j] = properties;
2762 template<
class Scalar>
2768 DgDp_properties_[ j*Np()+ l ] = properties;
2772 template<
class Scalar>
2778 DfDp_mp_properties_[l] = properties;
2782 template<
class Scalar>
2784 int j,
const DerivativeProperties &properties
2788 DgDx_dot_mp_properties_[j] = properties;
2792 template<
class Scalar>
2793 void ModelEvaluatorBase::OutArgs<Scalar>::_set_DgDx_mp_properties(
2794 int j,
const DerivativeProperties &properties
2798 DgDx_mp_properties_[j] = properties;
2802 template<
class Scalar>
2803 void ModelEvaluatorBase::OutArgs<Scalar>::_set_DgDp_mp_properties(
2804 int j,
int l,
const DerivativeProperties &properties
2808 DgDp_mp_properties_[ j*Np()+ l ] = properties;
2812 template<
class Scalar>
2818 const int l_Np = TEUCHOS_MIN(this->Np(),inputOutArgs.
Np());
2819 const int l_Ng = TEUCHOS_MIN(this->Ng(),inputOutArgs.
Ng());
2821 &inputOutArgs.supports_[0],
2823 for(
int l = 0; l < l_Np; ++l ) {
2826 this->_setSupports(MEB::OUT_ARG_DfDp,l,ds);
2830 for(
int l = 0; l < l_Np; ++l ) {
2833 this->_setSupports(MEB::OUT_ARG_DfDp_mp,l,ds);
2834 this->_set_DfDp_mp_properties(l,inputOutArgs.get_DfDp_mp_properties(l));
2837 for(
int j = 0; j < l_Ng; ++j ) {
2839 this->_setSupports(MEB::OUT_ARG_DgDx_dot,j,ds);
2842 for(
int j = 0; j < l_Ng; ++j ) {
2844 this->_setSupports(MEB::OUT_ARG_DgDx_dot_mp,j,ds);
2845 if(!ds.
none()) this->_set_DgDx_dot_mp_properties(j,inputOutArgs.get_DgDx_dot_mp_properties(j));
2847 for(
int j = 0; j < l_Ng; ++j ) {
2849 this->_setSupports(MEB::OUT_ARG_DgDx,j,ds);
2852 for(
int j = 0; j < l_Ng; ++j ) {
2854 this->_setSupports(MEB::OUT_ARG_DgDx_mp,j,ds);
2855 if(!ds.
none()) this->_set_DgDx_mp_properties(j,inputOutArgs.get_DgDx_mp_properties(j));
2857 for(
int j = 0; j < l_Ng; ++j )
for(
int l = 0; l < l_Np; ++l ) {
2859 this->_setSupports(MEB::OUT_ARG_DgDp,j,l,ds);
2862 for(
int j = 0; j < l_Ng; ++j )
for(
int l = 0; l < l_Np; ++l ) {
2864 this->_setSupports(MEB::OUT_ARG_DgDp_mp,j,l,ds);
2865 if(!ds.
none()) this->_set_DgDp_mp_properties(j,l,inputOutArgs.get_DgDp_mp_properties(j,l));
2873 for(
int l1 = 0; l1 < l_Np; ++l1 ) {
2874 this->_setSupports(MEB::OUT_ARG_hess_vec_prod_f_xp,l1,inputOutArgs.
supports(MEB::OUT_ARG_hess_vec_prod_f_xp,l1));
2875 this->_setSupports(MEB::OUT_ARG_hess_vec_prod_f_px,l1,inputOutArgs.
supports(MEB::OUT_ARG_hess_vec_prod_f_px,l1));
2876 for(
int l2 = 0; l2 < l_Np; ++l2 ) {
2877 this->_setSupports(MEB::OUT_ARG_hess_vec_prod_f_pp,l1,l2,inputOutArgs.
supports(MEB::OUT_ARG_hess_vec_prod_f_pp,l1,l2));
2880 for(
int j = 0; j < l_Ng; ++j ) {
2881 this->_setSupports(MEB::OUT_ARG_hess_vec_prod_g_xx,j,inputOutArgs.
supports(MEB::OUT_ARG_hess_vec_prod_g_xx,j));
2882 for(
int l1 = 0; l1 < l_Np; ++l1 ) {
2883 this->_setSupports(MEB::OUT_ARG_hess_vec_prod_g_xp,j,l1,inputOutArgs.
supports(MEB::OUT_ARG_hess_vec_prod_g_xp,j,l1));
2884 this->_setSupports(MEB::OUT_ARG_hess_vec_prod_g_px,j,l1,inputOutArgs.
supports(MEB::OUT_ARG_hess_vec_prod_g_px,j,l1));
2885 for(
int l2 = 0; l2 < l_Np; ++l2 ) {
2886 this->_setSupports(MEB::OUT_ARG_hess_vec_prod_g_pp,j,l1,l2,inputOutArgs.
supports(MEB::OUT_ARG_hess_vec_prod_g_pp,j,l1,l2));
2891 for(
int l1 = 0; l1 < l_Np; ++l1 ) {
2892 this->_setSupports(MEB::OUT_ARG_hess_f_xp,l1,inputOutArgs.
supports(MEB::OUT_ARG_hess_f_xp,l1));
2893 for(
int l2 = 0; l2 < l_Np; ++l2 ) {
2894 this->_setSupports(MEB::OUT_ARG_hess_f_pp,l1,l2,inputOutArgs.
supports(MEB::OUT_ARG_hess_f_pp,l1,l2));
2897 for(
int j = 0; j < l_Ng; ++j ) {
2898 this->_setSupports(MEB::OUT_ARG_hess_g_xx,j,inputOutArgs.
supports(MEB::OUT_ARG_hess_g_xx,j));
2899 for(
int l1 = 0; l1 < l_Np; ++l1 ) {
2900 this->_setSupports(MEB::OUT_ARG_hess_g_xp,j,l1,inputOutArgs.
supports(MEB::OUT_ARG_hess_g_xp,j,l1));
2901 for(
int l2 = 0; l2 < l_Np; ++l2 ) {
2902 this->_setSupports(MEB::OUT_ARG_hess_g_pp,j,l1,l2,inputOutArgs.
supports(MEB::OUT_ARG_hess_g_pp,j,l1,l2));
2907 for(
int l1 = 0; l1 < l_Np; ++l1 ) {
2908 this->_setSupports(MEB::OUT_ARG_H_xp,l1,inputOutArgs.
supports(MEB::OUT_ARG_H_xp,l1));
2909 for(
int l2 = 0; l2 < l_Np; ++l2 ) {
2910 this->_setSupports(MEB::OUT_ARG_H_pp,l1,l2,inputOutArgs.
supports(MEB::OUT_ARG_H_pp,l1,l2));
2914 extended_outargs_ = inputOutArgs.extended_outargs_;
2918 template<
class Scalar>
2925 const int l_Ng = this->Ng();
2926 for(
int j = 0; j < l_Ng; ++j ) {
2933 const int l_Ng = this->Ng();
2934 for(
int j = 0; j < l_Ng; ++j ) {
2942 true ,std::logic_error,
2943 "Error, can not handle args other than IN_ARG_x yet!"
2949 template<
class Scalar>
2959 const int l_Np = this->Np();
2960 for(
int l = 0; l < l_Np; ++l )
2968 const int l_Np = this->Np();
2969 for(
int l = 0; l < l_Np; ++l )
2975 true ,std::logic_error,
2976 "Error, can not handle args other than OUT_ARG_f yet!"
2979 this->_setSupports(arg,
false);
2982 template<
class Scalar>
2988 this->_setSupports(MEB::OUT_ARG_hess_vec_prod_f_xx,supports);
2989 this->_setSupports(MEB::OUT_ARG_hess_f_xx,supports);
2990 this->_setSupports(MEB::OUT_ARG_H_xx,supports);
2991 for (
int l1=0; l1<this->Np(); ++l1)
2993 this->_setSupports(MEB::OUT_ARG_hess_vec_prod_f_xp,l1,supports);
2994 this->_setSupports(MEB::OUT_ARG_hess_vec_prod_f_px,l1,supports);
2995 this->_setSupports(MEB::OUT_ARG_hess_f_xp,l1,supports);
2996 this->_setSupports(MEB::OUT_ARG_H_xp,l1,supports);
2997 for (
int l2=0; l2<this->Np(); ++l2)
2999 this->_setSupports(MEB::OUT_ARG_hess_vec_prod_f_pp,l1,l2,supports);
3000 this->_setSupports(MEB::OUT_ARG_hess_f_pp,l1,l2,supports);
3001 this->_setSupports(MEB::OUT_ARG_H_pp,l1,l2,supports);
3005 for (
int j=0; j<this->Ng(); ++j)
3007 this->_setSupports(MEB::OUT_ARG_hess_g_xx,j,supports);
3008 this->_setSupports(MEB::OUT_ARG_hess_vec_prod_g_xx,j,supports);
3009 for (
int l1=0; l1<this->Np(); ++l1)
3011 this->_setSupports(MEB::OUT_ARG_hess_vec_prod_g_xp,j,l1,supports);
3012 this->_setSupports(MEB::OUT_ARG_hess_vec_prod_g_px,j,l1,supports);
3013 this->_setSupports(MEB::OUT_ARG_hess_g_xp,j,l1,supports);
3014 for (
int l2=0; l2<this->Np(); ++l2)
3016 this->_setSupports(MEB::OUT_ARG_hess_vec_prod_g_pp,j,l1,l2,supports);
3017 this->_setSupports(MEB::OUT_ARG_hess_g_pp,j,l1,l2,supports);
3026 template<
class Scalar>
3030 !this->supports(arg), std::logic_error
3031 ,
"Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(arg):\n\n"
3032 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3033 "Error, The argument arg = " <<
toString(arg) <<
" is not supported!"
3038 template<
class Scalar>
3040 EOutArgsDfDp arg,
int l,
const Derivative<Scalar> &deriv
3043 const DerivativeSupport derivSupport = this->supports(arg,l);
3045 !deriv.isSupportedBy(derivSupport), std::logic_error,
3046 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_DfDp,l):\n\n"
3047 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3048 "Error, The argument DfDp("<<l<<
") = " << deriv.description() <<
"\n"
3049 "is not supported!\n\n"
3050 "The supported types include " << derivSupport.description() <<
"!"
3055 template<
class Scalar>
3056 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3060 const DerivativeSupport derivSupport = this->supports(arg,j);
3062 !deriv.isSupportedBy(derivSupport), std::logic_error,
3063 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_DgDx_dot,j):\n\n"
3064 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3065 "Error, The argument DgDx_dot("<<j<<
") = " << deriv.description() <<
"\n"
3066 "is not supported!\n\n"
3067 "The supported types include " << derivSupport.description() <<
"!"
3072 template<
class Scalar>
3073 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3074 EOutArgsDgDx arg,
int j,
const Derivative<Scalar> &deriv
3077 const DerivativeSupport derivSupport = this->supports(arg,j);
3079 !deriv.isSupportedBy(derivSupport), std::logic_error,
3080 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_DgDx,j):\n\n"
3081 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3082 "Error, The argument DgDx("<<j<<
") = " << deriv.description() <<
"\n"
3083 "is not supported!\n\n"
3084 "The supported types include " << derivSupport.description() <<
"!"
3089 template<
class Scalar>
3090 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3091 EOutArgsDgDp arg,
int j,
int l,
const Derivative<Scalar> &deriv
3094 const DerivativeSupport derivSupport = this->supports(arg,j,l);
3096 !deriv.isSupportedBy(derivSupport), std::logic_error,
3097 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_DgDp,j,l):\n\n"
3098 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3099 "Error, The argument DgDp("<<j<<
","<<l<<
") = " << deriv.description() <<
"\n"
3100 "is not supported!\n\n"
3101 "The supported types include " << derivSupport.description() <<
"!"
3106 template<
class Scalar>
3107 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3111 const bool support = this->supports(arg);
3113 !support, std::logic_error,
3114 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_hess_vec_prod_f_xx):\n\n"
3115 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3116 "Error, The argument hess_vec_prod_f_xx() is not supported!"
3120 template<
class Scalar>
3121 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3125 const bool support = this->supports(arg,l);
3127 !support, std::logic_error,
3128 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_hess_vec_prod_f_xp,l):\n\n"
3129 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3130 "Error, The argument hess_vec_prod_f_xp("<<l<<
") is not supported!"
3134 template<
class Scalar>
3135 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3139 const bool support = this->supports(arg,l);
3141 !support, std::logic_error,
3142 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_hess_vec_prod_f_px,l):\n\n"
3143 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3144 "Error, The argument hess_vec_prod_f_px("<<l<<
") is not supported!"
3148 template<
class Scalar>
3149 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3153 const bool support = this->supports(arg,l1,l2);
3155 !support, std::logic_error,
3156 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_hess_vec_prod_f_pp,l1,l2):\n\n"
3157 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3158 "Error, The argument hess_vec_prod_f_pp("<<l1<<
","<<l2<<
") is not supported!"
3162 template<
class Scalar>
3163 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3167 const bool support = this->supports(arg,j);
3169 !support, std::logic_error,
3170 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_hess_vec_prod_g_xx,j):\n\n"
3171 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3172 "Error, The argument hess_vec_prod_g_xx("<<j<<
") is not supported!"
3176 template<
class Scalar>
3177 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3181 const bool support = this->supports(arg,j,l);
3183 !support, std::logic_error,
3184 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_hess_vec_prod_g_xp,j,l):\n\n"
3185 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3186 "Error, The argument hess_vec_prod_g_xp("<<j<<
","<<l<<
") is not supported!"
3190 template<
class Scalar>
3191 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3195 const bool support = this->supports(arg,j,l);
3197 !support, std::logic_error,
3198 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_hess_vec_prod_g_px,j,l):\n\n"
3199 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3200 "Error, The argument hess_vec_prod_g_px("<<j<<
","<<l<<
") is not supported!"
3204 template<
class Scalar>
3205 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3209 const bool support = this->supports(arg,j,l1,l2);
3211 !support, std::logic_error,
3212 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_hess_vec_prod_g_pp,j,l1,l2):\n\n"
3213 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3214 "Error, The argument hess_vec_prod_g_pp("<<j<<
","<<l1<<
","<<l2<<
") is not supported!"
3218 template<
class Scalar>
3219 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3223 const bool support = this->supports(arg);
3225 !support, std::logic_error,
3226 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_hess_f_xx):\n\n"
3227 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3228 "Error, The argument hess_f_xx() is not supported!"
3232 template<
class Scalar>
3233 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3237 const bool support = this->supports(arg,l);
3239 !support, std::logic_error,
3240 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_hess_f_xp,l):\n\n"
3241 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3242 "Error, The argument hess_f_xp() is not supported!"
3246 template<
class Scalar>
3247 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3251 const bool support = this->supports(arg,l1,l2);
3253 !support, std::logic_error,
3254 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_hess_f_pp,l1,l2):\n\n"
3255 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3256 "Error, The argument hess_f_pp() is not supported!"
3260 template<
class Scalar>
3261 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3265 const bool support = this->supports(arg,j);
3267 !support, std::logic_error,
3268 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_hess_g_xx,j):\n\n"
3269 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3270 "Error, The argument hess_g_xx() is not supported!"
3274 template<
class Scalar>
3275 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3279 const bool support = this->supports(arg,j,l);
3281 !support, std::logic_error,
3282 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_hess_g_xp,j,l):\n\n"
3283 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3284 "Error, The argument hess_g_xp() is not supported!"
3288 template<
class Scalar>
3289 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3293 const bool support = this->supports(arg,j,l1,l2);
3295 !support, std::logic_error,
3296 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_hess_g_pp,j,l1,l2):\n\n"
3297 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3298 "Error, The argument hess_g_pp() is not supported!"
3302 template<
class Scalar>
3303 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3307 const bool support = this->supports(arg);
3309 !support, std::logic_error,
3310 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_H_xx):\n\n"
3311 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3312 "Error, The argument H_xx() is not supported!"
3316 template<
class Scalar>
3317 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3321 const bool support = this->supports(arg,l);
3323 !support, std::logic_error,
3324 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_H_xp,l):\n\n"
3325 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3326 "Error, The argument H_xp() is not supported!"
3330 template<
class Scalar>
3331 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3335 const bool support = this->supports(arg,l1,l2);
3337 !support, std::logic_error,
3338 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_H_pp,l1,l2):\n\n"
3339 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3340 "Error, The argument H_pp() is not supported!"
3345 template<
class Scalar>
3346 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3352 !supports_g_mp_[j], std::logic_error,
3353 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_g_mp,j):\n\n"
3354 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3355 "Error, The argument g_mp("<<j<<
") \n"
3356 "is not supported!\n\n"
3361 template<
class Scalar>
3362 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3366 const DerivativeSupport derivSupport = this->supports(arg,l);
3368 !deriv.isSupportedBy(derivSupport), std::logic_error,
3369 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_DfDp_mp,l):\n\n"
3370 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3371 "Error, The argument DfDp_mp("<<l<<
") = " << deriv.description() <<
"\n"
3372 "is not supported!\n\n"
3373 "The supported types include " << derivSupport.description() <<
"!"
3378 template<
class Scalar>
3379 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3383 const DerivativeSupport derivSupport = this->supports(arg,j);
3385 !deriv.isSupportedBy(derivSupport), std::logic_error,
3386 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_DgDx_dot_mp,j):\n\n"
3387 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3388 "Error, The argument DgDx_dot_mp("<<j<<
") = " << deriv.description() <<
"\n"
3389 "is not supported!\n\n"
3390 "The supported types include " << derivSupport.description() <<
"!"
3395 template<
class Scalar>
3396 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3400 const DerivativeSupport derivSupport = this->supports(arg,j);
3402 !deriv.isSupportedBy(derivSupport), std::logic_error,
3403 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_DgDx_mp,j):\n\n"
3404 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3405 "Error, The argument DgDx_mp("<<j<<
") = " << deriv.description() <<
"\n"
3406 "is not supported!\n\n"
3407 "The supported types include " << derivSupport.description() <<
"!"
3412 template<
class Scalar>
3413 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
3417 const DerivativeSupport derivSupport = this->supports(arg,j,l);
3419 !deriv.isSupportedBy(derivSupport), std::logic_error,
3420 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_DgDp_mp,j,l):\n\n"
3421 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3422 "Error, The argument DgDp_mp("<<j<<
","<<l<<
") = " << deriv.description() <<
"\n"
3423 "is not supported!\n\n"
3424 "The supported types include " << derivSupport.description() <<
"!"
3429 template<
class Scalar>
3430 void ModelEvaluatorBase::OutArgs<Scalar>::assert_l(
int l)
const
3433 !( 0 <= l && l < Np() ), std::logic_error
3434 ,
"Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_l(l):\n\n"
3435 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3436 "Error, The parameter subvector p("<<l<<
")"
3437 " is not in the range [0,"<<Np()<<
")!"
3442 template<
class Scalar>
3443 void ModelEvaluatorBase::OutArgs<Scalar>::assert_j(
int j)
const
3446 !( 0 <= j && j < Ng() ), std::logic_error
3447 ,
"Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_j(j):\n\n"
3448 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
3449 "Error, The auxiliary function g("<<j<<
")"
3450 " is not in the range [0,"<<Ng()<<
")!"
3460 template<
class Scalar>
3465 template<
class Scalar>
3471 template<
class Scalar>
3473 const std::string &modelEvalDescription_in )
3475 this->_setModelEvalDescription(modelEvalDescription_in);
3479 template<
class Scalar>
3481 { this->_set_Np_Ng(Np_in, 0); }
3483 template<
class Scalar>
3485 { this->_set_Np_Ng(Np_in, Ng_in); }
3487 template<
class Scalar>
3489 { this->_setSupports(arg,supports_in); }
3492 template<
class Scalar>
3494 { this->_setSupports(arg,l,supports_in); }
3497 template<
class Scalar>
3502 this->_setSupports(inArgs, Np_in);
3506 template<
class Scalar>
3511 this->_setUnsupportsAndRelated(arg);
3520 template<
class Scalar>
3525 template<
class Scalar>
3529 :
OutArgs<Scalar>(inputOutArgs)
3533 template<
class Scalar>
3535 const std::string &modelEvalDescription_in
3537 { this->_setModelEvalDescription(modelEvalDescription_in); }
3540 template<
class Scalar>
3542 { this->_set_Np_Ng(Np_in, Ng_in); }
3545 template<
class Scalar>
3549 { this->_setSupports(arg,supports_in); }
3552 template<
class Scalar>
3556 { this->_setSupports(arg,l,supports_in); }
3559 template<
class Scalar>
3563 { this->_setSupports(arg,j,supports_in); }
3566 template<
class Scalar>
3570 { this->_setSupports(arg,j,supports_in); }
3573 template<
class Scalar>
3577 { this->_setSupports(arg,supports_in); }
3579 template<
class Scalar>
3583 { this->_setSupports(arg,l,supports_in); }
3585 template<
class Scalar>
3589 { this->_setSupports(arg,l,supports_in); }
3591 template<
class Scalar>
3595 { this->_setSupports(arg,l1,l2,supports_in); }
3598 template<
class Scalar>
3602 { this->_setSupports(arg,j,l,supports_in); }
3605 template<
class Scalar>
3609 { this->_setSupports(arg,j,supports_in); }
3611 template<
class Scalar>
3615 { this->_setSupports(arg,j,l,supports_in); }
3617 template<
class Scalar>
3621 { this->_setSupports(arg,j,l,supports_in); }
3623 template<
class Scalar>
3627 { this->_setSupports(arg,j,l1,l2,supports_in); }
3629 template<
class Scalar>
3633 { this->_setSupports(arg,supports_in); }
3635 template<
class Scalar>
3639 { this->_setSupports(arg,l,supports_in); }
3641 template<
class Scalar>
3645 { this->_setSupports(arg,l1,l2,supports_in); }
3647 template<
class Scalar>
3651 { this->_setSupports(arg,j,supports_in); }
3653 template<
class Scalar>
3657 { this->_setSupports(arg,j,l,supports_in); }
3659 template<
class Scalar>
3663 { this->_setSupports(arg,j,l1,l2,supports_in); }
3665 template<
class Scalar>
3669 { this->_setSupports(arg,supports_in); }
3671 template<
class Scalar>
3675 { this->_setSupports(arg,l,supports_in); }
3677 template<
class Scalar>
3681 { this->_setSupports(arg,l1,l2,supports_in); }
3683 template<
class Scalar>
3687 { this->_setSupports(arg,j,supports_in); }
3690 template<
class Scalar>
3694 { this->_setSupports(arg,l,supports_in); }
3697 template<
class Scalar>
3701 { this->_setSupports(arg,j,supports_in); }
3704 template<
class Scalar>
3708 { this->_setSupports(arg,j,supports_in); }
3711 template<
class Scalar>
3713 EOutArgsDgDp_mp arg,
int j,
int l,
const DerivativeSupport& supports_in
3715 { this->_setSupports(arg,j,l,supports_in); }
3718 template<
class Scalar>
3722 { this->_set_W_properties(properties); }
3725 template<
class Scalar>
3729 { this->_set_DfDp_properties(l,properties); }
3732 template<
class Scalar>
3736 { this->_set_DgDx_dot_properties(j,properties); }
3739 template<
class Scalar>
3743 { this->_set_DgDx_properties(j,properties); }
3746 template<
class Scalar>
3750 { this->_set_DgDp_properties(j,l,properties); }
3753 template<
class Scalar>
3757 { this->_set_DfDp_mp_properties(l,properties); }
3760 template<
class Scalar>
3762 int j,
const DerivativeProperties &properties
3764 { this->_set_DgDx_dot_mp_properties(j,properties); }
3767 template<
class Scalar>
3768 void ModelEvaluatorBase::OutArgsSetup<Scalar>::set_DgDx_mp_properties(
3769 int j,
const DerivativeProperties &properties
3771 { this->_set_DgDx_mp_properties(j,properties); }
3774 template<
class Scalar>
3775 void ModelEvaluatorBase::OutArgsSetup<Scalar>::set_DgDp_mp_properties(
3776 int j,
int l,
const DerivativeProperties &properties
3778 { this->_set_DgDp_mp_properties(j,l,properties); }
3781 template<
class Scalar>
3785 { this->_setSupports(inputOutArgs); }
3788 template<
class Scalar>
3792 { this->_setUnsupportsAndRelated(arg); }
3795 template<
class Scalar>
3799 { this->_setUnsupportsAndRelated(arg); }
3802 template<
class Scalar>
3806 { this->_setHessianSupports(supports); }
3819 #define THYRA_MODEL_EVALUATOR_BASE_INSTANT(SCALAR) \
3821 template class ModelEvaluatorBase::InArgs<SCALAR >; \
3823 template std::string \
3824 ModelEvaluatorBase::Derivative<SCALAR >::description() const; \
3827 void ModelEvaluatorBase::Derivative<SCALAR >::describe( \
3828 Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel \
3831 template class ModelEvaluatorBase::OutArgs<SCALAR >; \
3833 template class ModelEvaluatorBase::InArgsSetup<SCALAR >; \
3835 template class ModelEvaluatorBase::OutArgsSetup<SCALAR >;
3838 #endif // THYRA_MODEL_EVALUATOR_BASE_DEF_HPP
RCP< LinearOpBase< Scalar > > get_H_xx() const
Precondition: supports(OUT_ARG_H_xx)==true.
void set_hess_vec_prod_g_px(int j, int l, const RCP< MultiVectorBase< Scalar > > &hess_vec_prod_g_px_j_l)
Precondition: supports(OUT_ARG_hess_vec_prod_g_px,j,l)==true.
int Ng() const
Return the number of axillary response functions g(j)(...) supported (Ng >= 0).
RCP< MultiVectorBase< Scalar > > get_hess_vec_prod_f_pp(int l1, int l2) const
Precondition: supports(OUT_ARG_hess_vec_prod_f_pp,l1,l2)==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_DgDx_properties(int j, const DerivativeProperties &properties)
void _set_Np_Ng(int Np, int Ng)
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)
std::string toString(ModelEvaluatorBase::EInArgsMembers)
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..
EOutArgs_hess_vec_prod_f_pp
void set_x_dot_dot(const RCP< const VectorBase< Scalar > > &x_dot_dot)
Precondition: supports(IN_ARG_x_dot_dot)==true.
void set_hess_f_pp(int l1, int l2, const RCP< LinearOpBase< Scalar > > &hess_f_pp_l1_l2)
Precondition: supports(OUT_ARG_hess_f_pp,l1,l2)==true.
void setArgs(const OutArgs< Scalar > &outArgs, bool ignoreUnsupported=false)
Set all arguments fron outArgs into *this.
basic_OSTab< char > OSTab
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.
std::string modelEvalDescription() const
static const int NUM_E_OUT_ARGS_MEMBERS
RCP< MultiVectorBase< Scalar > > get_hess_vec_prod_f_xp(int l) const
Precondition: supports(OUT_ARG_hess_vec_prod_f_xp,l)==true.
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
EOutArgs_hess_vec_prod_f_xp
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)
void _setUnsupportsAndRelated(EInArgsMembers arg)
RCP< LinearOpBase< Scalar > > get_hess_g_xp(int j, int l) const
Precondition: supports(OUT_ARG_hess_g_xp,j,l)==true.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
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...
RCP< LinearOpBase< Scalar > > get_H_pp(int l1, int l2) const
Precondition: supports(OUT_ARG_H_pp,l1,l2)==true.
Evaluation< VectorBase< Scalar > > get_g(int j) const
Precondition: supports(OUT_ARG_g)==true..
Evaluation< VectorBase< Scalar > > get_f() const
Precondition: supports(OUT_ARG_f)==true.
void set_hess_f_xp(int l, const RCP< LinearOpBase< Scalar > > &hess_f_xp_l)
Precondition: supports(OUT_ARG_hess_f_xp,l)==true.
RCP< const Stokhos::ProductEpetraVector > get_x_mp() const
Precondition: supports(IN_ARG_x_mp)==true.
void set_hess_vec_prod_g_xx(int j, const RCP< MultiVectorBase< Scalar > > &hess_vec_prod_g_xx_j)
Precondition: supports(OUT_ARG_hess_vec_prod_g_xx,j)==true.
std::string description() const
void _setSupports(EOutArgsMembers arg, bool supports)
bool supports(EOutArgsMembers arg) const
Determine if an input argument is supported or not.
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).
Derivative< Scalar > get_DgDp(int j, int l) const
Precondition: supports(OUT_ARG_DgDp,j,l)==true.
void set_hess_f_xx(const RCP< LinearOpBase< Scalar > > &hess_f_xx)
Precondition: supports(OUT_ARG_hess_f_xx)==true.
DerivativeProperties get_DgDx_properties(int j) const
Return the know properties of DgDx(j) (precondition: supports(OUT_ARG_DgDx,j)==true).
void set_W_properties(const DerivativeProperties &properties)
RCP< MultiVectorBase< Scalar > > get_hess_vec_prod_g_xx(int j) const
Precondition: supports(OUT_ARG_hess_vec_prod_g_xx,j)==true.
RCP< MultiVectorBase< Scalar > > get_hess_vec_prod_f_px(int l) const
Precondition: supports(OUT_ARG_hess_vec_prod_f_px,l)==true.
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.
void set_x(const RCP< const VectorBase< Scalar > > &x)
Precondition: supports(IN_ARG_x)==true.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
void setUnsupportsAndRelated(EInArgsMembers arg)
Interface for a collection of column vectors called a multi-vector.
void setUnsupportsAndRelated(EInArgsMembers arg)
void set_hess_vec_prod_f_xx(const RCP< MultiVectorBase< Scalar > > &hess_vec_prod_f_xx)
Precondition: supports(OUT_ARG_hess_vec_prod_f_xx)==true.
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.
void set_DgDp_properties(int j, int l, const DerivativeProperties &properties)
Teuchos::ScalarTraits< Scalar >::magnitudeType ScalarMag
void _setHessianSupports(const bool supports)
EOutArgs_hess_vec_prod_f_xx
void setHessianSupports(const bool supports=true)
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
void set_hess_vec_prod_f_pp(int l1, int l2, const RCP< MultiVectorBase< Scalar > > &hess_vec_prod_f_pp_l1_l2)
Precondition: supports(OUT_ARG_hess_vec_prod_f_pp,l1,l2)==true.
void set_hess_g_xp(int j, int l, const RCP< LinearOpBase< Scalar > > &hess_g_xp_j_l)
Precondition: supports(OUT_ARG_hess_g_xp,j,l)==true.
void _setModelEvalDescription(const std::string &modelEvalDescription)
Abstract interface for finite-dimensional dense vectors.
void set_Np_Ng(int Np, int Ng)
RCP< LinearOpBase< Scalar > > get_hess_g_xx(int j) const
Precondition: supports(OUT_ARG_hess_g_xx,j)==true.
Simple public strict containing properties of a derivative object.
void _setSupports(EInArgsMembers arg, bool supports)
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_hess_g_xx(int j, const RCP< LinearOpBase< Scalar > > &hess_g_xx_j)
Precondition: supports(OUT_ARG_hess_g_xx,j)==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< MultiVectorBase< Scalar > > get_hess_vec_prod_g_px(int j, int l) const
Precondition: supports(OUT_ARG_hess_vec_prod_g_px,j,l)==true.
RCP< LinearOpBase< Scalar > > get_hess_f_pp(int l1, int l2) const
Precondition: supports(OUT_ARG_hess_f_pp,l1,l2)==true.
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).
TEUCHOSCORE_LIB_DLL_EXPORT bool includesVerbLevel(const EVerbosityLevel verbLevel, const EVerbosityLevel requestedVerbLevel, const bool isDefaultLevel=false)
void set_DgDx_dot_properties(int j, const DerivativeProperties &properties)
bool isFailed() const
Return if the evaluation failed or not.
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.
EOutArgs_hess_vec_prod_g_pp
EOutArgs_hess_vec_prod_g_xp
void set_hess_vec_prod_f_px(int l, const RCP< MultiVectorBase< Scalar > > &hess_vec_prod_f_px_l)
Precondition: supports(OUT_ARG_hess_vec_prod_f_px,l)==true.
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_H_xx(const RCP< LinearOpBase< Scalar > > &H_xx)
Precondition: supports(OUT_ARG_H_xx)==true.
void set_hess_vec_prod_f_xp(int l, const RCP< MultiVectorBase< Scalar > > &hess_vec_prod_f_xp_l)
Precondition: supports(OUT_ARG_hess_vec_prod_f_xp,l)==true.
void set_DgDx_dot(int j, const Derivative< Scalar > &DgDx_dot_j)
Precondition: supports(OUT_ARG_DgDx_dot,j)==true.
bool nonnull(const boost::shared_ptr< T > &p)
RCP< LinearOpBase< Scalar > > get_hess_g_pp(int j, int l1, int l2) const
Precondition: supports(OUT_ARG_hess_g_pp,j,l1,l2)==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.
RCP< MultiVectorBase< Scalar > > get_hess_vec_prod_f_xx() const
Precondition: supports(OUT_ARG_hess_vec_prod_f_xx)==true.
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.
void set_hess_g_pp(int j, int l1, int l2, const RCP< LinearOpBase< Scalar > > &hess_g_pp_j_l1_l2)
Precondition: supports(OUT_ARG_hess_g_pp,j,l1,l2)==true.
bool supports() const
Determines if an extended output argument of type ObjectType is supported.
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.
RCP< MultiVectorBase< Scalar > > get_hess_vec_prod_g_pp(int j, int l1, int l2) const
Precondition: supports(OUT_ARG_hess_vec_prod_g_pp,j,l1,l2)==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)
void set_hess_vec_prod_g_pp(int j, int l1, int l2, const RCP< MultiVectorBase< Scalar > > &hess_vec_prod_g_pp_j_l1_l2)
Precondition: supports(OUT_ARG_hess_vec_prod_g_pp,j,l1,l2)==true.
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.
void set_H_pp(int l1, int l2, const RCP< LinearOpBase< Scalar > > &H_pp_l1_l2)
Precondition: supports(OUT_ARG_H_pp,l1,l2)==true.
RCP< PreconditionerBase< Scalar > > get_W_prec() const
Precondition: supports(OUT_ARG_W_op)==true.
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.
EOutArgs_hess_vec_prod_g_px
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.
RCP< LinearOpBase< Scalar > > get_hess_f_xx() const
Precondition: supports(OUT_ARG_hess_f_xx)==true.
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_H_xp(int l, const RCP< LinearOpBase< Scalar > > &H_xp_l)
Precondition: supports(OUT_ARG_H_xp,l)==true.
#define TEUCHOS_ASSERT_EQUALITY(val1, val2)
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.
RCP< LinearOpBase< Scalar > > get_hess_f_xp(int l) const
Precondition: supports(OUT_ARG_hess_f_xp,l)==true.
EOutArgs_hess_vec_prod_g_xx
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
bool supports(EInArgsMembers arg) const
Determines if an input argument is supported or not.
std::string modelEvalDescription() const
Simple aggregate class that stores a derivative object as a general linear operator or as a multi-vec...
void set_W_x_dot_dot_coeff(Scalar W_x_dot_dot_coeff)
Precondition: supports(IN_ARG_W_x_dot_dot_coeff)==true.
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.
void set_W_op(const RCP< LinearOpBase< Scalar > > &W_op)
Precondition: supports(OUT_ARG_W_op)==true.
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)
virtual void describe(FancyOStream &out, const EVerbosityLevel verbLevel=verbLevel_default) const
void set_hess_vec_prod_g_xp(int j, int l, const RCP< MultiVectorBase< Scalar > > &hess_vec_prod_g_xp_j_l)
Precondition: supports(OUT_ARG_hess_vec_prod_g_xp,j,l)==true.
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 ...
RCP< MultiVectorBase< Scalar > > get_hess_vec_prod_g_xp(int j, int l) const
Precondition: supports(OUT_ARG_hess_vec_prod_g_xp,j,l)==true.
DerivativeProperties get_W_properties() const
Return the known properties of W (precondition: supports(OUT_ARG_f)==true).
RCP< LinearOpBase< Scalar > > get_H_xp(int l) const
Precondition: supports(OUT_ARG_H_xp,l)==true.
EOutArgs_hess_vec_prod_f_px
Derivative< Scalar > get_DgDx(int j) const
Precondition: supports(OUT_ARG_DgDx,j)==true.
Concrete aggregate class for all input arguments computable by a ModelEvaluator subclass object...