9 #ifndef Tempus_WrapperModelEvaluatorBasic_impl_hpp
10 #define Tempus_WrapperModelEvaluatorBasic_impl_hpp
15 template <
typename Scalar>
22 MEB::InArgsSetup<Scalar> inArgs(appModel_->getNominalValues());
24 inArgs.setModelEvalDescription(this->description());
25 return std::move(inArgs);
29 template <
typename Scalar>
35 MEB::OutArgsSetup<Scalar> outArgs(appModel_->createOutArgs());
36 outArgs.setModelEvalDescription(this->description());
37 return std::move(outArgs);
41 template <
typename Scalar>
50 MEB::InArgs<Scalar> appInArgs (wrapperInArgs_);
51 MEB::OutArgs<Scalar> appOutArgs(wrapperOutArgs_);
54 switch (evaluationType_)
59 appInArgs.set_x (inArgs.
get_x() );
63 appOutArgs.set_f(outArgs.
get_f());
74 RCP<const Thyra::VectorBase<Scalar> > x = inArgs.
get_x();
76 RCP<Thyra::VectorBase<Scalar> > xDot =
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)) {
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)) {
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.
RCP< const VectorBase< Scalar > > get_x_dot() const
Evaluation< VectorBase< Scalar > > get_f() const
bool supports(EOutArgsMembers arg) const
Solve for xDot keeping x constant (for ICs).
RCP< PreconditionerBase< Scalar > > get_W_prec() const
void evalModelImpl(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
Thyra::ModelEvaluatorBase::InArgs< Scalar > createInArgs() const
RCP< LinearOpBase< Scalar > > get_W_op() const
Solve for x and determine xDot from x.
RCP< const VectorBase< Scalar > > get_x() const
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
RCP< const VectorBase< Scalar > > get_p(int l) const
Thyra::ModelEvaluatorBase::OutArgs< Scalar > createOutArgsImpl() const