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!")
114 std::fill_n(&supports_[0],NUM_E_IN_ARGS_MEMBERS,
false);
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>
135 int(arg)>=NUM_E_IN_ARGS_MEMBERS ||
int(arg) < 0,std::logic_error
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>
153 { assert_supports(IN_ARG_x_dot_dot); x_dot_dot_ = x_dot_dot; }
155 template<
class Scalar>
158 { assert_supports(IN_ARG_x_dot_dot);
return x_dot_dot_; }
160 template<
class Scalar>
164 { assert_supports(IN_ARG_x_dot); x_dot_ = x_dot; }
167 template<
class Scalar>
170 { assert_supports(IN_ARG_x_dot);
return x_dot_; }
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>
216 { assert_supports(IN_ARG_x_dot_mp); x_dot_mp_ = x_dot_mp; }
219 template<
class Scalar>
222 { assert_supports(IN_ARG_x_dot_mp);
return x_dot_mp_; }
225 template<
class Scalar>
229 { assert_supports(IN_ARG_x_mp); x_mp_ = x_mp; }
232 template<
class Scalar>
235 { assert_supports(IN_ARG_x_mp);
return x_mp_; }
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>
254 assert_supports(IN_ARG_x);
255 g_multiplier_[j] = g_multiplier;
258 template<
class Scalar>
263 assert_supports(IN_ARG_x);
264 return g_multiplier_[j];
267 #ifdef HAVE_THYRA_ME_POLYNOMIAL 269 template<
class Scalar>
273 { assert_supports(IN_ARG_x_dot_poly); x_dot_poly_ = x_dot_poly; }
276 template<
class Scalar>
279 { assert_supports(IN_ARG_x_dot_poly);
return x_dot_poly_; }
282 template<
class Scalar>
283 void ModelEvaluatorBase::InArgs<Scalar>::set_x_poly(
286 { assert_supports(IN_ARG_x_poly); x_poly_ = x_poly; }
289 template<
class Scalar>
290 RCP<const Teuchos::Polynomial< VectorBase<Scalar> > >
291 ModelEvaluatorBase::InArgs<Scalar>::get_x_poly()
const 292 { assert_supports(IN_ARG_x_poly);
return x_poly_; }
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>
335 { assert_supports(IN_ARG_alpha); alpha_ = alpha; }
338 template<
class Scalar>
340 { assert_supports(IN_ARG_alpha);
return alpha_; }
343 template<
class Scalar>
345 { assert_supports(IN_ARG_beta); beta_ = beta; }
348 template<
class Scalar>
350 { assert_supports(IN_ARG_beta);
return beta_; }
352 template<
class Scalar>
354 { assert_supports(IN_ARG_W_x_dot_dot_coeff); W_x_dot_dot_coeff_ = W_x_dot_dot_coeff; }
357 template<
class Scalar>
359 { assert_supports(IN_ARG_W_x_dot_dot_coeff);
return W_x_dot_dot_coeff_; }
361 template<
class Scalar>
363 { assert_supports(IN_ARG_step_size); step_size_ = step_size; }
365 template<
class Scalar>
367 { assert_supports(IN_ARG_step_size);
return step_size_; }
369 template<
class Scalar>
371 { assert_supports(IN_ARG_stage_number);
return stage_number_; }
374 template<
class Scalar>
376 { assert_supports(IN_ARG_stage_number); stage_number_ = stage_number; }
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;
388 if(supports(IN_ARG_x_dot_dot) || !ignoreUnsupported)
389 set_x_dot_dot(condCloneVec(inArgs.
get_x_dot_dot(),cloneObjects));
392 if(supports(IN_ARG_x_dot) || !ignoreUnsupported)
393 set_x_dot(condCloneVec(inArgs.
get_x_dot(),cloneObjects));
396 if(supports(IN_ARG_x_dot_mp) || !ignoreUnsupported)
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));
404 if(supports(IN_ARG_x_mp) || !ignoreUnsupported)
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 421 if( inArgs.
supports(IN_ARG_x_dot_poly) &&
nonnull(inArgs.get_x_dot_poly()) ) {
422 if(supports(IN_ARG_x_dot_poly) || !ignoreUnsupported) {
424 cloneObjects &&
"Have not implemented cloning for x_dot_poly yet!" );
425 set_x_dot_poly(inArgs.get_x_dot_poly());
429 if(supports(IN_ARG_x_poly) || !ignoreUnsupported) {
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) {
446 if (inArgs.
supports(IN_ARG_p_mp,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());
455 if (inArgs.
supports(IN_ARG_alpha)) {
456 if(supports(IN_ARG_alpha) || !ignoreUnsupported)
460 if(supports(IN_ARG_beta) || !ignoreUnsupported)
463 if (inArgs.
supports(IN_ARG_W_x_dot_dot_coeff)) {
464 if(supports(IN_ARG_W_x_dot_dot_coeff) || !ignoreUnsupported)
467 if (inArgs.
supports(IN_ARG_step_size)) {
468 if(supports(IN_ARG_step_size) || !ignoreUnsupported)
471 if (inArgs.
supports(IN_ARG_stage_number)) {
472 if(supports(IN_ARG_stage_number) || !ignoreUnsupported)
476 if (extended_inargs_.size() > 0)
479 "Extended InArgs does not support cloning!");
480 this->extended_inargs_ = inArgs.extended_inargs_;
484 template<
class Scalar>
489 for (
int inArg_i = 0; inArg_i < NUM_E_IN_ARGS_MEMBERS; ++inArg_i ) {
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;
538 using Teuchos::includesVerbLevel;
545 out = Teuchos::rcp(&out_arg,
false);
556 *out <<
"Thyra::ModelEvaluatorBase::InArgs<"<<ST::name()<<
">:\n";
559 *out <<
"model = " << modelEvalDescription_ <<
"\n";
560 *out <<
"Np = " << Np() <<
"\n";
563 if ( this->supports(IN_ARG_x_dot_dot) && !
is_null(x_dot_dot=get_x_dot_dot()) ) {
564 *out <<
"x_dot_dot = " << Teuchos::describe(*x_dot_dot,x_verbLevel);
566 *out <<
"||x_dot_dot|| = " <<
norm(*x_dot_dot) << endl;
570 if ( this->supports(IN_ARG_x_dot) && !
is_null(x_dot=get_x_dot()) ) {
571 *out <<
"x_dot = " << Teuchos::describe(*x_dot,x_verbLevel);
573 *out <<
"||x_dot|| = " <<
norm(*x_dot) << endl;
577 if ( this->supports(IN_ARG_x) && !
is_null(x=get_x()) ) {
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;
595 if (this->supports(IN_ARG_t)) {
596 *out <<
"t = " << t_ << endl;
598 if (this->supports(IN_ARG_alpha)) {
599 *out <<
"alpha = " << alpha_ << endl;
601 if (this->supports(IN_ARG_beta)) {
602 *out <<
"beta = " << beta_ << endl;
604 if (this->supports(IN_ARG_W_x_dot_dot_coeff)) {
605 *out <<
"W_x_dot_dot_coeff = " << W_x_dot_dot_coeff_ << endl;
607 if (this->supports(IN_ARG_step_size)) {
608 *out <<
"step_size = " << step_size_ << endl;
610 if (this->supports(IN_ARG_stage_number)) {
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>
644 int(arg)>=NUM_E_IN_ARGS_MEMBERS ||
int(arg) < 0,std::logic_error
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],
667 &inArgs.supports_[0] + NUM_E_IN_ARGS_MEMBERS, &supports_[0] );
668 this->_set_Np_Ng( Np_in >= 0 ? Np_in : inArgs.
Np(), inArgs.
Ng() );
672 template<
class Scalar>
679 this->_setSupports(IN_ARG_x_dot_dot,
false);
680 this->_setSupports(IN_ARG_x_dot,
false);
681 this->_setSupports(IN_ARG_x_dot_poly,
false);
682 this->_setSupports(IN_ARG_alpha,
false);
683 this->_setSupports(IN_ARG_beta,
false);
684 this->_setSupports(IN_ARG_W_x_dot_dot_coeff,
false);
685 this->_setSupports(IN_ARG_step_size,
false);
686 this->_setSupports(IN_ARG_stage_number,
false);
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())) {
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!"),
864 std::fill_n(&supports_[0],NUM_E_OUT_ARGS_MEMBERS,
false);
865 this->_setHessianSupports(
false);
869 template<
class Scalar>
871 {
return DfDp_.size(); }
874 template<
class Scalar>
876 {
return g_.size(); }
879 template<
class Scalar>
885 int(arg)>=NUM_E_OUT_ARGS_MEMBERS ||
int(arg) < 0,std::logic_error
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>
1112 EOutArgsDfDp_mp ,
int l
1116 return supports_DfDp_mp_[l];
1120 template<
class Scalar>
1121 const ModelEvaluatorBase::DerivativeSupport&
1122 ModelEvaluatorBase::OutArgs<Scalar>::supports(
1123 EOutArgsDgDx_dot_mp ,
int j
1127 return supports_DgDx_dot_mp_[j];
1131 template<
class Scalar>
1132 const ModelEvaluatorBase::DerivativeSupport&
1133 ModelEvaluatorBase::OutArgs<Scalar>::supports(
1134 EOutArgsDgDx_mp ,
int j
1138 return supports_DgDx_mp_[j];
1142 template<
class Scalar>
1143 const ModelEvaluatorBase::DerivativeSupport&
1144 ModelEvaluatorBase::OutArgs<Scalar>::supports(
1145 EOutArgsDgDp_mp ,
int j,
int l
1150 return supports_DgDp_mp_[ j*Np() + l ];
1155 template<
class Scalar>
1160 assert_supports(OUT_ARG_f);
1165 template<
class Scalar>
1169 assert_supports(OUT_ARG_f);
1174 template<
class Scalar>
1184 template<
class Scalar>
1193 template<
class Scalar>
1198 assert_supports(OUT_ARG_f_mp);
1203 template<
class Scalar>
1207 assert_supports(OUT_ARG_f_mp);
1212 template<
class Scalar>
1217 assert_supports(OUT_ARG_g_mp,j);
1222 template<
class Scalar>
1226 assert_supports(OUT_ARG_g_mp,j);
1231 template<
class Scalar>
1236 assert_supports(OUT_ARG_W);
1241 template<
class Scalar>
1245 assert_supports(OUT_ARG_W);
1250 template<
class Scalar>
1255 assert_supports(OUT_ARG_W_mp);
1260 template<
class Scalar>
1264 assert_supports(OUT_ARG_W_mp);
1269 template<
class Scalar>
1274 assert_supports(OUT_ARG_W_op);
1279 template<
class Scalar>
1283 assert_supports(OUT_ARG_W_op);
1288 template<
class Scalar>
1293 assert_supports(OUT_ARG_W_prec);
1298 template<
class Scalar>
1302 assert_supports(OUT_ARG_W_prec);
1307 template<
class Scalar>
1311 assert_supports(OUT_ARG_f);
1312 return W_properties_;
1316 template<
class Scalar>
1321 assert_supports(OUT_ARG_DfDp,l,DfDp_l);
1326 template<
class Scalar>
1330 assert_supports(OUT_ARG_DfDp,l);
1335 template<
class Scalar>
1339 assert_supports(OUT_ARG_DfDp,l);
1340 return DfDp_properties_[l];
1344 template<
class Scalar>
1349 assert_supports(OUT_ARG_DfDp_mp,l,DfDp_mp_l);
1350 DfDp_mp_[l] = DfDp_mp_l;
1354 template<
class Scalar>
1358 assert_supports(OUT_ARG_DfDp_mp,l);
1363 template<
class Scalar>
1364 ModelEvaluatorBase::DerivativeProperties
1365 ModelEvaluatorBase::OutArgs<Scalar>::get_DfDp_mp_properties(
int l)
const 1367 assert_supports(OUT_ARG_DfDp_mp,l);
1368 return DfDp_mp_properties_[l];
1372 template<
class Scalar>
1377 assert_supports(OUT_ARG_DgDx_dot,j,DgDx_dot_j);
1378 DgDx_dot_[j] = DgDx_dot_j;
1382 template<
class Scalar>
1386 assert_supports(OUT_ARG_DgDx_dot,j);
1387 return DgDx_dot_[j];
1391 template<
class Scalar>
1395 assert_supports(OUT_ARG_DgDx_dot,j);
1396 return DgDx_dot_properties_[j];
1400 template<
class Scalar>
1405 assert_supports(OUT_ARG_DgDx_dot_mp,j,DgDx_dot_mp_j);
1406 DgDx_dot_mp_[j] = DgDx_dot_mp_j;
1410 template<
class Scalar>
1414 assert_supports(OUT_ARG_DgDx_dot_mp,j);
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 1423 assert_supports(OUT_ARG_DgDx_dot_mp,j);
1424 return DgDx_dot_mp_properties_[j];
1428 template<
class Scalar>
1433 assert_supports(OUT_ARG_DgDx,j,DgDx_j);
1438 template<
class Scalar>
1442 assert_supports(OUT_ARG_DgDx,j);
1447 template<
class Scalar>
1451 assert_supports(OUT_ARG_DgDx,j);
1452 return DgDx_properties_[j];
1456 template<
class Scalar>
1461 assert_supports(OUT_ARG_DgDx_mp,j,DgDx_mp_j);
1462 DgDx_mp_[j] = DgDx_mp_j;
1466 template<
class Scalar>
1470 assert_supports(OUT_ARG_DgDx_mp,j);
1475 template<
class Scalar>
1476 ModelEvaluatorBase::DerivativeProperties
1477 ModelEvaluatorBase::OutArgs<Scalar>::get_DgDx_mp_properties(
int j)
const 1479 assert_supports(OUT_ARG_DgDx_mp,j);
1480 return DgDx_mp_properties_[j];
1484 template<
class Scalar>
1489 assert_supports(OUT_ARG_DgDp,j,l,DgDp_j_l);
1490 DgDp_[ j*Np() + l ] = DgDp_j_l;
1494 template<
class Scalar>
1498 assert_supports(OUT_ARG_DgDp,j,l);
1499 return DgDp_[ j*Np() + l ];
1503 template<
class Scalar>
1507 assert_supports(OUT_ARG_DgDp,j,l);
1508 return DgDp_properties_[ j*Np() + l ];
1512 template<
class Scalar>
1517 assert_supports(OUT_ARG_DgDp_mp,j,l,DgDp_mp_j_l);
1518 DgDp_mp_[ j*Np() + l ] = DgDp_mp_j_l;
1522 template<
class Scalar>
1526 assert_supports(OUT_ARG_DgDp_mp,j,l);
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 1535 assert_supports(OUT_ARG_DgDp_mp,j,l);
1536 return DgDp_mp_properties_[ j*Np() + l ];
1540 template<
class Scalar>
1545 assert_supports(OUT_ARG_hess_vec_prod_f_xx);
1546 hess_vec_prod_f_xx_ = hess_vec_prod_f_xx;
1549 template<
class Scalar>
1554 assert_supports(OUT_ARG_hess_vec_prod_f_xp,l);
1555 hess_vec_prod_f_xp_[l] = hess_vec_prod_f_xp_l;
1558 template<
class Scalar>
1563 assert_supports(OUT_ARG_hess_vec_prod_f_px,l);
1564 hess_vec_prod_f_px_[l] = hess_vec_prod_f_px_l;
1567 template<
class Scalar>
1572 assert_supports(OUT_ARG_hess_vec_prod_f_pp,l1,l2);
1573 hess_vec_prod_f_pp_[ l1*Np() + l2 ] = hess_vec_prod_f_pp_l1_l2;
1576 template<
class Scalar>
1580 assert_supports(OUT_ARG_hess_vec_prod_f_xx);
1581 return hess_vec_prod_f_xx_;
1584 template<
class Scalar>
1588 assert_supports(OUT_ARG_hess_vec_prod_f_xp,l);
1589 return hess_vec_prod_f_xp_[l];
1592 template<
class Scalar>
1596 assert_supports(OUT_ARG_hess_vec_prod_f_px,l);
1597 return hess_vec_prod_f_px_[l];
1600 template<
class Scalar>
1604 assert_supports(OUT_ARG_hess_vec_prod_f_pp,l1,l2);
1605 return hess_vec_prod_f_pp_[ l1*Np() + l2 ];
1609 template<
class Scalar>
1614 assert_supports(OUT_ARG_hess_vec_prod_g_xx,j);
1615 hess_vec_prod_g_xx_[j] = hess_vec_prod_g_xx_j;
1618 template<
class Scalar>
1623 assert_supports(OUT_ARG_hess_vec_prod_g_xp,j,l);
1624 hess_vec_prod_g_xp_[ j*Np() + l ] = hess_vec_prod_g_xp_j_l;
1627 template<
class Scalar>
1632 assert_supports(OUT_ARG_hess_vec_prod_g_px,j,l);
1633 hess_vec_prod_g_px_[ j*Np() + l ] = hess_vec_prod_g_px_j_l;
1636 template<
class Scalar>
1641 assert_supports(OUT_ARG_hess_vec_prod_g_pp,j,l1,l2);
1642 hess_vec_prod_g_pp_[ j*Np()*Np() + l1*Np() + l2 ] = hess_vec_prod_g_pp_j_l1_l2;
1645 template<
class Scalar>
1649 assert_supports(OUT_ARG_hess_vec_prod_g_xx,j);
1650 return hess_vec_prod_g_xx_[j];
1653 template<
class Scalar>
1657 assert_supports(OUT_ARG_hess_vec_prod_g_xp,j,l);
1658 return hess_vec_prod_g_xp_[ j*Np() + l ];
1661 template<
class Scalar>
1665 assert_supports(OUT_ARG_hess_vec_prod_g_px,j,l);
1666 return hess_vec_prod_g_px_[ j*Np() + l ];
1669 template<
class Scalar>
1673 assert_supports(OUT_ARG_hess_vec_prod_g_pp,j,l1,l2);
1674 return hess_vec_prod_g_pp_[ j*Np()*Np() + l1*Np() + l2 ];
1677 template<
class Scalar>
1682 assert_supports(OUT_ARG_hess_f_xx);
1683 hess_f_xx_ = hess_f_xx;
1686 template<
class Scalar>
1691 assert_supports(OUT_ARG_hess_f_xp,l);
1692 hess_f_xp_[l] = hess_f_xp_l;
1695 template<
class Scalar>
1700 assert_supports(OUT_ARG_hess_f_pp,l1,l2);
1701 hess_f_pp_[ l1*Np() + l2 ] = hess_f_pp_l1_l2;
1704 template<
class Scalar>
1708 assert_supports(OUT_ARG_hess_f_xx);
1712 template<
class Scalar>
1716 assert_supports(OUT_ARG_hess_f_xp,l);
1717 return hess_f_xp_[l];
1720 template<
class Scalar>
1724 assert_supports(OUT_ARG_hess_f_pp,l1,l2);
1725 return hess_f_pp_[ l1*Np() + l2 ];
1728 template<
class Scalar>
1733 assert_supports(OUT_ARG_hess_g_xx,j);
1734 hess_g_xx_[j] = hess_g_xx_j;
1737 template<
class Scalar>
1742 assert_supports(OUT_ARG_hess_g_xp,j,l);
1743 hess_g_xp_[ j*Np() + l ] = hess_g_xp_j_l;
1746 template<
class Scalar>
1751 assert_supports(OUT_ARG_hess_g_pp,j,l1,l2);
1752 hess_g_pp_[ j*Np()*Np() + l1*Np() + l2 ] = hess_g_pp_j_l1_l2;
1755 template<
class Scalar>
1759 assert_supports(OUT_ARG_hess_g_xx,j);
1760 return hess_g_xx_[j];
1763 template<
class Scalar>
1767 assert_supports(OUT_ARG_hess_g_xp,j,l);
1768 return hess_g_xp_[ j*Np() + l ];
1771 template<
class Scalar>
1775 assert_supports(OUT_ARG_hess_g_pp,j,l1,l2);
1776 return hess_g_pp_[ j*Np()*Np() + l1*Np() + l2 ];
1779 template<
class Scalar>
1784 assert_supports(OUT_ARG_H_xx);
1788 template<
class Scalar>
1793 assert_supports(OUT_ARG_H_xp,l);
1797 template<
class Scalar>
1802 assert_supports(OUT_ARG_H_pp,l1,l2);
1803 H_pp_[ l1*Np() + l2 ] = H_pp_l1_l2;
1806 template<
class Scalar>
1810 assert_supports(OUT_ARG_H_xx);
1814 template<
class Scalar>
1818 assert_supports(OUT_ARG_H_xp,l);
1822 template<
class Scalar>
1826 assert_supports(OUT_ARG_H_pp,l1,l2);
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());
1868 if ( supports(OUT_ARG_f_mp) || !ignoreUnsupported )
1871 #ifdef HAVE_THYRA_ME_POLYNOMIAL 1873 if ( inputOutArgs.
supports(OUT_ARG_f_poly) &&
nonnull(inputOutArgs.get_f_poly()) ) {
1874 if ( supports(OUT_ARG_f_poly) || !ignoreUnsupported )
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 ) {
1885 if ( supports(OUT_ARG_g_mp,j) || !ignoreUnsupported )
1886 set_g_mp(j,inputOutArgs.
get_g_mp(j));
1891 if ( supports(OUT_ARG_W) || !ignoreUnsupported )
1892 set_W(inputOutArgs.
get_W());
1895 if ( supports(OUT_ARG_W_mp) || !ignoreUnsupported )
1900 if ( supports(OUT_ARG_W_op) || !ignoreUnsupported )
1905 if ( supports(OUT_ARG_W_prec) || !ignoreUnsupported )
1909 for (
int l = 0; l < min_Np; ++l ) {
1910 MEB::Derivative<Scalar> DfDp_l;
1911 if ( !inputOutArgs.
supports(OUT_ARG_DfDp,l).none()
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;
1920 if ( !inputOutArgs.
supports(OUT_ARG_DfDp_mp,l).none()
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;
1931 if ( !inputOutArgs.
supports(OUT_ARG_DgDx_dot,j).none()
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;
1939 if ( !inputOutArgs.
supports(OUT_ARG_DgDx,j).none()
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;
1948 if ( !inputOutArgs.
supports(OUT_ARG_DgDx_dot_mp,j).none()
1949 && !(DgDx_dot_mp_j=inputOutArgs.get_DgDx_dot_mp(j)).isEmpty() )
1951 if( DgDx_dot_mp_j.isSupportedBy(supports(OUT_ARG_DgDx_dot_mp,j)) || !ignoreUnsupported )
1952 set_DgDx_dot_mp(j,DgDx_dot_mp_j);
1955 MEB::MPDerivative DgDx_mp_j;
1956 if ( !inputOutArgs.
supports(OUT_ARG_DgDx_mp,j).none()
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;
1966 if ( !inputOutArgs.
supports(OUT_ARG_DgDp,j,l).none()
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;
1977 if ( !inputOutArgs.
supports(OUT_ARG_DgDp_mp,j,l).none()
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);
1988 if ( supports(OUT_ARG_hess_vec_prod_f_xx) || !ignoreUnsupported )
1991 for (
int l1 = 0; l1 < min_Np; ++l1 ) {
1993 if ( supports(OUT_ARG_hess_vec_prod_f_xp,l1) || !ignoreUnsupported )
1997 if ( supports(OUT_ARG_hess_vec_prod_f_px,l1) || !ignoreUnsupported )
2000 for (
int l2 = 0; l2 < min_Np; ++l2 ) {
2002 if ( supports(OUT_ARG_hess_vec_prod_f_pp,l1,l2) || !ignoreUnsupported )
2009 for (
int j = 0; j < min_Ng; ++j ) {
2011 if ( supports(OUT_ARG_hess_vec_prod_g_xx,j) || !ignoreUnsupported )
2014 for (
int l1 = 0; l1 < min_Np; ++l1 ) {
2016 if ( supports(OUT_ARG_hess_vec_prod_g_xp,j,l1) || !ignoreUnsupported )
2020 if ( supports(OUT_ARG_hess_vec_prod_g_px,j,l1) || !ignoreUnsupported )
2023 for (
int l2 = 0; l2 < min_Np; ++l2 ) {
2025 if ( supports(OUT_ARG_hess_vec_prod_g_pp,j,l1,l2) || !ignoreUnsupported )
2034 if ( supports(OUT_ARG_hess_f_xx) || !ignoreUnsupported )
2037 for (
int l1 = 0; l1 < min_Np; ++l1 ) {
2039 if ( supports(OUT_ARG_hess_f_xp,l1) || !ignoreUnsupported )
2042 for (
int l2 = 0; l2 < min_Np; ++l2 ) {
2044 if ( supports(OUT_ARG_hess_f_pp,l1,l2) || !ignoreUnsupported )
2051 for (
int j = 0; j < min_Ng; ++j ) {
2053 if ( supports(OUT_ARG_hess_g_xx,j) || !ignoreUnsupported )
2056 for (
int l1 = 0; l1 < min_Np; ++l1 ) {
2058 if ( supports(OUT_ARG_hess_g_xp,j,l1) || !ignoreUnsupported )
2061 for (
int l2 = 0; l2 < min_Np; ++l2 ) {
2063 if ( supports(OUT_ARG_hess_g_pp,j,l1,l2) || !ignoreUnsupported )
2072 if ( supports(OUT_ARG_H_xx) || !ignoreUnsupported )
2075 for (
int l1 = 0; l1 < min_Np; ++l1 ) {
2077 if ( supports(OUT_ARG_H_xp,l1) || !ignoreUnsupported )
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>
2100 if( this->supports(OUT_ARG_f) &&
nonnull(this->get_f()) ) {
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>
2157 for (
int outArg_i = 0; outArg_i < NUM_E_OUT_ARGS_MEMBERS; ++outArg_i ) {
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();
2177 if (supports(OUT_ARG_f)) {
2178 for (
int l = 0; l < l_Np; ++l ) {
2180 !supports(OUT_ARG_DfDp,l).isSameSupport(outArgs.
supports(OUT_ARG_DfDp,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 ) {
2193 !supports(OUT_ARG_DgDx_dot,j).isSameSupport(outArgs.
supports(OUT_ARG_DgDx_dot,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!" 2202 !supports(OUT_ARG_DgDx,j).isSameSupport(outArgs.
supports(OUT_ARG_DgDx,j)),
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 ) {
2212 !supports(OUT_ARG_DgDp,j,l).isSameSupport(outArgs.
supports(OUT_ARG_DgDp,j,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;
2267 out = Teuchos::rcp(&out_arg,
false);
2270 *out <<
"Thyra::ModelEvaluatorBase::OutArgs<"<<ST::name()<<
">:\n";
2273 *out <<
"model = " << modelEvalDescription_ <<
"\n";
2274 *out <<
"Np = " << Np() <<
"\n";
2275 *out <<
"Ng = " << Ng() <<
"\n";
2278 if (this->supports(OUT_ARG_f) && !
is_null(f=get_f()) ) {
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);
2289 if ( this->supports(OUT_ARG_W) && !
is_null(W=get_W()) ) {
2290 *out <<
"W = " << Teuchos::describe(*W,verbLevel);
2294 if ( this->supports(OUT_ARG_W_op) && !
is_null(W_op=get_W_op()) ) {
2295 *out <<
"W_op = " << Teuchos::describe(*W_op,verbLevel);
2298 for(
int l = 0; l < Np(); ++l ) {
2301 !this->supports(OUT_ARG_DfDp,l).none()
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 ) {
2314 !this->supports(OUT_ARG_DgDx_dot,j).none()
2315 && !(DgDx_dot_j=get_DgDx_dot(j)).isEmpty()
2318 *out <<
"DgDx_dot("<<j<<
") = ";
2319 DgDx_dot_j.describe(*out,verbLevel);
2324 !this->supports(OUT_ARG_DgDx,j).none()
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 ) {
2336 !this->supports(OUT_ARG_DgDp,j,l).none()
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>
2458 int(arg)>=NUM_E_OUT_ARGS_MEMBERS ||
int(arg) < 0,std::logic_error
2459 ,
"model = \'"<<modelEvalDescription_
2460 <<
"\': Error, arg="<<
toString(arg)<<
" is invalid!" 2462 supports_[arg] = supports_in;
2466 template<
class Scalar>
2471 assert_supports(OUT_ARG_f);
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>
2683 EOutArgsDfDp_mp ,
int l,
const DerivativeSupport& supports_in
2686 assert_supports(OUT_ARG_f_mp);
2688 supports_DfDp_mp_[l] = supports_in;
2692 template<
class Scalar>
2693 void ModelEvaluatorBase::OutArgs<Scalar>::_setSupports(
2694 EOutArgsDgDx_dot_mp ,
int j,
const DerivativeSupport& supports_in
2698 supports_DgDx_dot_mp_[j] = supports_in;
2702 template<
class Scalar>
2703 void ModelEvaluatorBase::OutArgs<Scalar>::_setSupports(
2704 EOutArgsDgDx_mp ,
int j,
const DerivativeSupport& supports_in
2708 supports_DgDx_mp_[j] = supports_in;
2712 template<
class Scalar>
2713 void ModelEvaluatorBase::OutArgs<Scalar>::_setSupports(
2714 EOutArgsDgDp_mp ,
int j,
int l,
const DerivativeSupport& supports_in
2719 supports_DgDp_mp_[ j*Np()+ l ] = supports_in;
2723 template<
class Scalar>
2728 W_properties_ = properties;
2732 template<
class Scalar>
2737 assert_supports(OUT_ARG_DfDp,l);
2738 DfDp_properties_[l] = properties;
2742 template<
class Scalar>
2747 assert_supports(OUT_ARG_DgDx_dot,j);
2748 DgDx_dot_properties_[j] = properties;
2752 template<
class Scalar>
2757 assert_supports(OUT_ARG_DgDx,j);
2758 DgDx_properties_[j] = properties;
2762 template<
class Scalar>
2767 assert_supports(OUT_ARG_DgDp,j,l);
2768 DgDp_properties_[ j*Np()+ l ] = properties;
2772 template<
class Scalar>
2777 assert_supports(OUT_ARG_DfDp_mp,l);
2778 DfDp_mp_properties_[l] = properties;
2782 template<
class Scalar>
2784 int j,
const DerivativeProperties &properties
2787 assert_supports(OUT_ARG_DgDx_dot_mp,j);
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
2797 assert_supports(OUT_ARG_DgDx_mp,j);
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
2807 assert_supports(OUT_ARG_DgDp_mp,j,l);
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],
2822 &inputOutArgs.supports_[0] + NUM_E_OUT_ARGS_MEMBERS, &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));
2867 if(this->supports(OUT_ARG_W) || this->supports(OUT_ARG_W_op))
2869 if(this->supports(OUT_ARG_W_mp))
2872 this->_setSupports(MEB::OUT_ARG_hess_vec_prod_f_xx,inputOutArgs.
supports(OUT_ARG_hess_vec_prod_f_xx));
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));
2890 this->_setSupports(MEB::OUT_ARG_hess_f_xx,inputOutArgs.
supports(OUT_ARG_hess_f_xx));
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));
2906 this->_setSupports(MEB::OUT_ARG_H_xx,inputOutArgs.
supports(OUT_ARG_H_xx));
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>
2956 this->_setSupports(OUT_ARG_W,
false);
2957 this->_setSupports(OUT_ARG_W_op,
false);
2958 this->_setSupports(OUT_ARG_f_poly,
false);
2959 const int l_Np = this->Np();
2960 for(
int l = 0; l < l_Np; ++l )
2964 case OUT_ARG_f_mp: {
2965 this->_setSupports(OUT_ARG_W_mp,
false);
2966 this->_setSupports(OUT_ARG_W_op,
false);
2967 this->_setSupports(OUT_ARG_f_poly,
false);
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(
3057 EOutArgsDgDx_dot arg,
int j,
const Derivative<Scalar> &deriv
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(
3108 EOutArgs_hess_vec_prod_f_xx arg
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(
3122 EOutArgs_hess_vec_prod_f_xp arg,
int l
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(
3136 EOutArgs_hess_vec_prod_f_px arg,
int l
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(
3150 EOutArgs_hess_vec_prod_f_pp arg,
int l1,
int l2
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(
3164 EOutArgs_hess_vec_prod_g_xx arg,
int j
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(
3178 EOutArgs_hess_vec_prod_g_xp arg,
int j,
int l
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(
3192 EOutArgs_hess_vec_prod_g_px arg,
int j,
int l
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(
3206 EOutArgs_hess_vec_prod_g_pp arg,
int j,
int l1,
int l2
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(
3220 EOutArgs_hess_f_xx arg
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(
3234 EOutArgs_hess_f_xp arg,
int l
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(
3248 EOutArgs_hess_f_pp arg,
int l1,
int l2
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(
3262 EOutArgs_hess_g_xx arg,
int j
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(
3276 EOutArgs_hess_g_xp arg,
int j,
int l
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(
3290 EOutArgs_hess_g_pp arg,
int j,
int l1,
int l2
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(
3318 EOutArgs_H_xp arg,
int l
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(
3332 EOutArgs_H_pp arg,
int l1,
int l2
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(
3347 EOutArgs_g_mp ,
int j
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(
3363 EOutArgsDfDp_mp arg,
int l,
const MPDerivative &deriv
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(
3380 EOutArgsDgDx_dot_mp arg,
int j,
const MPDerivative &deriv
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(
3397 EOutArgsDgDx_mp arg,
int j,
const MPDerivative &deriv
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(
3414 EOutArgsDgDp_mp arg,
int j,
int l,
const MPDerivative &deriv
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 Protected subclass of InArgs that only ModelEvaluator subclasses can access to set up the selection o...
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.
int Ng() const
Return the number of axillary response functions g(j)(...) supported (Ng >= 0).
RCP< const Stokhos::ProductEpetraVector > get_x_dot_mp() const
Precondition: supports(IN_ARG_x_dotmp)==true.
Scalar get_step_size() const
Precondition: supports(IN_ARG_step_size)==true.
void set_DgDx_properties(int j, const DerivativeProperties &properties)
std::string modelEvalDescription() const
RCP< LinearOpWithSolveBase< Scalar > > get_W() const
Precondition: supports(OUT_ARG_W)==true.
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)
std::string description() const
EOutArgs_hess_vec_prod_f_pp
basic_OSTab< char > OSTab
bool supports(EInArgsMembers arg) const
Determines if an input argument is supported or not.
Concrete aggregate class for all output arguments computable by a ModelEvaluator subclass object...
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).
RCP< LinearOpBase< Scalar > > get_hess_g_xx(int j) const
Precondition: supports(OUT_ARG_hess_g_xx,j)==true.
void setModelEvalDescription(const std::string &modelEvalDescription)
EOutArgs_hess_vec_prod_f_xp
void assign(const Ptr< MultiVectorBase< Scalar > > &V, Scalar alpha)
V = alpha.
RCP< MultiVectorBase< Scalar > > get_hess_vec_prod_f_px(int l) const
Precondition: supports(OUT_ARG_hess_vec_prod_f_px,l)==true.
Derivative< Scalar > get_DfDp(int l) const
Precondition: supports(OUT_ARG_DfDp,l)==true.
Scalar get_beta() const
Precondition: supports(IN_ARG_beta)==true.
void set_Np_Ng(int Np, int Ng)
Derivative< Scalar > get_DgDp(int j, int l) const
Precondition: supports(OUT_ARG_DgDp,j,l)==true.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Simple aggregate class that stores a derivative object as a general linear operator or as a multi-vec...
Scalar get_stage_number() const
Precondition: supports(IN_ARG_stage_number)==true.
RCP< const VectorBase< Scalar > > get_x() const
Precondition: supports(IN_ARG_x)==true.
RCP< LinearOpBase< Scalar > > get_hess_f_pp(int l1, int l2) const
Precondition: supports(OUT_ARG_hess_f_pp,l1,l2)==true.
RCP< MultiVectorBase< Scalar > > get_hess_vec_prod_g_xx(int j) const
Precondition: supports(OUT_ARG_hess_vec_prod_g_xx,j)==true.
RCP< LinearOpBase< Scalar > > get_hess_g_xp(int j, int l) const
Precondition: supports(OUT_ARG_hess_g_xp,j,l)==true.
DerivativeProperties get_DfDp_properties(int l) const
Return the know properties of DfDp(l) (precondition: supports(OUT_ARG_DfDp,l)==true).
RCP< const MultiVectorBase< Scalar > > get_x_direction() const
Precondition: supports(IN_ARG_x)==true.
RCP< const Stokhos::ProductEpetraVector > get_x_mp() const
Precondition: supports(IN_ARG_x_mp)==true.
Derivative< Scalar > get_DgDx(int j) const
Precondition: supports(OUT_ARG_DgDx,j)==true.
Simple interface class to access a precreated preconditioner as one or more linear operators objects ...
Scalar get_alpha() const
Precondition: supports(IN_ARG_alpha)==true.
RCP< Stokhos::ProductEpetraVector > get_f_mp() const
Precondition: supports(OUT_ARG_f_mp)==true.
ScalarMag get_t() const
.Precondition: supports(IN_ARG_t)==true
Simple aggregate class for a derivative object represented as a column-wise multi-vector or its trans...
RCP< LinearOpBase< Scalar > > get_H_pp(int l1, int l2) const
Precondition: supports(OUT_ARG_H_pp,l1,l2)==true.
RCP< const VectorBase< Scalar > > get_p(int l) const
Get p(l) where 0 <= l && l < this->Np().
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 set_W_properties(const DerivativeProperties &properties)
Derivative< Scalar > get_DgDx_dot(int j) const
Precondition: supports(OUT_ARG_DgDx_dot,j)==true.
void setSupports(EInArgsMembers arg, bool supports=true)
RCP< LinearOpBase< Scalar > > get_hess_f_xp(int l) const
Precondition: supports(OUT_ARG_hess_f_xp,l)==true.
void setUnsupportsAndRelated(EInArgsMembers arg)
Interface for a collection of column vectors called a multi-vector.
Scalar get_W_x_dot_dot_coeff() const
Precondition: supports(IN_ARG_W_x_dot_dot_coeff)==true.
void setUnsupportsAndRelated(EInArgsMembers arg)
RCP< const VectorBase< Scalar > > get_x_dot() const
Precondition: supports(IN_ARG_x_dot)==true.
void set_DgDp_properties(int j, int l, const DerivativeProperties &properties)
RCP< LinearOpBase< Scalar > > get_H_xp(int l) const
Precondition: supports(OUT_ARG_H_xp,l)==true.
Teuchos::ScalarTraits< double >::magnitudeType ScalarMag
EOutArgs_hess_vec_prod_f_xx
RCP< PreconditionerBase< Scalar > > get_W_prec() const
Precondition: supports(OUT_ARG_W_op)==true.
void setHessianSupports(const bool supports=true)
std::string modelEvalDescription() const
bool supports(EOutArgsMembers arg) const
Determine if an input argument is supported or not.
Abstract interface for finite-dimensional dense vectors.
void set_Np_Ng(int Np, int Ng)
RCP< const MultiVectorBase< Scalar > > get_p_direction(int l) const
Get p(l) where 0 <= l && l < this->Np().
Simple public strict containing properties of a derivative object.
RCP< Stokhos::ProductEpetraOperator > get_W_mp() const
Precondition: supports(OUT_ARG_W_mp)==true.
Evaluation< VectorBase< Scalar > > get_g(int j) const
Precondition: supports(OUT_ARG_g)==true..
Base class for all linear operators.
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)
RCP< MultiVectorBase< Scalar > > get_hess_vec_prod_f_xp(int l) const
Precondition: supports(OUT_ARG_hess_vec_prod_f_xp,l)==true.
EOutArgs_hess_vec_prod_g_pp
EOutArgs_hess_vec_prod_g_xp
int Ng() const
Return the number of axillary response functions g(j)(...) supported (Ng >= 0).
Base subclass for ModelEvaluator that defines some basic types.
RCP< const VectorBase< Scalar > > get_g_multiplier(int j) const
Precondition: supports(IN_ARG_x)==true.
bool nonnull(const boost::shared_ptr< T > &p)
int Np() const
Return the number of parameter subvectors p(l) supported (Np >= 0).
void setSupports(EOutArgsMembers arg, bool supports=true)
DerivativeProperties get_DgDx_properties(int j) const
Return the know properties of DgDx(j) (precondition: supports(OUT_ARG_DgDx,j)==true).
DerivativeProperties get_DgDx_dot_properties(int j) const
Return the know properties of DgDx_dot(j) (precondition: supports(OUT_ARG_DgDx_dot,j)==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.
RCP< LinearOpBase< Scalar > > get_W_op() const
Precondition: supports(OUT_ARG_W_op)==true.
Evaluation< VectorBase< Scalar > > get_f() const
Precondition: supports(OUT_ARG_f)==true.
RCP< MultiVectorBase< Scalar > > get_hess_vec_prod_f_xx() const
Precondition: supports(OUT_ARG_hess_vec_prod_f_xx)==true.
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.
RCP< const VectorBase< Scalar > > get_f_multiplier() const
Precondition: supports(IN_ARG_x)==true.
EOutArgs_hess_vec_prod_g_px
Teuchos::ScalarTraits< Scalar >::magnitudeType norm(const VectorBase< Scalar > &v)
Natural norm: result = sqrt(<v,v>).
Determines the forms of a general derivative that are supported.
RCP< const VectorBase< Scalar > > get_x_dot_dot() const
Precondition: supports(IN_ARG_x_dot_dot)==true.
#define TEUCHOS_ASSERT_EQUALITY(val1, val2)
RCP< LinearOpBase< Scalar > > get_H_xx() const
Precondition: supports(OUT_ARG_H_xx)==true.
std::string description() const
void setModelEvalDescription(const std::string &modelEvalDescription)
Type to embed evaluation accuracy with an RCP-managed object.
EOutArgs_hess_vec_prod_g_xx
Simple aggregate class that stores a derivative object as a general linear operator or as a multi-vec...
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_xx() const
Precondition: supports(OUT_ARG_hess_f_xx)==true.
RCP< Stokhos::ProductEpetraVector > get_g_mp(int j) const
Precondition: supports(OUT_ARG_g_mp)==true..
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
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).
int Np() const
Return the number of parameter subvectors p(l) supported (Np >= 0).
EOutArgs_hess_vec_prod_f_px
Concrete aggregate class for all input arguments computable by a ModelEvaluator subclass object...