42 #ifndef THYRA_MODEL_EVALUATOR_DEFAULT_BASE_HPP
43 #define THYRA_MODEL_EVALUATOR_DEFAULT_BASE_HPP
45 #include "Thyra_VectorBase.hpp"
47 #include "Thyra_ModelEvaluator.hpp"
48 #include "Thyra_LinearOpWithSolveFactoryHelpers.hpp"
51 #ifdef HAVE_THYRA_ME_POLYNOMIAL
67 #include "Thyra_PolynomialVectorTraits.hpp"
70 #endif // HAVE_THYRA_ME_POLYNOMIAL
83 namespace ModelEvaluatorDefaultBaseTypes {
89 class DefaultDerivLinearOpSupport {
91 DefaultDerivLinearOpSupport()
92 :provideDefaultLinearOp_(false),
93 mvImplOrientation_(ModelEvaluatorBase::DERIV_MV_BY_COL)
95 DefaultDerivLinearOpSupport(
98 :provideDefaultLinearOp_(true),
99 mvImplOrientation_(mvImplOrientation_in)
101 bool provideDefaultLinearOp()
const
102 {
return provideDefaultLinearOp_; }
104 {
return mvImplOrientation_; }
106 bool provideDefaultLinearOp_;
114 class DefaultDerivMvAdjointSupport {
116 DefaultDerivMvAdjointSupport()
117 :provideDefaultAdjoint_(false),
118 mvAdjointCopyOrientation_(ModelEvaluatorBase::DERIV_MV_BY_COL)
120 DefaultDerivMvAdjointSupport(
123 :provideDefaultAdjoint_(true),
124 mvAdjointCopyOrientation_(mvAdjointCopyOrientation_in)
126 bool provideDefaultAdjoint()
const
127 {
return provideDefaultAdjoint_; }
129 {
return mvAdjointCopyOrientation_; }
131 bool provideDefaultAdjoint_;
138 template<
class Scalar>
139 struct MultiVectorAdjointPair {
140 MultiVectorAdjointPair()
142 MultiVectorAdjointPair(
143 const RCP<MultiVectorBase<Scalar> > &in_mvOuter,
144 const RCP<
const MultiVectorBase<Scalar> > &in_mvImplAdjoint
146 : mvOuter(in_mvOuter),
147 mvImplAdjoint(in_mvImplAdjoint)
149 RCP<MultiVectorBase<Scalar> > mvOuter;
150 RCP<const MultiVectorBase<Scalar> > mvImplAdjoint;
187 template<
class Scalar>
268 virtual void evalModelImpl(
285 typedef ModelEvaluatorDefaultBaseTypes::DefaultDerivLinearOpSupport
286 DefaultDerivLinearOpSupport;
288 typedef ModelEvaluatorDefaultBaseTypes::DefaultDerivMvAdjointSupport
289 DefaultDerivMvAdjointSupport;
291 typedef ModelEvaluatorDefaultBaseTypes::MultiVectorAdjointPair<Scalar>
292 MultiVectorAdjointPair;
308 bool default_W_support_;
315 void lazyInitializeDefaultBase()
const;
317 void assert_l(
const int l)
const;
319 void assert_j(
const int j)
const;
324 static DefaultDerivLinearOpSupport
325 determineDefaultDerivLinearOpSupport(
330 createDefaultLinearOp(
331 const DefaultDerivLinearOpSupport &defaultLinearOpSupport,
337 updateDefaultLinearOpSupport(
339 const DefaultDerivLinearOpSupport &defaultLinearOpSupport
343 getOutArgImplForDefaultLinearOpSupport(
345 const DefaultDerivLinearOpSupport &defaultLinearOpSupport
348 static DefaultDerivMvAdjointSupport
349 determineDefaultDerivMvAdjointSupport(
356 updateDefaultDerivMvAdjointSupport(
358 const DefaultDerivMvAdjointSupport &defaultMvAdjointSupport
372 #include "Thyra_ModelEvaluatorHelpers.hpp"
373 #include "Thyra_DefaultScaledAdjointLinearOp.hpp"
374 #include "Thyra_DetachedMultiVectorView.hpp"
375 #include "Teuchos_Assert.hpp"
384 template<
class Scalar>
387 lazyInitializeDefaultBase();
388 return prototypeOutArgs_.Np();
392 template<
class Scalar>
395 lazyInitializeDefaultBase();
396 return prototypeOutArgs_.Ng();
400 template<
class Scalar>
404 lazyInitializeDefaultBase();
405 if (default_W_support_)
406 return this->get_W_factory()->createOp();
407 return Teuchos::null;
411 template<
class Scalar>
415 lazyInitializeDefaultBase();
419 const DefaultDerivLinearOpSupport
420 defaultLinearOpSupport = DfDp_default_op_support_[l];
421 if (defaultLinearOpSupport.provideDefaultLinearOp()) {
422 return createDefaultLinearOp(
423 defaultLinearOpSupport,
428 return this->create_DfDp_op_impl(l);
432 template<
class Scalar>
436 lazyInitializeDefaultBase();
440 const DefaultDerivLinearOpSupport
441 defaultLinearOpSupport = DgDx_dot_default_op_support_[j];
442 if (defaultLinearOpSupport.provideDefaultLinearOp()) {
443 return createDefaultLinearOp(
444 defaultLinearOpSupport,
445 this->get_g_space(j),
449 return this->create_DgDx_dot_op_impl(j);
453 template<
class Scalar>
457 lazyInitializeDefaultBase();
461 const DefaultDerivLinearOpSupport
462 defaultLinearOpSupport = DgDx_default_op_support_[j];
463 if (defaultLinearOpSupport.provideDefaultLinearOp()) {
464 return createDefaultLinearOp(
465 defaultLinearOpSupport,
466 this->get_g_space(j),
470 return this->create_DgDx_op_impl(j);
474 template<
class Scalar>
478 lazyInitializeDefaultBase();
483 const DefaultDerivLinearOpSupport
484 defaultLinearOpSupport = DgDp_default_op_support_[j][l];
485 if (defaultLinearOpSupport.provideDefaultLinearOp()) {
486 return createDefaultLinearOp(
487 defaultLinearOpSupport,
488 this->get_g_space(j),
492 return this->create_DgDp_op_impl(j,l);
496 template<
class Scalar>
500 lazyInitializeDefaultBase();
501 return prototypeOutArgs_;
505 template<
class Scalar>
512 using Teuchos::outArg;
515 lazyInitializeDefaultBase();
517 const int l_Np = outArgs.
Np();
518 const int l_Ng = outArgs.
Ng();
525 assertInArgsEvalObjects(*
this,inArgs);
526 assertOutArgsEvalObjects(*
this,outArgs,&inArgs);
534 MEB::OutArgs<Scalar> outArgsImpl = this->createOutArgsImpl();
539 outArgsImpl.setArgs(outArgs,
true);
542 if (outArgsImpl.supports(MEB::OUT_ARG_f)) {
543 for (
int l = 0; l < l_Np; ++l ) {
544 const DefaultDerivLinearOpSupport defaultLinearOpSupport =
545 DfDp_default_op_support_[l];
546 if (defaultLinearOpSupport.provideDefaultLinearOp()) {
547 outArgsImpl.set_DfDp( l,
548 getOutArgImplForDefaultLinearOpSupport(
549 outArgs.
get_DfDp(l), defaultLinearOpSupport
560 for (
int j = 0; j < l_Ng; ++j ) {
561 const DefaultDerivLinearOpSupport defaultLinearOpSupport =
562 DgDx_dot_default_op_support_[j];
563 if (defaultLinearOpSupport.provideDefaultLinearOp()) {
564 outArgsImpl.set_DgDx_dot( j,
565 getOutArgImplForDefaultLinearOpSupport(
576 for (
int j = 0; j < l_Ng; ++j ) {
577 const DefaultDerivLinearOpSupport defaultLinearOpSupport =
578 DgDx_default_op_support_[j];
579 if (defaultLinearOpSupport.provideDefaultLinearOp()) {
580 outArgsImpl.set_DgDx( j,
581 getOutArgImplForDefaultLinearOpSupport(
582 outArgs.
get_DgDx(j), defaultLinearOpSupport
592 for (
int j = 0; j < l_Ng; ++j ) {
594 DgDp_default_op_support_[j];
596 DgDp_default_mv_support_[j];
597 for (
int l = 0; l < l_Np; ++l ) {
598 const DefaultDerivLinearOpSupport defaultLinearOpSupport =
599 DgDp_default_op_support_j[l];
600 const DefaultDerivMvAdjointSupport defaultMvAdjointSupport =
601 DgDp_default_mv_support_j[l];
602 MEB::Derivative<Scalar> DgDp_j_l;
603 if (!outArgs.
supports(MEB::OUT_ARG_DgDp,j,l).none())
606 defaultLinearOpSupport.provideDefaultLinearOp()
607 && !
is_null(DgDp_j_l.getLinearOp())
610 outArgsImpl.set_DgDp( j, l,
611 getOutArgImplForDefaultLinearOpSupport(
612 DgDp_j_l, defaultLinearOpSupport
617 defaultMvAdjointSupport.provideDefaultAdjoint()
618 && !
is_null(DgDp_j_l.getMultiVector())
622 DgDp_j_l.getMultiVector();
624 defaultMvAdjointSupport.mvAdjointCopyOrientation()
626 DgDp_j_l.getMultiVectorOrientation()
633 createMembers(DgDp_j_l_mv->domain(), DgDp_j_l_mv->range()->dim());
634 outArgsImpl.set_DgDp( j, l,
635 MEB::Derivative<Scalar>(
637 getOtherDerivativeMultiVectorOrientation(
638 defaultMvAdjointSupport.mvAdjointCopyOrientation()
645 MultiVectorAdjointPair(DgDp_j_l_mv, DgDp_j_l_mv_adj)
662 if ( default_W_support_ && !
is_null(W=outArgs.
get_W()) ) {
664 W_factory = this->get_W_factory();
667 uninitializeOp<Scalar>(*W_factory, W.
ptr(), outArg(W_op_const));
679 W_op = this->create_W_op();
681 outArgsImpl.set_W_op(W_op);
691 this->evalModelImpl( inArgs, outArgsImpl );
698 const int numMvAdjointCopies = DgDp_temp_adjoint_copies.
size();
699 for (
int adj_copy_i = 0; adj_copy_i < numMvAdjointCopies; ++adj_copy_i ) {
700 const MultiVectorAdjointPair adjPair =
701 DgDp_temp_adjoint_copies[adj_copy_i];
702 doExplicitMultiVectorAdjoint( *adjPair.mvImplAdjoint, &*adjPair.mvOuter );
708 if ( default_W_support_ && !
is_null(W=outArgs.
get_W()) ) {
710 W_factory = this->get_W_factory();
711 W_factory->setOStream(this->getOStream());
712 W_factory->setVerbLevel(this->getVerbLevel());
713 initializeOp<Scalar>(*W_factory, outArgsImpl.get_W_op().
getConst(), W.
ptr());
725 template<
class Scalar>
732 isInitialized_ =
false;
733 default_W_support_ =
false;
739 const MEB::InArgs<Scalar> inArgs = this->createInArgs();
740 const MEB::OutArgs<Scalar> outArgsImpl = this->createOutArgsImpl();
747 assertInArgsOutArgsSetup( this->description(), inArgs, outArgsImpl );
748 #endif // TEUCHOS_DEBUG
754 const int l_Ng = outArgsImpl.Ng();
755 const int l_Np = outArgsImpl.Np();
758 MEB::OutArgsSetup<Scalar> outArgs;
759 outArgs.setModelEvalDescription(this->description());
760 outArgs.set_Np_Ng(l_Np,l_Ng);
761 outArgs.setSupports(outArgsImpl);
764 DfDp_default_op_support_.clear();
765 if (outArgs.supports(MEB::OUT_ARG_f)) {
766 for (
int l = 0; l < l_Np; ++l ) {
767 const MEB::DerivativeSupport DfDp_l_impl_support =
768 outArgsImpl.supports(MEB::OUT_ARG_DfDp,l);
769 const DefaultDerivLinearOpSupport DfDp_l_op_support =
770 determineDefaultDerivLinearOpSupport(DfDp_l_impl_support);
771 DfDp_default_op_support_.push_back(DfDp_l_op_support);
773 MEB::OUT_ARG_DfDp, l,
774 updateDefaultLinearOpSupport(
775 DfDp_l_impl_support, DfDp_l_op_support
782 DgDx_dot_default_op_support_.clear();
783 for (
int j = 0; j < l_Ng; ++j ) {
784 const MEB::DerivativeSupport DgDx_dot_j_impl_support =
785 outArgsImpl.supports(MEB::OUT_ARG_DgDx_dot,j);
786 const DefaultDerivLinearOpSupport DgDx_dot_j_op_support =
787 determineDefaultDerivLinearOpSupport(DgDx_dot_j_impl_support);
788 DgDx_dot_default_op_support_.push_back(DgDx_dot_j_op_support);
790 MEB::OUT_ARG_DgDx_dot, j,
791 updateDefaultLinearOpSupport(
792 DgDx_dot_j_impl_support, DgDx_dot_j_op_support
798 DgDx_default_op_support_.clear();
799 for (
int j = 0; j < l_Ng; ++j ) {
800 const MEB::DerivativeSupport DgDx_j_impl_support =
801 outArgsImpl.supports(MEB::OUT_ARG_DgDx,j);
802 const DefaultDerivLinearOpSupport DgDx_j_op_support =
803 determineDefaultDerivLinearOpSupport(DgDx_j_impl_support);
804 DgDx_default_op_support_.push_back(DgDx_j_op_support);
806 MEB::OUT_ARG_DgDx, j,
807 updateDefaultLinearOpSupport(
808 DgDx_j_impl_support, DgDx_j_op_support
814 DgDp_default_op_support_.clear();
815 DgDp_default_mv_support_.clear();
816 for (
int j = 0; j < l_Ng; ++j ) {
819 for (
int l = 0; l < l_Np; ++l ) {
820 const MEB::DerivativeSupport DgDp_j_l_impl_support =
821 outArgsImpl.supports(MEB::OUT_ARG_DgDp,j,l);
823 const DefaultDerivLinearOpSupport DgDp_j_l_op_support =
824 determineDefaultDerivLinearOpSupport(DgDp_j_l_impl_support);
825 DgDp_default_op_support_[j].push_back(DgDp_j_l_op_support);
827 MEB::OUT_ARG_DgDp, j, l,
828 updateDefaultLinearOpSupport(
829 DgDp_j_l_impl_support, DgDp_j_l_op_support
833 const DefaultDerivMvAdjointSupport DgDp_j_l_mv_support =
834 determineDefaultDerivMvAdjointSupport(
835 DgDp_j_l_impl_support, *this->get_g_space(j), *this->get_p_space(l)
837 DgDp_default_mv_support_[j].push_back(DgDp_j_l_mv_support);
839 MEB::OUT_ARG_DgDp, j, l,
840 updateDefaultDerivMvAdjointSupport(
841 outArgs.supports(MEB::OUT_ARG_DgDp, j, l),
851 default_W_support_ =
false;
852 if ( outArgsImpl.supports(MEB::OUT_ARG_W_op) && !
is_null(this->get_W_factory())
853 && !outArgsImpl.supports(MEB::OUT_ARG_W) )
855 default_W_support_ =
true;
856 outArgs.setSupports(MEB::OUT_ARG_W);
857 outArgs.set_W_properties(outArgsImpl.get_W_properties());
864 prototypeOutArgs_ = outArgs;
865 isInitialized_ =
true;
869 template<
class Scalar>
872 isInitialized_ =
false;
878 template<
class Scalar>
883 MEB::OutArgs<Scalar> outArgs = this->createOutArgsImpl();
885 outArgs.supports(MEB::OUT_ARG_DfDp,l).supports(MEB::DERIV_LINEAR_OP),
887 "Error, The ModelEvaluator subclass "<<this->description()<<
" says that it"
888 " supports the LinearOpBase form of DfDp("<<l<<
") (as determined from its"
889 " OutArgs object created by createOutArgsImpl())"
890 " but this function create_DfDp_op_impl(...) has not been overridden"
891 " to create such an object!"
893 return Teuchos::null;
897 template<
class Scalar>
898 RCP<LinearOpBase<Scalar> >
899 ModelEvaluatorDefaultBase<Scalar>::create_DgDx_dot_op_impl(
int j)
const
901 typedef ModelEvaluatorBase MEB;
902 MEB::OutArgs<Scalar> outArgs = this->createOutArgsImpl();
904 outArgs.supports(MEB::OUT_ARG_DgDx_dot,j).supports(MEB::DERIV_LINEAR_OP),
906 "Error, The ModelEvaluator subclass "<<this->description()<<
" says that it"
907 " supports the LinearOpBase form of DgDx_dot("<<j<<
") (as determined from"
908 " its OutArgs object created by createOutArgsImpl())"
909 " but this function create_DgDx_dot_op_impl(...) has not been overridden"
910 " to create such an object!"
912 return Teuchos::null;
916 template<
class Scalar>
917 RCP<LinearOpBase<Scalar> >
918 ModelEvaluatorDefaultBase<Scalar>::create_DgDx_op_impl(
int j)
const
920 typedef ModelEvaluatorBase MEB;
921 MEB::OutArgs<Scalar> outArgs = this->createOutArgsImpl();
923 outArgs.supports(MEB::OUT_ARG_DgDx,j).supports(MEB::DERIV_LINEAR_OP),
925 "Error, The ModelEvaluator subclass "<<this->description()<<
" says that it"
926 " supports the LinearOpBase form of DgDx("<<j<<
") (as determined from"
927 " its OutArgs object created by createOutArgsImpl())"
928 " but this function create_DgDx_op_impl(...) has not been overridden"
929 " to create such an object!"
931 return Teuchos::null;
935 template<
class Scalar>
936 RCP<LinearOpBase<Scalar> >
937 ModelEvaluatorDefaultBase<Scalar>::create_DgDp_op_impl(
int j,
int l)
const
939 typedef ModelEvaluatorBase MEB;
940 MEB::OutArgs<Scalar> outArgs = this->createOutArgsImpl();
942 outArgs.supports(MEB::OUT_ARG_DgDp,j,l).supports(MEB::DERIV_LINEAR_OP),
944 "Error, The ModelEvaluator subclass "<<this->description()<<
" says that it"
945 " supports the LinearOpBase form of DgDp("<<j<<
","<<l<<
")"
946 " (as determined from its OutArgs object created by createOutArgsImpl())"
947 " but this function create_DgDp_op_impl(...) has not been overridden"
948 " to create such an object!"
950 return Teuchos::null;
957 template<
class Scalar>
959 :isInitialized_(false), default_W_support_(false)
966 template<
class Scalar>
974 template<
class Scalar>
975 void ModelEvaluatorDefaultBase<Scalar>::assert_l(
const int l)
const
981 template<
class Scalar>
982 void ModelEvaluatorDefaultBase<Scalar>::assert_j(
const int j)
const
991 template<
class Scalar>
992 ModelEvaluatorDefaultBaseTypes::DefaultDerivLinearOpSupport
993 ModelEvaluatorDefaultBase<Scalar>::determineDefaultDerivLinearOpSupport(
994 const ModelEvaluatorBase::DerivativeSupport &derivSupportImpl
997 typedef ModelEvaluatorBase MEB;
1000 derivSupportImpl.supports(MEB::DERIV_MV_BY_COL)
1002 derivSupportImpl.supports(MEB::DERIV_TRANS_MV_BY_ROW)
1005 !derivSupportImpl.supports(MEB::DERIV_LINEAR_OP)
1008 return DefaultDerivLinearOpSupport(
1009 derivSupportImpl.supports(MEB::DERIV_MV_BY_COL)
1010 ? MEB::DERIV_MV_BY_COL
1011 : MEB::DERIV_TRANS_MV_BY_ROW
1014 return DefaultDerivLinearOpSupport();
1018 template<
class Scalar>
1019 RCP<LinearOpBase<Scalar> >
1020 ModelEvaluatorDefaultBase<Scalar>::createDefaultLinearOp(
1021 const DefaultDerivLinearOpSupport &defaultLinearOpSupport,
1022 const RCP<
const VectorSpaceBase<Scalar> > &fnc_space,
1023 const RCP<
const VectorSpaceBase<Scalar> > &var_space
1026 using Teuchos::rcp_implicit_cast;
1027 typedef LinearOpBase<Scalar> LOB;
1028 typedef ModelEvaluatorBase MEB;
1029 switch(defaultLinearOpSupport.mvImplOrientation()) {
1030 case MEB::DERIV_MV_BY_COL:
1032 return createMembers(fnc_space, var_space->dim());
1033 case MEB::DERIV_TRANS_MV_BY_ROW:
1035 return nonconstAdjoint<Scalar>(
1036 rcp_implicit_cast<LOB>(createMembers(var_space, fnc_space->dim()))
1038 #ifdef TEUCHOS_DEBUG
1043 return Teuchos::null;
1047 template<
class Scalar>
1048 ModelEvaluatorBase::DerivativeSupport
1049 ModelEvaluatorDefaultBase<Scalar>::updateDefaultLinearOpSupport(
1050 const ModelEvaluatorBase::DerivativeSupport &derivSupportImpl,
1051 const DefaultDerivLinearOpSupport &defaultLinearOpSupport
1054 typedef ModelEvaluatorBase MEB;
1055 MEB::DerivativeSupport derivSupport = derivSupportImpl;
1056 if (defaultLinearOpSupport.provideDefaultLinearOp())
1057 derivSupport.plus(MEB::DERIV_LINEAR_OP);
1058 return derivSupport;
1062 template<
class Scalar>
1063 ModelEvaluatorBase::Derivative<Scalar>
1064 ModelEvaluatorDefaultBase<Scalar>::getOutArgImplForDefaultLinearOpSupport(
1065 const ModelEvaluatorBase::Derivative<Scalar> &deriv,
1066 const DefaultDerivLinearOpSupport &defaultLinearOpSupport
1070 using Teuchos::rcp_dynamic_cast;
1071 typedef ModelEvaluatorBase MEB;
1072 typedef MultiVectorBase<Scalar> MVB;
1073 typedef ScaledAdjointLinearOpBase<Scalar> SALOB;
1078 if (
is_null(deriv.getLinearOp()))
1083 switch(defaultLinearOpSupport.mvImplOrientation()) {
1084 case MEB::DERIV_MV_BY_COL: {
1085 return MEB::Derivative<Scalar>(
1086 rcp_dynamic_cast<MVB>(deriv.getLinearOp(),
true),
1087 MEB::DERIV_MV_BY_COL
1090 case MEB::DERIV_TRANS_MV_BY_ROW: {
1091 return MEB::Derivative<Scalar>(
1092 rcp_dynamic_cast<MVB>(
1093 rcp_dynamic_cast<SALOB>(deriv.getLinearOp(),
true)->getNonconstOrigOp()
1095 MEB::DERIV_TRANS_MV_BY_ROW
1098 #ifdef TEUCHOS_DEBUG
1104 return ModelEvaluatorBase::Derivative<Scalar>();
1109 template<
class Scalar>
1110 ModelEvaluatorDefaultBaseTypes::DefaultDerivMvAdjointSupport
1111 ModelEvaluatorDefaultBase<Scalar>::determineDefaultDerivMvAdjointSupport(
1112 const ModelEvaluatorBase::DerivativeSupport &derivSupportImpl,
1113 const VectorSpaceBase<Scalar> &fnc_space,
1114 const VectorSpaceBase<Scalar> &var_space
1117 typedef ModelEvaluatorBase MEB;
1120 const bool implSupportsMv =
1121 ( derivSupportImpl.supports(MEB::DERIV_MV_BY_COL)
1122 || derivSupportImpl.supports(MEB::DERIV_TRANS_MV_BY_ROW) );
1123 const bool implLacksMvOrientSupport =
1124 ( !derivSupportImpl.supports(MEB::DERIV_MV_BY_COL)
1125 || !derivSupportImpl.supports(MEB::DERIV_TRANS_MV_BY_ROW) );
1126 const bool bothSpacesHaveInCoreViews =
1127 ( fnc_space.hasInCoreView() && var_space.hasInCoreView() );
1128 if ( implSupportsMv && implLacksMvOrientSupport && bothSpacesHaveInCoreViews ) {
1129 return DefaultDerivMvAdjointSupport(
1130 derivSupportImpl.supports(MEB::DERIV_MV_BY_COL)
1131 ? MEB::DERIV_TRANS_MV_BY_ROW
1132 : MEB::DERIV_MV_BY_COL
1136 return DefaultDerivMvAdjointSupport();
1140 template<
class Scalar>
1141 ModelEvaluatorBase::DerivativeSupport
1142 ModelEvaluatorDefaultBase<Scalar>::updateDefaultDerivMvAdjointSupport(
1143 const ModelEvaluatorBase::DerivativeSupport &derivSupportImpl,
1144 const DefaultDerivMvAdjointSupport &defaultMvAdjointSupport
1147 typedef ModelEvaluatorBase MEB;
1148 MEB::DerivativeSupport derivSupport = derivSupportImpl;
1149 if (defaultMvAdjointSupport.provideDefaultAdjoint())
1150 derivSupport.plus(defaultMvAdjointSupport.mvAdjointCopyOrientation());
1151 return derivSupport;
1158 #endif // THYRA_MODEL_EVALUATOR_DEFAULT_BASE_HPP
RCP< const T > getConst() const
int Ng() const
Return the number of axillary response functions g(j)(...) supported (Ng >= 0).
Pure abstract base interface for evaluating a stateless "model" that can be mapped into a number of d...
RCP< LinearOpWithSolveBase< Scalar > > create_W() const
Default base class for concrete model evaluators.
bool is_null(const boost::shared_ptr< T > &p)
RCP< LinearOpBase< Scalar > > create_DfDp_op(int l) const
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.
EDerivativeMultiVectorOrientation
void evalModel(const ModelEvaluatorBase::InArgs< Scalar > &inArgs, const ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
#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...
ModelEvaluatorDefaultBase()
Abstract interface for objects that represent a space for vectors.
bool supports(EOutArgsMembers arg) const
Determine if an input argument is supported or not.
Derivative< Scalar > get_DgDp(int j, int l) const
Precondition: supports(OUT_ARG_DgDp,j,l)==true.
void initializeDefaultBase()
Function called by subclasses to fully initialize this object on any important change.
#define TEUCHOS_ASSERT_IN_RANGE_UPPER_EXCLUSIVE(index, lower_inclusive, upper_exclusive)
int Np() const
Return the number of parameter subvectors p(l) supported (Np >= 0).
RCP< LinearOpBase< Scalar > > create_DgDx_op(int j) const
Base class for all linear operators.
RCP< LinearOpBase< Scalar > > create_DgDx_dot_op(int j) const
Base subclass for ModelEvaluator that defines some basic types.
void push_back(const value_type &x)
RCP< LinearOpWithSolveBase< Scalar > > get_W() const
Precondition: supports(OUT_ARG_W)==true.
void resetDefaultBase()
Sets the the DefaultBase to an uninitialized state, forcing lazy initialization when needed...
Derivative< Scalar > get_DgDx_dot(int j) const
Precondition: supports(OUT_ARG_DgDx_dot,j)==true.
Determines the forms of a general derivative that are supported.
ModelEvaluatorBase::OutArgs< Scalar > createOutArgs() const
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
Derivative< Scalar > get_DgDx(int j) const
Precondition: supports(OUT_ARG_DgDx,j)==true.
RCP< LinearOpBase< Scalar > > create_DgDp_op(int j, int l) const
Concrete aggregate class for all input arguments computable by a ModelEvaluator subclass object...