9 #ifndef Tempus_WrapperModelEvaluatorBasic_impl_hpp
10 #define Tempus_WrapperModelEvaluatorBasic_impl_hpp
15 template <
typename Scalar>
16 Thyra::ModelEvaluatorBase::InArgs<Scalar>
20 typedef Thyra::ModelEvaluatorBase MEB;
22 MEB::InArgsSetup<Scalar> inArgs(appModel_->getNominalValues());
24 inArgs.setModelEvalDescription(this->description());
29 template <
typename Scalar>
30 Thyra::ModelEvaluatorBase::OutArgs<Scalar>
34 typedef Thyra::ModelEvaluatorBase MEB;
35 MEB::OutArgsSetup<Scalar> outArgs(appModel_->createOutArgs());
36 outArgs.setModelEvalDescription(this->description());
41 template <
typename Scalar>
45 const Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs)
const
49 typedef Thyra::ModelEvaluatorBase MEB;
50 MEB::InArgs<Scalar> appInArgs (wrapperInArgs_);
51 MEB::OutArgs<Scalar> appOutArgs(wrapperOutArgs_);
54 switch (evaluationType_)
59 appInArgs.set_x (inArgs.get_x() );
60 appInArgs.set_x_dot(inArgs.get_x_dot());
63 appOutArgs.set_f(outArgs.get_f());
74 RCP<const Thyra::VectorBase<Scalar> > x = inArgs.get_x();
76 RCP<Thyra::VectorBase<Scalar> > xDot =
77 Teuchos::rcp_const_cast<Thyra::VectorBase<Scalar> >(
78 appInArgs.get_x_dot());
79 timeDer_->compute(x, xDot);
80 appInArgs.set_x_dot(xDot);
88 appOutArgs.set_f(outArgs.get_f());
89 appOutArgs.set_W_op(outArgs.get_W_op());
90 if (outArgs.supports(MEB::OUT_ARG_W_prec)) {
91 appOutArgs.set_W_prec(outArgs.get_W_prec());
107 appInArgs.set_x(wrapperInArgs_.get_x());
108 appInArgs.set_x_dot(inArgs.get_x());
111 appOutArgs.set_f(outArgs.get_f());
112 appOutArgs.set_W_op(outArgs.get_W_op());
113 if (outArgs.supports(MEB::OUT_ARG_W_prec)) {
114 appOutArgs.set_W_prec(outArgs.get_W_prec());
121 TEUCHOS_TEST_FOR_EXCEPT(
"Invalid EVALUATION_TYPE!");
125 for (
int i=0; i<appModel_->Np(); ++i) {
126 if (inArgs.get_p(i) != Teuchos::null)
127 appInArgs.set_p(i, inArgs.get_p(i));
130 appModel_->evalModel(appInArgs, appOutArgs);
136 #endif // Tempus_WrapperModelEvaluatorBasic_impl_hpp
Evaluate residual for the implicit ODE.
Solve for xDot keeping x constant (for ICs).
void evalModelImpl(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
Thyra::ModelEvaluatorBase::InArgs< Scalar > createInArgs() const
Solve for x and determine xDot from x.
Thyra::ModelEvaluatorBase::OutArgs< Scalar > createOutArgsImpl() const