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();
73 RCP<const Stokhos::ProductEpetraVector >
75 const RCP<const Stokhos::ProductEpetraVector > &vec,
81 printf(
"Warning: clone_v not implemented for ProductEpetraVector: %s %d\n",__FILE__,__LINE__);
95 template<
class Scalar>
97 :modelEvalDescription_(
"WARNING! THIS INARGS OBJECT IS UNINITIALIZED!")
105 step_size_ = ST::zero();
106 stage_number_ = ST::one();
110 template<
class Scalar>
112 {
return p_.size(); }
114 template<
class Scalar>
119 ,
"model = \'"<<modelEvalDescription_
120 <<
"\': Error, arg="<<
toString(arg)<<
" is invalid!"
122 return supports_[arg];
125 template<
class Scalar>
129 return supports_p_mp_[l];
132 template<
class Scalar>
138 template<
class Scalar>
143 template<
class Scalar>
150 template<
class Scalar>
156 template<
class Scalar>
160 { assert_supports(
IN_ARG_x); x_ = x; }
163 template<
class Scalar>
166 { assert_supports(
IN_ARG_x);
return x_; }
169 template<
class Scalar>
176 template<
class Scalar>
182 template<
class Scalar>
189 template<
class Scalar>
195 #ifdef HAVE_THYRA_ME_POLYNOMIAL
197 template<
class Scalar>
204 template<
class Scalar>
210 template<
class Scalar>
211 void ModelEvaluatorBase::InArgs<Scalar>::set_x_poly(
217 template<
class Scalar>
218 RCP<const Teuchos::Polynomial< VectorBase<Scalar> > >
219 ModelEvaluatorBase::InArgs<Scalar>::get_x_poly()
const
223 #endif // HAVE_THYRA_ME_POLYNOMIAL
225 template<
class Scalar>
229 { assert_l(l); p_[l] = p_l; }
232 template<
class Scalar>
235 { assert_l(l);
return p_[l]; }
238 template<
class Scalar>
242 { assert_supports(
IN_ARG_p_mp, l); p_mp_[l] = p_mp_l; }
244 template<
class Scalar>
247 { assert_supports(
IN_ARG_p_mp, l);
return p_mp_[l]; }
250 template<
class Scalar>
252 { assert_supports(
IN_ARG_t); t_ = t; }
255 template<
class Scalar>
258 { assert_supports(
IN_ARG_t);
return t_; }
261 template<
class Scalar>
266 template<
class Scalar>
271 template<
class Scalar>
276 template<
class Scalar>
280 template<
class Scalar>
285 template<
class Scalar>
289 template<
class Scalar>
293 template<
class Scalar>
297 template<
class Scalar>
302 template<
class Scalar>
307 template<
class Scalar>
309 const InArgs<Scalar>& inArgs,
bool ignoreUnsupported,
bool cloneObjects
312 using ModelEvaluatorHelperPack::condCloneVec;
313 using ModelEvaluatorHelperPack::condCloneVec_mp;
316 set_x_dot_dot(condCloneVec(inArgs.
get_x_dot_dot(),cloneObjects));
320 set_x_dot(condCloneVec(inArgs.
get_x_dot(),cloneObjects));
324 set_x_dot_mp(condCloneVec_mp(inArgs.
get_x_dot_mp(),cloneObjects));
327 if(supports(
IN_ARG_x) || !ignoreUnsupported)
328 set_x(condCloneVec(inArgs.
get_x(),cloneObjects));
332 set_x_mp(condCloneVec_mp(inArgs.
get_x_mp(),cloneObjects));
334 #ifdef HAVE_THYRA_ME_POLYNOMIAL
338 cloneObjects &&
"Have not implemented cloning for x_dot_poly yet!" );
339 set_x_dot_poly(inArgs.get_x_dot_poly());
345 cloneObjects &&
"Have not implemented cloning for x_poly yet!" );
346 set_x_poly(inArgs.get_x_poly());
349 #endif // HAVE_THYRA_ME_POLYNOMIAL
350 const int min_Np = TEUCHOS_MIN(this->Np(),inArgs.
Np());
351 for (
int l = 0; l < min_Np; ++l) {
353 set_p(l,condCloneVec(inArgs.
get_p(l),cloneObjects));
355 for (
int l = 0; l < min_Np; ++l) {
357 if (
nonnull(inArgs.get_p_mp(l)))
358 set_p_mp(l,condCloneVec_mp(inArgs.get_p_mp(l),cloneObjects));
362 if(supports(
IN_ARG_t) || !ignoreUnsupported)
363 set_t(inArgs.
get_t());
386 if (extended_inargs_.size() > 0)
389 "Extended InArgs does not support cloning!");
390 this->extended_inargs_ = inArgs.extended_inargs_;
394 template<
class Scalar>
401 const std::string inArg_name =
toString(inArg_arg);
403 supports(inArg_arg) != inArgs.
supports(inArg_arg), std::logic_error,
404 "Error, the input argument "<<inArg_name<<
" with support "<<inArgs.
supports(inArg_arg)<<
"\n"
405 "in the InArgs object for the model:\n\n"
407 "is not the same the argument "<<inArg_name<<
" with support "<<supports(inArg_arg)<<
"\n"
408 "in the InArgs object for the model:\n\n"
409 " "<<modelEvalDescription()<<
"\n\n"
410 "and these two InArgs objects are not compatible!"
417 template<
class Scalar>
420 return modelEvalDescription_;
424 template<
class Scalar>
428 std::ostringstream oss;
430 <<
"Thyra::ModelEvaluatorBase::InArgs<"<<ST::name()<<
">"
432 <<
"model="<<modelEvalDescription_
439 template<
class Scalar>
447 using Teuchos::describe;
466 *out <<
"Thyra::ModelEvaluatorBase::InArgs<"<<ST::name()<<
">:\n";
469 *out <<
"model = " << modelEvalDescription_ <<
"\n";
470 *out <<
"Np = " << Np() <<
"\n";
474 *out <<
"x_dot_dot = " << Teuchos::describe(*x_dot_dot,x_verbLevel);
476 *out <<
"||x_dot_dot|| = " << norm(*x_dot_dot) << endl;
481 *out <<
"x_dot = " << Teuchos::describe(*x_dot,x_verbLevel);
483 *out <<
"||x_dot|| = " << norm(*x_dot) << endl;
488 *out <<
"x = " << Teuchos::describe(*x,x_verbLevel);
490 *out <<
"||x|| = " << norm(*x) << endl;
494 for(
int l = 0; l < Np(); ++l ) {
496 if ( !
is_null(p_l = this->get_p(l)) ) {
497 *out <<
"p("<<l<<
") = " << Teuchos::describe(*p_l,p_verbLevel);
499 *out <<
"||p("<<l<<
")|| = " << norm(*p_l) << endl;
506 *out <<
"t = " << t_ << endl;
509 *out <<
"alpha = " << alpha_ << endl;
512 *out <<
"beta = " << beta_ << endl;
515 *out <<
"W_x_dot_dot_coeff = " << W_x_dot_dot_coeff_ << endl;
518 *out <<
"step_size = " << step_size_ << endl;
521 *out <<
"stage_number = " << stage_number_ << endl;
528 template<
class Scalar>
530 const std::string &modelEvalDescription_in
533 modelEvalDescription_ = modelEvalDescription_in;
537 template<
class Scalar>
542 supports_p_mp_.resize(Np_in);
546 template<
class Scalar>
553 ,
"model = \'"<<modelEvalDescription_
554 <<
"\': Error, arg="<<
toString(arg)<<
" is invalid!");
555 supports_[arg] = supports_in;
558 template<
class Scalar>
564 supports_p_mp_[l] = supports_in;
568 template<
class Scalar>
574 &inArgs.supports_[0],
576 this->_set_Np( Np_in >= 0 ? Np_in : inArgs.
Np() );
580 template<
class Scalar>
599 true ,std::logic_error,
600 "Error, can not handle args other than IN_ARG_x yet!"
603 this->_setSupports(arg,
false);
607 template<
class Scalar>
613 !supports_[arg], std::logic_error
614 ,
"Thyra::ModelEvaluatorBase::InArgs<"
616 "model = \'"<<modelEvalDescription_<<
"\': Error, "
617 "The argument arg = " <<
toString(arg) <<
" is not supported!"
621 template<
class Scalar>
628 !supports_p_mp_[l], std::logic_error
629 ,
"Thyra::ModelEvaluatorBase::InArgs<"
631 "model = \'"<<modelEvalDescription_<<
"\': Error, "
632 "The argument p_mp(l) with index l = " << l <<
" is not supported!"
637 template<
class Scalar>
638 void ModelEvaluatorBase::InArgs<Scalar>::assert_l(
int l)
const
641 !( 0 <= l && l < Np() ), std::logic_error
642 ,
"Thyra::ModelEvaluatorBase::InArgs<Scalar>::assert_l(l):\n\n"
643 " model = \'"<<modelEvalDescription_<<
"\':\n\n"
644 "Error, The parameter l = " << l <<
" is not in the range [0,"<<Np()<<
")!"
654 template<
class Scalar>
658 std::ostringstream oss;
659 oss <<
"DerivativeMultiVector{";
660 if (
is_null(getMultiVector())) {
665 <<
"multiVec=" << getMultiVector()->description()
666 <<
",orientation=" <<
toString(getOrientation());
673 template<
class Scalar>
679 using Teuchos::describe;
681 out <<
"DerivativeMultiVector\n";
685 <<
describe(*getMultiVector(),verbLevel)
687 <<
toString(getOrientation()) << endl;
704 template<
class Scalar>
709 std::ostringstream oss;
710 oss <<
"Derivative{";
714 else if (!
is_null(getLinearOp())) {
715 oss <<
"linearOp=" << getLinearOp()->description();
718 oss <<
"derivMultiVec=" << getDerivativeMultiVector().description();
725 template<
class Scalar>
731 using Teuchos::describe;
733 out <<
"Derivative:";
737 else if (!
is_null(getLinearOp())) {
740 <<
"linearOp = " <<
describe(*getLinearOp(),verbLevel);
745 <<
"derivMultiVec = ";
746 getDerivativeMultiVector().describe(out,verbLevel);
756 template<
class Scalar>
758 :modelEvalDescription_(
"WARNING! THIS OUTARGS OBJECT IS UNINITIALIZED!"),
763 template<
class Scalar>
765 {
return DfDp_.size(); }
768 template<
class Scalar>
770 {
return g_.size(); }
773 template<
class Scalar>
780 ,
"model = \'"<<modelEvalDescription_
781 <<
"\': Error, arg="<<
toString(arg)<<
" is invalid!"
783 return supports_[arg];
787 template<
class Scalar>
794 return supports_DfDp_[l];
798 template<
class Scalar>
805 return supports_DgDx_dot_[j];
809 template<
class Scalar>
816 return supports_DgDx_[j];
820 template<
class Scalar>
828 return supports_DgDp_[ j*Np() + l ];
832 template<
class Scalar>
839 return supports_g_mp_[j];
842 template<
class Scalar>
849 return supports_DfDp_mp_[l];
853 template<
class Scalar>
854 const ModelEvaluatorBase::DerivativeSupport&
860 return supports_DgDx_dot_mp_[j];
864 template<
class Scalar>
865 const ModelEvaluatorBase::DerivativeSupport&
871 return supports_DgDx_mp_[j];
875 template<
class Scalar>
876 const ModelEvaluatorBase::DerivativeSupport&
883 return supports_DgDp_mp_[ j*Np() + l ];
888 template<
class Scalar>
898 template<
class Scalar>
907 template<
class Scalar>
917 template<
class Scalar>
926 template<
class Scalar>
936 template<
class Scalar>
945 template<
class Scalar>
955 template<
class Scalar>
964 template<
class Scalar>
974 template<
class Scalar>
983 template<
class Scalar>
993 template<
class Scalar>
1002 template<
class Scalar>
1012 template<
class Scalar>
1021 template<
class Scalar>
1031 template<
class Scalar>
1040 template<
class Scalar>
1045 return W_properties_;
1049 template<
class Scalar>
1059 template<
class Scalar>
1068 template<
class Scalar>
1073 return DfDp_properties_[l];
1077 template<
class Scalar>
1083 DfDp_mp_[l] = DfDp_mp_l;
1087 template<
class Scalar>
1096 template<
class Scalar>
1097 ModelEvaluatorBase::DerivativeProperties
1098 ModelEvaluatorBase::OutArgs<Scalar>::get_DfDp_mp_properties(
int l)
const
1101 return DfDp_mp_properties_[l];
1105 template<
class Scalar>
1111 DgDx_dot_[j] = DgDx_dot_j;
1115 template<
class Scalar>
1120 return DgDx_dot_[j];
1124 template<
class Scalar>
1129 return DgDx_dot_properties_[j];
1133 template<
class Scalar>
1139 DgDx_dot_mp_[j] = DgDx_dot_mp_j;
1143 template<
class Scalar>
1148 return DgDx_dot_mp_[j];
1152 template<
class Scalar>
1153 ModelEvaluatorBase::DerivativeProperties
1154 ModelEvaluatorBase::OutArgs<Scalar>::get_DgDx_dot_mp_properties(
int j)
const
1157 return DgDx_dot_mp_properties_[j];
1161 template<
class Scalar>
1171 template<
class Scalar>
1180 template<
class Scalar>
1185 return DgDx_properties_[j];
1189 template<
class Scalar>
1195 DgDx_mp_[j] = DgDx_mp_j;
1199 template<
class Scalar>
1208 template<
class Scalar>
1209 ModelEvaluatorBase::DerivativeProperties
1210 ModelEvaluatorBase::OutArgs<Scalar>::get_DgDx_mp_properties(
int j)
const
1213 return DgDx_mp_properties_[j];
1217 template<
class Scalar>
1223 DgDp_[ j*Np() + l ] = DgDp_j_l;
1227 template<
class Scalar>
1232 return DgDp_[ j*Np() + l ];
1236 template<
class Scalar>
1241 return DgDp_properties_[ j*Np() + l ];
1245 template<
class Scalar>
1251 DgDp_mp_[ j*Np() + l ] = DgDp_mp_j_l;
1255 template<
class Scalar>
1260 return DgDp_mp_[ j*Np() + l ];
1264 template<
class Scalar>
1265 ModelEvaluatorBase::DerivativeProperties
1266 ModelEvaluatorBase::OutArgs<Scalar>::get_DgDp_mp_properties(
int j,
int l)
const
1269 return DgDp_mp_properties_[ j*Np() + l ];
1273 #ifdef HAVE_THYRA_ME_POLYNOMIAL
1276 template<
class Scalar>
1277 void ModelEvaluatorBase::OutArgs<Scalar>::set_f_poly(
1285 template<
class Scalar>
1286 RCP<Teuchos::Polynomial< VectorBase<Scalar> > >
1287 ModelEvaluatorBase::OutArgs<Scalar>::get_f_poly()
const
1293 #endif // HAVE_THYRA_ME_POLYNOMIAL
1296 template<
class Scalar>
1302 const int min_Np = TEUCHOS_MIN(this->Np(),inputOutArgs.
Np());
1303 const int min_Ng = TEUCHOS_MIN(this->Ng(),inputOutArgs.
Ng());
1306 if ( supports(
OUT_ARG_f) || !ignoreUnsupported )
1307 set_f(inputOutArgs.
get_f());
1313 #ifdef HAVE_THYRA_ME_POLYNOMIAL
1317 set_f_poly(inputOutArgs.get_f_poly());
1319 #endif // HAVE_THYRA_ME_POLYNOMIAL
1321 for (
int j = 0; j < min_Ng; ++j ) {
1323 set_g(j,inputOutArgs.
get_g(j));
1325 for (
int j = 0; j < min_Ng; ++j ) {
1328 set_g_mp(j,inputOutArgs.
get_g_mp(j));
1333 if ( supports(
OUT_ARG_W) || !ignoreUnsupported )
1334 set_W(inputOutArgs.
get_W());
1351 for (
int l = 0; l < min_Np; ++l ) {
1352 MEB::Derivative<Scalar> DfDp_l;
1354 && !(DfDp_l=inputOutArgs.
get_DfDp(l)).isEmpty() )
1356 if ( DfDp_l.isSupportedBy(supports(
OUT_ARG_DfDp,l)) || !ignoreUnsupported )
1360 for (
int l = 0; l < min_Np; ++l ) {
1361 MEB::MPDerivative DfDp_mp_l;
1363 && !(DfDp_mp_l=inputOutArgs.get_DfDp_mp(l)).isEmpty() )
1365 if ( DfDp_mp_l.isSupportedBy(supports(
OUT_ARG_DfDp_mp,l)) || !ignoreUnsupported )
1366 set_DfDp_mp(l,DfDp_mp_l);
1370 for (
int j = 0; j < min_Ng; ++j ) {
1372 MEB::Derivative<Scalar> DgDx_dot_j;
1374 && !(DgDx_dot_j=inputOutArgs.
get_DgDx_dot(j)).isEmpty() )
1376 if( DgDx_dot_j.isSupportedBy(supports(
OUT_ARG_DgDx_dot,j)) || !ignoreUnsupported )
1377 set_DgDx_dot(j,DgDx_dot_j);
1380 MEB::Derivative<Scalar> DgDx_j;
1382 && !(DgDx_j=inputOutArgs.
get_DgDx(j)).isEmpty() ) {
1383 if ( DgDx_j.isSupportedBy(supports(
OUT_ARG_DgDx,j)) || !ignoreUnsupported )
1387 for (
int j = 0; j < min_Ng; ++j ) {
1389 MEB::MPDerivative DgDx_dot_mp_j;
1391 && !(DgDx_dot_mp_j=inputOutArgs.get_DgDx_dot_mp(j)).isEmpty() )
1394 set_DgDx_dot_mp(j,DgDx_dot_mp_j);
1397 MEB::MPDerivative DgDx_mp_j;
1399 && !(DgDx_mp_j=inputOutArgs.get_DgDx_mp(j)).isEmpty() ) {
1400 if ( DgDx_mp_j.isSupportedBy(supports(
OUT_ARG_DgDx_mp,j)) || !ignoreUnsupported )
1401 set_DgDx_mp(j,DgDx_mp_j);
1405 for (
int l = 0; l < min_Np; ++l ) {
1406 for (
int j = 0; j < min_Ng; ++j ) {
1407 MEB::Derivative<Scalar> DgDp_j_l;
1409 && !(DgDp_j_l=inputOutArgs.
get_DgDp(j,l)).isEmpty() )
1411 if ( DgDp_j_l.isSupportedBy(supports(
OUT_ARG_DgDp,j,l)) || !ignoreUnsupported )
1412 set_DgDp(j,l,DgDp_j_l);
1416 for (
int l = 0; l < min_Np; ++l ) {
1417 for (
int j = 0; j < min_Ng; ++j ) {
1418 MEB::MPDerivative DgDp_mp_j_l;
1420 && !(DgDp_mp_j_l=inputOutArgs.get_DgDp_mp(j,l)).isEmpty() )
1422 if ( DgDp_mp_j_l.isSupportedBy(supports(
OUT_ARG_DgDp_mp,j,l)) || !ignoreUnsupported )
1423 set_DgDp_mp(j,l,DgDp_mp_j_l);
1428 this->extended_outargs_ = inputOutArgs.extended_outargs_;
1434 template<
class Scalar>
1440 assign(this->get_f().ptr(),ST::nan());
1442 for(
int j = 0; j < this->Ng(); ++j ) {
1444 assign(this->get_g(j).ptr(),ST::nan());
1450 template<
class Scalar>
1457 template<
class Scalar>
1466 for (
int l = 0; l < Np(); ++l ) {
1467 if (!DfDp_[l].isEmpty())
1470 #ifdef HAVE_THYRA_ME_POLYNOMIAL
1473 #endif // HAVE_THYRA_ME_POLYNOMIAL
1474 for (
int j = 0; j < Ng(); ++j ) {
1477 if (!DgDx_dot_[j].isEmpty())
1479 if (!DgDx_[j].isEmpty())
1481 for (
int l = 0; l < Np(); ++l ) {
1482 if (!DgDp_[j*Np()+l].isEmpty())
1490 template<
class Scalar>
1498 const std::string outArg_name =
toString(outArg_arg);
1500 supports(outArg_arg) != outArgs.
supports(outArg_arg), std::logic_error,
1501 "Error, the output argument "<<outArg_name<<
" with support "<<outArgs.
supports(outArg_arg)<<
"\n"
1502 "in the OutArgs object for the model:\n\n"
1504 "is not the same the argument "<<outArg_name<<
" with support "<<supports(outArg_arg)<<
"\n"
1505 "in the OutArgs object for the model:\n\n"
1506 " "<<modelEvalDescription()<<
"\n\n"
1507 "and these two OutArgs objects are not compatible!"
1511 const int l_Np = this->Np();
1512 const int l_Ng = this->Ng();
1517 for (
int l = 0; l < l_Np; ++l ) {
1521 "Error, the support for DfDp("<<l<<
") is not the same for the models\n\n"
1524 " "<<modelEvalDescription()<<
"\n\n"
1525 "and these two OutArgs objects are not compatible!"
1530 for (
int j = 0; j < l_Ng; ++j ) {
1534 "Error, the support for DgDx_dot("<<j<<
") is not the same for the models\n\n"
1537 " "<<modelEvalDescription()<<
"\n\n"
1538 "and these two OutArgs objects are not compatible!"
1543 "Error, the support for DgDx("<<j<<
") is not the same for the models\n\n"
1546 " "<<modelEvalDescription()<<
"\n\n"
1547 "and these two OutArgs objects are not compatible!"
1549 for (
int l = 0; l < l_Np; ++l ) {
1553 "Error, the support for DgDp("<<j<<
","<<l<<
") is not the same for the models\n\n"
1556 " "<<modelEvalDescription()<<
"\n\n"
1557 "and these two OutArgs objects are not compatible!"
1564 template<
class Scalar>
1567 return modelEvalDescription_;
1571 template<
class Scalar>
1575 std::ostringstream oss;
1577 <<
"Thyra::ModelEvaluatorBase::OutArgs<"<<ST::name()<<
">"
1579 <<
"model="<<modelEvalDescription_
1587 template<
class Scalar>
1594 using Teuchos::describe;
1600 typedef MEB::Derivative<Scalar> Deriv;
1609 *out <<
"Thyra::ModelEvaluatorBase::OutArgs<"<<ST::name()<<
">:\n";
1612 *out <<
"model = " << modelEvalDescription_ <<
"\n";
1613 *out <<
"Np = " << Np() <<
"\n";
1614 *out <<
"Ng = " << Ng() <<
"\n";
1618 *out <<
"f = " << Teuchos::describe(*f,verbLevel);
1621 for(
int j = 0; j < Ng(); ++j ) {
1623 if (!
is_null(g_j=this->get_g(j)))
1624 *out <<
"g("<<j<<
") = " << Teuchos::describe(*g_j,verbLevel);
1629 *out <<
"W = " << Teuchos::describe(*W,verbLevel);
1634 *out <<
"W_op = " << Teuchos::describe(*W_op,verbLevel);
1637 for(
int l = 0; l < Np(); ++l ) {
1641 && !(DfDp_l=get_DfDp(l)).isEmpty()
1644 *out <<
"DfDp("<<l<<
") = ";
1645 DfDp_l.describe(*out,verbLevel);
1649 for(
int j = 0; j < Ng(); ++j ) {
1654 && !(DgDx_dot_j=get_DgDx_dot(j)).isEmpty()
1657 *out <<
"DgDx_dot("<<j<<
") = ";
1658 DgDx_dot_j.describe(*out,verbLevel);
1664 && !(DgDx_j=get_DgDx(j)).isEmpty()
1667 *out <<
"DgDx("<<j<<
") = ";
1668 DgDx_j.describe(*out,verbLevel);
1671 for(
int l = 0; l < Np(); ++l ) {
1676 && !(DgDp_j_l=get_DgDp(j,l)).isEmpty()
1679 *out <<
"DgDp("<<j<<
","<<l<<
") = ";
1680 DgDp_j_l.describe(*out,verbLevel);
1694 template<
class Scalar>
1696 const std::string &modelEvalDescription_in
1699 modelEvalDescription_ = modelEvalDescription_in;
1702 template<
class Scalar>
1706 supports_DfDp_.resize(Np_in);
1708 DfDp_properties_.resize(Np_in); std::fill_n(DfDp_properties_.begin(),Np_in,
DerivativeProperties());
1710 supports_DfDp_mp_.resize(Np_in);
1711 DfDp_mp_.resize(Np_in); std::fill_n(DfDp_mp_.begin(),Np_in,
MPDerivative());
1712 DfDp_mp_properties_.resize(Np_in); std::fill_n(DfDp_mp_properties_.begin(),Np_in,
DerivativeProperties());
1715 g_.resize(Ng_in); std::fill_n(g_.begin(),Ng_in,Teuchos::null);
1716 supports_DgDx_dot_.resize(Ng_in);
1718 DgDx_dot_properties_.resize(Ng_in); std::fill_n(DgDx_dot_properties_.begin(),Ng_in,
DerivativeProperties());
1719 supports_DgDx_.resize(Ng_in);
1721 DgDx_properties_.resize(Ng_in); std::fill_n(DgDx_properties_.begin(),Ng_in,
DerivativeProperties());
1723 g_mp_.resize(Ng_in); std::fill_n(g_mp_.begin(),Ng_in,Teuchos::null);
1724 supports_g_mp_.resize(Ng_in);
1725 supports_DgDx_dot_mp_.resize(Ng_in);
1726 DgDx_dot_mp_.resize(Ng_in); std::fill_n(DgDx_dot_mp_.begin(),Ng_in,
MPDerivative());
1727 DgDx_dot_mp_properties_.resize(Ng_in); std::fill_n(DgDx_dot_mp_properties_.begin(),Ng_in,
DerivativeProperties());
1728 supports_DgDx_mp_.resize(Ng_in);
1729 DgDx_mp_.resize(Ng_in); std::fill_n(DgDx_mp_.begin(),Ng_in,
MPDerivative());
1730 DgDx_mp_properties_.resize(Ng_in); std::fill_n(DgDx_mp_properties_.begin(),Ng_in,
DerivativeProperties());
1732 if(Np_in && Ng_in) {
1733 const int NpNg = Np_in*Ng_in;
1734 supports_DgDp_.resize(NpNg);
1736 DgDp_properties_.resize(NpNg); std::fill_n(DgDp_properties_.begin(),NpNg,
DerivativeProperties());
1738 supports_DgDp_mp_.resize(NpNg);
1739 DgDp_mp_.resize(NpNg); std::fill_n(DgDp_mp_.begin(),NpNg,
MPDerivative());
1740 DgDp_mp_properties_.resize(NpNg); std::fill_n(DgDp_mp_properties_.begin(),NpNg,
DerivativeProperties());
1745 template<
class Scalar>
1751 ,
"model = \'"<<modelEvalDescription_
1752 <<
"\': Error, arg="<<
toString(arg)<<
" is invalid!"
1754 supports_[arg] = supports_in;
1758 template<
class Scalar>
1765 supports_DfDp_[l] = supports_in;
1769 template<
class Scalar>
1775 supports_DgDx_dot_[j] = supports_in;
1779 template<
class Scalar>
1785 supports_DgDx_[j] = supports_in;
1789 template<
class Scalar>
1796 supports_DgDp_[ j*Np()+ l ] = supports_in;
1800 template<
class Scalar>
1807 supports_g_mp_[j] = supports_in;
1811 template<
class Scalar>
1818 supports_DfDp_mp_[l] = supports_in;
1822 template<
class Scalar>
1828 supports_DgDx_dot_mp_[j] = supports_in;
1832 template<
class Scalar>
1838 supports_DgDx_mp_[j] = supports_in;
1842 template<
class Scalar>
1849 supports_DgDp_mp_[ j*Np()+ l ] = supports_in;
1853 template<
class Scalar>
1858 W_properties_ = properties;
1862 template<
class Scalar>
1868 DfDp_properties_[l] = properties;
1872 template<
class Scalar>
1878 DgDx_dot_properties_[j] = properties;
1882 template<
class Scalar>
1888 DgDx_properties_[j] = properties;
1892 template<
class Scalar>
1898 DgDp_properties_[ j*Np()+ l ] = properties;
1902 template<
class Scalar>
1908 DfDp_mp_properties_[l] = properties;
1912 template<
class Scalar>
1914 int j,
const DerivativeProperties &properties
1918 DgDx_dot_mp_properties_[j] = properties;
1922 template<
class Scalar>
1923 void ModelEvaluatorBase::OutArgs<Scalar>::_set_DgDx_mp_properties(
1924 int j,
const DerivativeProperties &properties
1928 DgDx_mp_properties_[j] = properties;
1932 template<
class Scalar>
1933 void ModelEvaluatorBase::OutArgs<Scalar>::_set_DgDp_mp_properties(
1934 int j,
int l,
const DerivativeProperties &properties
1938 DgDp_mp_properties_[ j*Np()+ l ] = properties;
1942 template<
class Scalar>
1948 const int l_Np = TEUCHOS_MIN(this->Np(),inputOutArgs.
Np());
1949 const int l_Ng = TEUCHOS_MIN(this->Ng(),inputOutArgs.
Ng());
1951 &inputOutArgs.supports_[0],
1953 for(
int l = 0; l < l_Np; ++l ) {
1956 this->_setSupports(MEB::OUT_ARG_DfDp,l,ds);
1960 for(
int l = 0; l < l_Np; ++l ) {
1963 this->_setSupports(MEB::OUT_ARG_DfDp_mp,l,ds);
1964 this->_set_DfDp_mp_properties(l,inputOutArgs.get_DfDp_mp_properties(l));
1967 for(
int j = 0; j < l_Ng; ++j ) {
1969 this->_setSupports(MEB::OUT_ARG_DgDx_dot,j,ds);
1972 for(
int j = 0; j < l_Ng; ++j ) {
1974 this->_setSupports(MEB::OUT_ARG_DgDx_dot_mp,j,ds);
1975 if(!ds.
none()) this->_set_DgDx_dot_mp_properties(j,inputOutArgs.get_DgDx_dot_mp_properties(j));
1977 for(
int j = 0; j < l_Ng; ++j ) {
1979 this->_setSupports(MEB::OUT_ARG_DgDx,j,ds);
1982 for(
int j = 0; j < l_Ng; ++j ) {
1984 this->_setSupports(MEB::OUT_ARG_DgDx_mp,j,ds);
1985 if(!ds.
none()) this->_set_DgDx_mp_properties(j,inputOutArgs.get_DgDx_mp_properties(j));
1987 for(
int j = 0; j < l_Ng; ++j )
for(
int l = 0; l < l_Np; ++l ) {
1989 this->_setSupports(MEB::OUT_ARG_DgDp,j,l,ds);
1992 for(
int j = 0; j < l_Ng; ++j )
for(
int l = 0; l < l_Np; ++l ) {
1994 this->_setSupports(MEB::OUT_ARG_DgDp_mp,j,l,ds);
1995 if(!ds.
none()) this->_set_DgDp_mp_properties(j,l,inputOutArgs.get_DgDp_mp_properties(j,l));
2002 extended_outargs_ = inputOutArgs.extended_outargs_;
2006 template<
class Scalar>
2013 const int l_Ng = this->Ng();
2014 for(
int j = 0; j < l_Ng; ++j ) {
2021 const int l_Ng = this->Ng();
2022 for(
int j = 0; j < l_Ng; ++j ) {
2030 true ,std::logic_error,
2031 "Error, can not handle args other than IN_ARG_x yet!"
2037 template<
class Scalar>
2047 const int l_Np = this->Np();
2048 for(
int l = 0; l < l_Np; ++l )
2056 const int l_Np = this->Np();
2057 for(
int l = 0; l < l_Np; ++l )
2063 true ,std::logic_error,
2064 "Error, can not handle args other than OUT_ARG_f yet!"
2067 this->_setSupports(arg,
false);
2074 template<
class Scalar>
2078 !this->supports(arg), std::logic_error
2079 ,
"Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(arg):\n\n"
2080 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
2081 "Error, The argument arg = " <<
toString(arg) <<
" is not supported!"
2086 template<
class Scalar>
2088 EOutArgsDfDp arg,
int l,
const Derivative<Scalar> &deriv
2091 const DerivativeSupport derivSupport = this->supports(arg,l);
2093 !deriv.isSupportedBy(derivSupport), std::logic_error,
2094 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_DfDp,l):\n\n"
2095 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
2096 "Error, The argument DfDp("<<l<<
") = " << deriv.description() <<
"\n"
2097 "is not supported!\n\n"
2098 "The supported types include " << derivSupport.description() <<
"!"
2103 template<
class Scalar>
2104 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
2108 const DerivativeSupport derivSupport = this->supports(arg,j);
2110 !deriv.isSupportedBy(derivSupport), std::logic_error,
2111 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_DgDx_dot,j):\n\n"
2112 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
2113 "Error, The argument DgDx_dot("<<j<<
") = " << deriv.description() <<
"\n"
2114 "is not supported!\n\n"
2115 "The supported types include " << derivSupport.description() <<
"!"
2120 template<
class Scalar>
2121 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
2122 EOutArgsDgDx arg,
int j,
const Derivative<Scalar> &deriv
2125 const DerivativeSupport derivSupport = this->supports(arg,j);
2127 !deriv.isSupportedBy(derivSupport), std::logic_error,
2128 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_DgDx,j):\n\n"
2129 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
2130 "Error, The argument DgDx("<<j<<
") = " << deriv.description() <<
"\n"
2131 "is not supported!\n\n"
2132 "The supported types include " << derivSupport.description() <<
"!"
2137 template<
class Scalar>
2138 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
2139 EOutArgsDgDp arg,
int j,
int l,
const Derivative<Scalar> &deriv
2142 const DerivativeSupport derivSupport = this->supports(arg,j,l);
2144 !deriv.isSupportedBy(derivSupport), std::logic_error,
2145 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_DgDp,j,l):\n\n"
2146 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
2147 "Error, The argument DgDp("<<j<<
","<<l<<
") = " << deriv.description() <<
"\n"
2148 "is not supported!\n\n"
2149 "The supported types include " << derivSupport.description() <<
"!"
2154 template<
class Scalar>
2155 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
2161 !supports_g_mp_[j], std::logic_error,
2162 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_g_mp,j):\n\n"
2163 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
2164 "Error, The argument g_mp("<<j<<
") \n"
2165 "is not supported!\n\n"
2170 template<
class Scalar>
2171 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
2175 const DerivativeSupport derivSupport = this->supports(arg,l);
2177 !deriv.isSupportedBy(derivSupport), std::logic_error,
2178 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_DfDp_mp,l):\n\n"
2179 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
2180 "Error, The argument DfDp_mp("<<l<<
") = " << deriv.description() <<
"\n"
2181 "is not supported!\n\n"
2182 "The supported types include " << derivSupport.description() <<
"!"
2187 template<
class Scalar>
2188 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
2192 const DerivativeSupport derivSupport = this->supports(arg,j);
2194 !deriv.isSupportedBy(derivSupport), std::logic_error,
2195 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_DgDx_dot_mp,j):\n\n"
2196 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
2197 "Error, The argument DgDx_dot_mp("<<j<<
") = " << deriv.description() <<
"\n"
2198 "is not supported!\n\n"
2199 "The supported types include " << derivSupport.description() <<
"!"
2204 template<
class Scalar>
2205 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
2209 const DerivativeSupport derivSupport = this->supports(arg,j);
2211 !deriv.isSupportedBy(derivSupport), std::logic_error,
2212 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_DgDx_mp,j):\n\n"
2213 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
2214 "Error, The argument DgDx_mp("<<j<<
") = " << deriv.description() <<
"\n"
2215 "is not supported!\n\n"
2216 "The supported types include " << derivSupport.description() <<
"!"
2221 template<
class Scalar>
2222 void ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(
2226 const DerivativeSupport derivSupport = this->supports(arg,j,l);
2228 !deriv.isSupportedBy(derivSupport), std::logic_error,
2229 "Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_supports(OUT_ARG_DgDp_mp,j,l):\n\n"
2230 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
2231 "Error, The argument DgDp_mp("<<j<<
","<<l<<
") = " << deriv.description() <<
"\n"
2232 "is not supported!\n\n"
2233 "The supported types include " << derivSupport.description() <<
"!"
2238 template<
class Scalar>
2239 void ModelEvaluatorBase::OutArgs<Scalar>::assert_l(
int l)
const
2242 !( 0 <= l && l < Np() ), std::logic_error
2243 ,
"Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_l(l):\n\n"
2244 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
2245 "Error, The parameter subvector p("<<l<<
")"
2246 " is not in the range [0,"<<Np()<<
")!"
2251 template<
class Scalar>
2252 void ModelEvaluatorBase::OutArgs<Scalar>::assert_j(
int j)
const
2255 !( 0 <= j && j < Ng() ), std::logic_error
2256 ,
"Thyra::ModelEvaluatorBase::OutArgs<Scalar>::assert_j(j):\n\n"
2257 "model = \'"<<modelEvalDescription_<<
"\':\n\n"
2258 "Error, The auxiliary function g("<<j<<
")"
2259 " is not in the range [0,"<<Ng()<<
")!"
2269 template<
class Scalar>
2274 template<
class Scalar>
2280 template<
class Scalar>
2282 const std::string &modelEvalDescription_in )
2284 this->_setModelEvalDescription(modelEvalDescription_in);
2288 template<
class Scalar>
2290 { this->_set_Np(Np_in); }
2293 template<
class Scalar>
2295 { this->_setSupports(arg,supports_in); }
2298 template<
class Scalar>
2300 { this->_setSupports(arg,l,supports_in); }
2303 template<
class Scalar>
2308 this->_setSupports(inArgs, Np_in);
2312 template<
class Scalar>
2317 this->_setUnsupportsAndRelated(arg);
2326 template<
class Scalar>
2331 template<
class Scalar>
2335 :
OutArgs<Scalar>(inputOutArgs)
2339 template<
class Scalar>
2341 const std::string &modelEvalDescription_in
2343 { this->_setModelEvalDescription(modelEvalDescription_in); }
2346 template<
class Scalar>
2348 { this->_set_Np_Ng(Np_in, Ng_in); }
2351 template<
class Scalar>
2355 { this->_setSupports(arg,supports_in); }
2358 template<
class Scalar>
2362 { this->_setSupports(arg,l,supports_in); }
2365 template<
class Scalar>
2369 { this->_setSupports(arg,j,supports_in); }
2372 template<
class Scalar>
2376 { this->_setSupports(arg,j,supports_in); }
2379 template<
class Scalar>
2383 { this->_setSupports(arg,j,l,supports_in); }
2386 template<
class Scalar>
2390 { this->_setSupports(arg,j,supports_in); }
2393 template<
class Scalar>
2397 { this->_setSupports(arg,l,supports_in); }
2400 template<
class Scalar>
2404 { this->_setSupports(arg,j,supports_in); }
2407 template<
class Scalar>
2411 { this->_setSupports(arg,j,supports_in); }
2414 template<
class Scalar>
2416 EOutArgsDgDp_mp arg,
int j,
int l,
const DerivativeSupport& supports_in
2418 { this->_setSupports(arg,j,l,supports_in); }
2421 template<
class Scalar>
2425 { this->_set_W_properties(properties); }
2428 template<
class Scalar>
2432 { this->_set_DfDp_properties(l,properties); }
2435 template<
class Scalar>
2439 { this->_set_DgDx_dot_properties(j,properties); }
2442 template<
class Scalar>
2446 { this->_set_DgDx_properties(j,properties); }
2449 template<
class Scalar>
2453 { this->_set_DgDp_properties(j,l,properties); }
2456 template<
class Scalar>
2460 { this->_set_DfDp_mp_properties(l,properties); }
2463 template<
class Scalar>
2465 int j,
const DerivativeProperties &properties
2467 { this->_set_DgDx_dot_mp_properties(j,properties); }
2470 template<
class Scalar>
2471 void ModelEvaluatorBase::OutArgsSetup<Scalar>::set_DgDx_mp_properties(
2472 int j,
const DerivativeProperties &properties
2474 { this->_set_DgDx_mp_properties(j,properties); }
2477 template<
class Scalar>
2478 void ModelEvaluatorBase::OutArgsSetup<Scalar>::set_DgDp_mp_properties(
2479 int j,
int l,
const DerivativeProperties &properties
2481 { this->_set_DgDp_mp_properties(j,l,properties); }
2484 template<
class Scalar>
2488 { this->_setSupports(inputOutArgs); }
2491 template<
class Scalar>
2495 { this->_setUnsupportsAndRelated(arg); }
2498 template<
class Scalar>
2502 { this->_setUnsupportsAndRelated(arg); }
2516 #define THYRA_MODEL_EVALUATOR_BASE_INSTANT(SCALAR) \
2518 template class ModelEvaluatorBase::InArgs<SCALAR >; \
2520 template std::string \
2521 ModelEvaluatorBase::Derivative<SCALAR >::description() const; \
2524 void ModelEvaluatorBase::Derivative<SCALAR >::describe( \
2525 Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel \
2528 template class ModelEvaluatorBase::OutArgs<SCALAR >; \
2530 template class ModelEvaluatorBase::InArgsSetup<SCALAR >; \
2532 template class ModelEvaluatorBase::OutArgsSetup<SCALAR >;
2535 #endif // THYRA_MODEL_EVALUATOR_BASE_DEF_HPP
int Ng() const
Return the number of axillary response functions g(j)(...) supported (Ng >= 0).
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< Stokhos::ProductEpetraVector > get_g_mp(int j) const
Precondition: supports(OUT_ARG_g_mp)==true..
void set_x_dot_dot(const RCP< const VectorBase< Scalar > > &x_dot_dot)
Precondition: supports(IN_ARG_x_dot_dot)==true.
void setArgs(const OutArgs< Scalar > &outArgs, bool ignoreUnsupported=false)
Set all arguments fron outArgs into *this.
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
void setModelEvalDescription(const std::string &modelEvalDescription)
void set_W_mp(const RCP< Stokhos::ProductEpetraOperator > &W_mp)
Precondition: supports(OUT_ARG_W_mp)==true.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
void _set_DgDx_dot_properties(int j, const DerivativeProperties &properties)
void set_W_prec(const RCP< PreconditionerBase< Scalar > > &W_prec)
Precondition: supports(OUT_ARG_W_op)==true.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Create a more detailed description along about this object and the ModelEvaluator that created it...
void set_Np_Ng(int Np, int Ng)
void _setUnsupportsAndRelated(EInArgsMembers arg)
#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...
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.
RCP< const Stokhos::ProductEpetraVector > get_x_mp() const
Precondition: supports(IN_ARG_x_mp)==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.
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)
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)
void setUnsupportsAndRelated(EInArgsMembers arg)
void setArgs(const InArgs< Scalar > &inArgs, bool ignoreUnsupported=false, bool cloneObjects=false)
Set non-null arguments (does not overwrite non-NULLs with NULLs) .
void set_DgDp(int j, int l, const Derivative< Scalar > &DgDp_j_l)
Precondition: supports(OUT_ARG_DgDp,j,l)==true.
void set_DgDp_properties(int j, int l, const DerivativeProperties &properties)
Teuchos::ScalarTraits< Scalar >::magnitudeType ScalarMag
RCP< const Stokhos::ProductEpetraVector > get_x_dot_mp() const
Precondition: supports(IN_ARG_x_dotmp)==true.
std::string description() const
void _setModelEvalDescription(const std::string &modelEvalDescription)
Abstract interface for finite-dimensional dense vectors.
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_x_dot(const RCP< const VectorBase< Scalar > > &x_dot)
Precondition: supports(IN_ARG_x_dot)==true.
Base class for all linear operators.
RCP< Stokhos::ProductEpetraOperator > get_W_mp() const
Precondition: supports(OUT_ARG_W_mp)==true.
DerivativeProperties get_DgDp_properties(int j, int l) const
Return the know properties of DgDp(j,l) (precondition: supports(OUT_ARG_DgDp,j,l)==true).
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.
Base subclass for ModelEvaluator that defines some basic types.
void set_t(ScalarMag t)
Precondition: supports(IN_ARG_t)==true.
void set_x_mp(const RCP< const Stokhos::ProductEpetraVector > &x_mp)
Precondition: supports(IN_ARG_x_mp)==true.
void set_DgDx_dot(int j, const Derivative< Scalar > &DgDx_dot_j)
Precondition: supports(OUT_ARG_DgDx_dot,j)==true.
bool nonnull(const boost::shared_ptr< T > &p)
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.
void _set_DgDp_properties(int j, int l, const DerivativeProperties &properties)
void set_W(const RCP< LinearOpWithSolveBase< Scalar > > &W)
Precondition: supports(OUT_ARG_W)==true.
Scalar get_alpha() const
Precondition: supports(IN_ARG_alpha)==true.
void setFailed() const
Set that the evaluation as a whole failed.
bool supports() const
Determines if an extended output argument of type ObjectType is supported.
Scalar get_stage_number() const
Precondition: supports(IN_ARG_stage_number)==true.
std::string description() const
RCP< Stokhos::ProductEpetraVector > get_f_mp() const
Precondition: supports(OUT_ARG_f_mp)==true.
void set_alpha(Scalar alpha)
Precondition: supports(IN_ARG_alpha)==true.
void _set_W_properties(const DerivativeProperties &properties)
Derivative< Scalar > get_DgDx_dot(int j) const
Precondition: supports(OUT_ARG_DgDx_dot,j)==true.
void set_DfDp(int l, const Derivative< Scalar > &DfDp_l)
Precondition: supports(OUT_ARG_DfDp,l)==true.
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.
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 VectorBase< Scalar > > get_x_dot_dot() const
Precondition: supports(IN_ARG_x_dot_dot)==true.
void set_f(const Evaluation< VectorBase< Scalar > > &f)
Precondition: supports(OUT_ARG_f)==true.
#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.
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.
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
RCP< const VectorBase< Scalar > > get_p(int l) const
Get p(l) where 0 <= l && l < this->Np().
Protected subclass of OutArgs that only ModelEvaluator subclasses can access to set up the selection ...
DerivativeProperties get_W_properties() const
Return the known properties of W (precondition: supports(OUT_ARG_f)==true).
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...