42 #ifndef THYRA_MODEL_EVALUATOR_HELPERS_HPP
43 #define THYRA_MODEL_EVALUATOR_HELPERS_HPP
46 #include "Thyra_ModelEvaluator.hpp"
59 template<
class Scalar>
60 RCP<ModelEvaluatorBase::InArgs<Scalar> >
61 clone(
const ModelEvaluatorBase::InArgs<Scalar> &inArgs );
65 template<
class Scalar>
66 ModelEvaluatorBase::Derivative<Scalar>
68 const RCP<MultiVectorBase<Scalar> > &grad
73 template<
class Scalar>
74 ModelEvaluatorBase::DerivativeMultiVector<Scalar>
76 const ModelEvaluator<Scalar>& model,
83 template<
class Scalar>
84 ModelEvaluatorBase::DerivativeMultiVector<Scalar>
86 const ModelEvaluator<Scalar>& model,
93 template<
class Scalar>
94 ModelEvaluatorBase::DerivativeMultiVector<Scalar>
96 const ModelEvaluator<Scalar>& model,
103 template<
class Scalar>
104 ModelEvaluatorBase::DerivativeMultiVector<Scalar>
106 const ModelEvaluator<Scalar>& model,
114 template<
class Scalar>
115 ModelEvaluatorBase::DerivativeMultiVector<Scalar>
117 const ModelEvaluatorBase::Derivative<Scalar> &deriv
118 ,
const std::string &derivName
123 template<
class Scalar>
124 RCP<MultiVectorBase<Scalar> >
126 const ModelEvaluatorBase::Derivative<Scalar> &deriv
127 ,
const std::string &derivName
137 template<
class Scalar>
138 void assertDerivSpaces(
139 const std::string &modelEvalDescription,
140 const ModelEvaluatorBase::Derivative<Scalar> &deriv,
141 const std::string &deriv_name,
142 const VectorSpaceBase<Scalar> &fnc_space,
143 const std::string &fnc_space_name,
144 const VectorSpaceBase<Scalar> &var_space,
145 const std::string &var_space_name
153 template<
class Scalar>
154 void assertInArgsOutArgsSetup(
155 const std::string &modelEvalDescription,
156 const ModelEvaluatorBase::InArgs<Scalar> &inArgs,
157 const ModelEvaluatorBase::OutArgs<Scalar> &outArgs
165 template<
class Scalar>
166 void assertInArgsEvalObjects(
167 const ModelEvaluator<Scalar> &model,
168 const ModelEvaluatorBase::InArgs<Scalar> &inArgs
176 template<
class Scalar>
177 void assertOutArgsEvalObjects(
178 const ModelEvaluator<Scalar> &model,
179 const ModelEvaluatorBase::OutArgs<Scalar> &outArgs,
180 const ModelEvaluatorBase::InArgs<Scalar> *inArgs = 0
185 template<
class Scalar>
187 const ModelEvaluator<Scalar> &model
188 ,
const VectorBase<Scalar> &x
189 ,VectorBase<Scalar> *f
194 template<
class Scalar>
196 const ModelEvaluator<Scalar> &model
197 ,
const VectorBase<Scalar> &x
198 ,VectorBase<Scalar> *f
199 ,LinearOpWithSolveBase<Scalar> *W
204 template<
class Scalar>
206 const ModelEvaluator<Scalar> &model
207 ,
const VectorBase<Scalar> &x
209 ,VectorBase<Scalar> *f
214 template<
class Scalar>
216 const ModelEvaluator<Scalar> &model,
218 const VectorBase<Scalar> &p_l,
220 const Ptr<VectorBase<Scalar> > &g_j
225 template<
class Scalar>
227 const ModelEvaluator<Scalar> &model,
229 const VectorBase<Scalar> &p_l,
232 VectorBase<Scalar> *g_j
237 template<
class Scalar>
239 const ModelEvaluator<Scalar> &model,
241 const VectorBase<Scalar> &p_l,
243 const Ptr<VectorBase<Scalar> > &g_j,
244 const ModelEvaluatorBase::Derivative<Scalar> &DgDp_j_l
249 template<
class Scalar>
251 const ModelEvaluator<Scalar> &model
252 ,
const VectorBase<Scalar> &x_dot
253 ,
const VectorBase<Scalar> &x
254 ,
const typename ModelEvaluatorBase::InArgs<Scalar>::ScalarMag &t
255 ,VectorBase<Scalar> *f
261 template<
class Scalar>
263 const ModelEvaluator<Scalar> &model
264 ,
const VectorBase<Scalar> &x_dot
265 ,
const VectorBase<Scalar> &x
266 ,
const typename ModelEvaluatorBase::InArgs<Scalar>::ScalarMag &t
269 ,VectorBase<Scalar> *f
270 ,LinearOpWithSolveBase<Scalar> *W
274 #ifdef HAVE_THYRA_ME_POLYNOMIAL
278 template<
class Scalar>
280 const ModelEvaluator<Scalar> &model
282 ,
const typename ModelEvaluatorBase::InArgs<Scalar>::ScalarMag &t
288 template<
class Scalar>
290 const ModelEvaluator<Scalar> &model
292 ,
const VectorBase<Scalar> &x_poly
293 ,
const typename ModelEvaluatorBase::InArgs<Scalar>::ScalarMag &t
298 #endif // HAVE_THYRA_ME_POLYNOMIAL
309 #include "Thyra_AssertOp.hpp"
310 #include "Teuchos_Utils.hpp"
313 template<
class Scalar>
315 Thyra::clone(
const ModelEvaluatorBase::InArgs<Scalar> &inArgs )
317 RCP<ModelEvaluatorBase::InArgs<Scalar> >
318 newInArgs =
Teuchos::rcp(
new ModelEvaluatorBase::InArgs<Scalar>);
324 template<
class Scalar>
326 Thyra::derivativeGradient(
327 const RCP<MultiVectorBase<Scalar> > &grad
330 return ModelEvaluatorBase::Derivative<Scalar>(
332 ModelEvaluatorBase::DERIV_MV_GRADIENT_FORM
337 template<
class Scalar>
339 Thyra::create_DfDp_mv(
340 const ModelEvaluator<Scalar>& model,
342 ModelEvaluatorBase::EDerivativeMultiVectorOrientation orientation
346 return createMembers( model.get_f_space(), model.get_p_space(l)->dim() );
350 template<
class Scalar>
352 Thyra::create_DgDx_dot_mv(
353 const ModelEvaluator<Scalar>& model,
355 ModelEvaluatorBase::EDerivativeMultiVectorOrientation orientation
358 typedef ModelEvaluatorBase MEB;
359 switch(orientation) {
360 case MEB::DERIV_MV_BY_COL:
362 MEB::DerivativeMultiVector<Scalar>(
363 createMembers( model.get_g_space(j), model.get_x_space()->dim() )
364 ,MEB::DERIV_MV_BY_COL
366 case MEB::DERIV_TRANS_MV_BY_ROW:
368 MEB::DerivativeMultiVector<Scalar>(
369 createMembers( model.get_x_space(), model.get_g_space(j)->dim() )
370 ,MEB::DERIV_TRANS_MV_BY_ROW
379 template<
class Scalar>
381 Thyra::create_DgDx_mv(
382 const ModelEvaluator<Scalar>& model,
384 ModelEvaluatorBase::EDerivativeMultiVectorOrientation orientation
391 template<
class Scalar>
393 Thyra::create_DgDp_mv(
394 const ModelEvaluator<Scalar>& model,
397 ModelEvaluatorBase::EDerivativeMultiVectorOrientation orientation
400 typedef ModelEvaluatorBase MEB;
401 switch(orientation) {
402 case MEB::DERIV_MV_BY_COL:
404 MEB::DerivativeMultiVector<Scalar>(
405 createMembers( model.get_g_space(j), model.get_p_space(l)->dim() )
406 ,MEB::DERIV_MV_BY_COL
408 case MEB::DERIV_TRANS_MV_BY_ROW:
410 MEB::DerivativeMultiVector<Scalar>(
411 createMembers( model.get_p_space(l), model.get_g_space(j)->dim() )
412 ,MEB::DERIV_TRANS_MV_BY_ROW
421 template<
class Scalar>
424 const ModelEvaluatorBase::Derivative<Scalar> &deriv
425 ,
const std::string &derivName
429 deriv.getLinearOp().get()!=NULL, std::logic_error
430 ,
"Error, LinearOpBase type not expected for " << derivName <<
"!"
432 return deriv.getDerivativeMultiVector();
436 template<
class Scalar>
439 const ModelEvaluatorBase::Derivative<Scalar> &deriv
440 ,
const std::string &derivName
441 ,ModelEvaluatorBase::EDerivativeMultiVectorOrientation orientation
444 typedef ModelEvaluatorBase MEB;
446 deriv.getLinearOp().get()!=NULL, std::logic_error
447 ,
"Error, LinearOpBase type not expected for " << derivName <<
"!"
449 MEB::DerivativeMultiVector<Scalar>
450 dmv = deriv.getDerivativeMultiVector();
451 RCP<MultiVectorBase<Scalar> >
452 mv = dmv.getMultiVector();
455 dmv.getOrientation() != orientation, std::logic_error
456 ,
"Error, the orientation " <<
toString(dmv.getOrientation()) <<
" is not the"
457 " expected orientation of " <<
toString(orientation)
458 <<
" for " << derivName <<
"!"
465 template<
class Scalar>
466 void Thyra::assertDerivSpaces(
467 const std::string &modelEvalDescription,
468 const ModelEvaluatorBase::Derivative<Scalar> &deriv,
469 const std::string &deriv_name,
470 const VectorSpaceBase<Scalar> &fnc_space,
471 const std::string &fnc_space_name,
472 const VectorSpaceBase<Scalar> &var_space,
473 const std::string &var_space_name
476 typedef ModelEvaluatorBase MEB;
477 if (!
is_null(deriv.getLinearOp())) {
478 const RCP<const LinearOpBase<Scalar> > lo = deriv.getLinearOp();
481 modelEvalDescription,
482 *lo->range(), deriv_name +
".range()",
483 fnc_space, fnc_space_name
486 modelEvalDescription,
487 *lo->domain(), deriv_name +
".domain()",
488 var_space, var_space_name
492 else if(!
is_null(deriv.getMultiVector())) {
493 const RCP<const LinearOpBase<Scalar> > mv = deriv.getMultiVector();
494 switch(deriv.getMultiVectorOrientation()) {
495 case MEB::DERIV_MV_BY_COL: {
497 modelEvalDescription,
498 *mv->range(), deriv_name +
".range()",
499 fnc_space, fnc_space_name
502 modelEvalDescription,
503 *mv->domain(), deriv_name +
".domain()",
504 var_space, var_space_name
508 case MEB::DERIV_TRANS_MV_BY_ROW: {
510 modelEvalDescription,
511 *mv->range(), deriv_name +
"^T.range()",
512 var_space, var_space_name
515 modelEvalDescription,
516 *mv->domain(), deriv_name +
"^T.domain()",
517 fnc_space, fnc_space_name
530 template<
class Scalar>
531 void Thyra::assertInArgsOutArgsSetup(
532 const std::string &modelEvalDescription,
533 const ModelEvaluatorBase::InArgs<Scalar> &inArgs,
534 const ModelEvaluatorBase::OutArgs<Scalar> &outArgs
538 typedef ModelEvaluatorBase MEB;
540 const int Ng = outArgs.Ng();
541 const int Np = outArgs.Np();
549 inArgs.Np() != outArgs.Np(), std::logic_error,
550 "Error: The underlying model " << modelEvalDescription <<
" incorrectly\n"
551 "set inArgs.Np() = "<<inArgs.Np()<<
" != outArgs.Np() = "
557 inArgs.supports(MEB::IN_ARG_x_dot) && !inArgs.supports(MEB::IN_ARG_x),
559 "Error: The underlying model " << modelEvalDescription <<
" supports\n"
560 "x_dot but does not support x!"
565 inArgs.supports(MEB::IN_ARG_x_dot) && !inArgs.supports(MEB::IN_ARG_t),
567 "Error: The underlying model " << modelEvalDescription <<
" supports\n"
568 "x_dot but does not support t!"
574 ( outArgs.supports(MEB::OUT_ARG_W) || outArgs.supports(MEB::OUT_ARG_W_op) )
576 !inArgs.supports(MEB::IN_ARG_x)
579 "Error: The underlying model " << modelEvalDescription <<
" says that\n"
580 "it supports W and/or W_op but it does not support x!"
584 ( outArgs.supports(MEB::OUT_ARG_W) || outArgs.supports(MEB::OUT_ARG_W_op) )
586 inArgs.supports(MEB::IN_ARG_x_dot)
588 !( inArgs.supports(MEB::IN_ARG_alpha) && inArgs.supports(MEB::IN_ARG_beta) )
591 "Error: The underlying model " << modelEvalDescription <<
" supports W and/or W_op\n"
592 "and x_dot but it does not support alpha and beta as InArgs! \n"
593 "If the model supports W and x_dot, then it can be interpreted as an implicit \n"
594 "ODE/DAE and therefore D(f)/D(x_dot) must be non-zero and therefore alpha must \n"
595 "be supported. If, however, the model can be interpreted as an explicit ODE \n"
596 "then x_dot should not be supported at all."
599 for (
int l = 0; l < Np; ++l ) {
603 for (
int j = 0; j < Ng; ++j ) {
607 ( !outArgs.supports(MEB::OUT_ARG_DgDx_dot,j).none()
608 && !inArgs.supports(MEB::IN_ARG_x_dot) ),
610 "Error: The underlying model " << modelEvalDescription <<
" says that\n"
611 "it supports DgDx_dot("<<j<<
") but it does not support x_dot!"
616 ( !outArgs.supports(MEB::OUT_ARG_DgDx,j).none()
617 && !inArgs.supports(MEB::IN_ARG_x) ),
619 "Error: The underlying model " << modelEvalDescription <<
" says that\n"
620 "it supports DgDx("<<j<<
") but it does not support x!"
632 template<
class Scalar>
633 void Thyra::assertInArgsEvalObjects(
634 const ModelEvaluator<Scalar> &model,
635 const ModelEvaluatorBase::InArgs<Scalar> &inArgs
639 typedef ModelEvaluatorBase MEB;
641 const std::string description = model.description();
642 const int Np = inArgs.Np();
644 model.createInArgs().assertSameSupport(inArgs);
647 if ( inArgs.supports(MEB::IN_ARG_x_dot) && !
is_null(inArgs.get_x_dot()) ) {
649 description, *inArgs.get_x_dot()->space(), *model.get_x_space() );
653 if ( inArgs.supports(MEB::IN_ARG_x) && !
is_null(inArgs.get_x()) ) {
655 description, *inArgs.get_x()->space(), *model.get_x_space() );
659 for (
int l = 0; l < Np; ++l ) {
660 if (!
is_null(inArgs.get_p(l))) {
662 description, *inArgs.get_p(l)->space(), *model.get_p_space(l) );
669 template<
class Scalar>
670 void Thyra::assertOutArgsEvalObjects(
671 const ModelEvaluator<Scalar> &model,
672 const ModelEvaluatorBase::OutArgs<Scalar> &outArgs,
673 const ModelEvaluatorBase::InArgs<Scalar> *inArgs
677 typedef ScalarTraits<Scalar> ST;
679 typedef ModelEvaluatorBase MEB;
681 const std::string description = model.description();
682 const int Ng = outArgs.Ng();
683 const int Np = outArgs.Np();
689 model.createOutArgs().assertSameSupport(outArgs);
692 if ( outArgs.supports(MEB::OUT_ARG_f) && !
is_null(outArgs.get_f()) ) {
694 description, *outArgs.get_f()->space(), *model.get_f_space() );
698 if ( outArgs.supports(MEB::OUT_ARG_W) && !
is_null(outArgs.get_W()) ) {
699 if (!
is_null(outArgs.get_W()->range())) {
701 description, *outArgs.get_W()->range(), *model.get_f_space() );
703 description, *outArgs.get_W()->domain(), *model.get_x_space() );
708 if ( outArgs.supports(MEB::OUT_ARG_W_op) && !
is_null(outArgs.get_W_op()) ) {
709 if (!
is_null(outArgs.get_W_op()->range())) {
711 description, *outArgs.get_W_op()->range(), *model.get_f_space() );
713 description, *outArgs.get_W_op()->domain(), *model.get_x_space() );
723 ( outArgs.supports(MEB::OUT_ARG_W) && !
is_null(outArgs.get_W()) )
725 ( outArgs.supports(MEB::OUT_ARG_W_op) && !
is_null(outArgs.get_W_op()) )
729 if ( inArgs->supports(MEB::IN_ARG_alpha) && inArgs->supports(MEB::IN_ARG_beta) ) {
737 else if ( inArgs->supports(MEB::IN_ARG_beta) ) {
743 if (outArgs.supports(MEB::OUT_ARG_f)) {
744 for (
int l = 0; l < Np; ++l ) {
745 if (!outArgs.supports(MEB::OUT_ARG_DfDp,l).none()) {
749 *model.get_f_space(),
"f_space",
757 for (
int j = 0; j < Ng; ++j ) {
758 if (!
is_null(outArgs.get_g(j))) {
760 description, *outArgs.get_g(j)->space(), *model.get_g_space(j) );
765 for (
int j = 0; j < Ng; ++j ) {
766 if (!outArgs.supports(MEB::OUT_ARG_DgDx_dot,j).none()) {
769 outArgs.get_DgDx_dot(j),
"DgDx_dot("+
TU::toString(j)+
")",
771 *model.get_x_space(),
"x_space"
777 for (
int j = 0; j < Ng; ++j ) {
778 if (!outArgs.supports(MEB::OUT_ARG_DgDx,j).none()) {
783 *model.get_x_space(),
"x_space"
789 for (
int j = 0; j < Ng; ++j ) {
790 for (
int l = 0; l < Np; ++l ) {
791 if (!outArgs.supports(MEB::OUT_ARG_DgDp,j,l).none()) {
796 outArgs.get_DgDp(j,l),
"DgDp("+j_str+
","+l_str+
")",
797 *model.get_g_space(j),
"g_space("+j_str+
")",
798 *model.get_p_space(l),
"p_space("+l_str+
")"
807 template<
class Scalar>
809 const ModelEvaluator<Scalar> &model
810 ,
const VectorBase<Scalar> &x
811 ,VectorBase<Scalar> *f
814 typedef ModelEvaluatorBase MEB;
815 MEB::InArgs<Scalar> inArgs = model.createInArgs();
816 MEB::OutArgs<Scalar> outArgs = model.createOutArgs();
819 model.evalModel(inArgs,outArgs);
823 template<
class Scalar>
824 void Thyra::eval_f_W(
825 const ModelEvaluator<Scalar> &model
826 ,
const VectorBase<Scalar> &x
827 ,VectorBase<Scalar> *f
828 ,LinearOpWithSolveBase<Scalar> *W
832 typedef ModelEvaluatorBase MEB;
834 MEB::InArgs<Scalar> inArgs = model.createInArgs();
835 MEB::OutArgs<Scalar> outArgs = model.createOutArgs();
842 model.evalModel(inArgs,outArgs);
847 template<
class Scalar>
849 const ModelEvaluator<Scalar> &model
850 ,
const VectorBase<Scalar> &x
852 ,VectorBase<Scalar> *f
855 typedef ModelEvaluatorBase MEB;
856 MEB::InArgs<Scalar> inArgs = model.createInArgs();
857 MEB::OutArgs<Scalar> outArgs = model.createOutArgs();
859 if(inArgs.supports(MEB::IN_ARG_t)) inArgs.set_t(t);
861 model.evalModel(inArgs,outArgs);
865 template<
class Scalar>
867 const ModelEvaluator<Scalar> &model,
869 const VectorBase<Scalar> &p_l,
871 const Ptr<VectorBase<Scalar> > &g_j
874 typedef ModelEvaluatorBase MEB;
875 MEB::InArgs<Scalar> inArgs = model.createInArgs();
876 MEB::OutArgs<Scalar> outArgs= model.createOutArgs();
877 inArgs.set_p(l, Teuchos::rcpFromRef(p_l));
878 outArgs.set_g(j, Teuchos::rcpFromRef(*g_j));
879 model.evalModel(inArgs,outArgs);
883 template<
class Scalar>
885 const ModelEvaluator<Scalar> &model,
887 const VectorBase<Scalar> &p_l,
890 VectorBase<Scalar> *g_j
893 typedef ModelEvaluatorBase MEB;
894 MEB::InArgs<Scalar> inArgs = model.createInArgs();
895 MEB::OutArgs<Scalar> outArgs= model.createOutArgs();
899 model.evalModel(inArgs,outArgs);
903 template<
class Scalar>
904 void Thyra::eval_g_DgDp(
905 const ModelEvaluator<Scalar> &model,
907 const VectorBase<Scalar> &p_l,
909 const Ptr<VectorBase<Scalar> > &g_j,
910 const ModelEvaluatorBase::Derivative<Scalar> &DgDp_j_l
913 typedef ModelEvaluatorBase MEB;
914 MEB::InArgs<Scalar> inArgs = model.createInArgs();
915 MEB::OutArgs<Scalar> outArgs= model.createOutArgs();
916 inArgs.set_p(l, Teuchos::rcpFromRef(p_l));
918 outArgs.set_g(j, Teuchos::rcpFromPtr(g_j));
920 if (!DgDp_j_l.isEmpty()) {
921 outArgs.set_DgDp(j, l, DgDp_j_l);
923 model.evalModel(inArgs,outArgs);
927 template<
class Scalar>
929 const ModelEvaluator<Scalar> &model
930 ,
const VectorBase<Scalar> &x_dot
931 ,
const VectorBase<Scalar> &x
932 ,
const typename ModelEvaluatorBase::InArgs<Scalar>::ScalarMag &t
933 ,VectorBase<Scalar> *f
937 typedef ModelEvaluatorBase MEB;
939 MEB::InArgs<Scalar> inArgs = model.createInArgs();
940 MEB::OutArgs<Scalar> outArgs = model.createOutArgs();
944 if(inArgs.supports(MEB::IN_ARG_t))
949 model.evalModel(inArgs,outArgs);
954 template<
class Scalar>
955 void Thyra::eval_f_W(
956 const ModelEvaluator<Scalar> &model
957 ,
const VectorBase<Scalar> &x_dot
958 ,
const VectorBase<Scalar> &x
959 ,
const typename ModelEvaluatorBase::InArgs<Scalar>::ScalarMag &t
962 ,VectorBase<Scalar> *f
963 ,LinearOpWithSolveBase<Scalar> *W
967 typedef ModelEvaluatorBase MEB;
969 MEB::InArgs<Scalar> inArgs = model.createInArgs();
970 MEB::OutArgs<Scalar> outArgs = model.createOutArgs();
974 if(inArgs.supports(MEB::IN_ARG_t))
976 inArgs.set_alpha(alpha);
977 inArgs.set_beta(beta);
982 model.evalModel(inArgs,outArgs);
987 #ifdef HAVE_THYRA_ME_POLYNOMIAL
990 template<
class Scalar>
991 void Thyra::eval_f_poly(
992 const ModelEvaluator<Scalar> &model
994 ,
const typename ModelEvaluatorBase::InArgs<Scalar>::ScalarMag &t
999 typedef ModelEvaluatorBase MEB;
1001 MEB::InArgs<Scalar> inArgs = model.createInArgs();
1002 MEB::OutArgs<Scalar> outArgs = model.createOutArgs();
1005 if(inArgs.supports(MEB::IN_ARG_t))
1010 model.evalModel(inArgs,outArgs);
1015 template<
class Scalar>
1016 void Thyra::eval_f_poly(
1017 const ModelEvaluator<Scalar> &model
1019 ,
const VectorBase<Scalar> &x_poly
1020 ,
const typename ModelEvaluatorBase::InArgs<Scalar>::ScalarMag &t
1025 typedef ModelEvaluatorBase MEB;
1027 MEB::InArgs<Scalar> inArgs = model.createInArgs();
1028 MEB::OutArgs<Scalar> outArgs = model.createOutArgs();
1030 inArgs.set_x_dot_poly(
Teuchos::rcp(&x_dot_poly,
false));
1032 if(inArgs.supports(MEB::IN_ARG_t))
1037 model.evalModel(inArgs,outArgs);
1042 #endif // HAVE_THYRA_ME_POLYNOMIAL
1045 #endif // THYRA_MODEL_EVALUATOR_HELPERS_HPP
#define THYRA_ASSERT_VEC_SPACES(FUNC_NAME, VS1, VS2)
This is a very useful macro that should be used to validate that two vector spaces are compatible...
bool is_null(const boost::shared_ptr< T > &p)
std::string toString(ModelEvaluatorBase::EInArgsMembers)
EDerivativeMultiVectorOrientation
#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...
Simple aggregate class for a derivative object represented as a column-wise multi-vector or its trans...
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
TEUCHOSCORE_LIB_DLL_EXPORT std::string toString(const EVerbosityLevel verbLevel)
ModelEvaluatorBase::DerivativeMultiVector< Scalar > create_DgDx_dot_mv(const ModelEvaluator< Scalar > &model, int j, ModelEvaluatorBase::EDerivativeMultiVectorOrientation orientation)
#define TEUCHOS_UNREACHABLE_RETURN(dummyReturnVal)
void assertDerivSpaces(const std::string &modelEvalDescription, const ModelEvaluatorBase::Derivative< Scalar > &deriv, const std::string &deriv_name, const VectorSpaceBase< Scalar > &fnc_space, const std::string &fnc_space_name, const VectorSpaceBase< Scalar > &var_space, const std::string &var_space_name)
Assert that that Thyra objects imbedded in a Derivative object matches its function and variable spac...
#define THYRA_ASSERT_VEC_SPACES_NAMES(FUNC_NAME, VS1, VS1_NAME, VS2, VS2_NAME)
Helper assertion macro.
#define TEUCHOS_ASSERT_EQUALITY(val1, val2)
RCP< MultiVectorBase< Scalar > > createMembers(const RCP< const VectorSpaceBase< Scalar > > &vs, int numMembers, const std::string &label="")
Create a set of vector members (a MultiVectorBase) from the vector space.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)