10 #include "Thyra_DefaultSpmdVectorSpace.hpp"
11 #include "Thyra_DetachedVectorView.hpp"
12 #include "Thyra_DetachedMultiVectorView.hpp"
13 #include "Thyra_DefaultSerialDenseLinearOpWithSolveFactory.hpp"
14 #include "Thyra_DefaultMultiVectorLinearOpWithSolve.hpp"
15 #include "Thyra_DefaultLinearOpSource.hpp"
16 #include "Thyra_VectorStdOps.hpp"
23 template<
class Scalar>
28 epsilon_(Scalar(1.0e-01)),
33 typedef ::Thyra::ModelEvaluatorBase MEB;
41 MEB::InArgsSetup<Scalar> inArgs;
42 inArgs.setModelEvalDescription(this->
description());
43 inArgs.setSupports( MEB::IN_ARG_t );
44 inArgs.setSupports( MEB::IN_ARG_x );
45 inArgs.setSupports( MEB::IN_ARG_x_dot );
51 MEB::OutArgsSetup<Scalar> outArgs;
52 outArgs.setModelEvalDescription(this->
description());
53 outArgs.setSupports( MEB::OUT_ARG_f );
60 const RCP<Thyra::VectorBase<Scalar> > x_ic = createMember(
x_space_);
68 const RCP<Thyra::VectorBase<Scalar> > xDot_ic = createMember(
x_space_);
79 template<
class Scalar>
89 const RCP<const Thyra::VectorBase<Scalar> > x_in =
90 inArgs.
get_x().assert_not_null();
93 const RCP<Thyra::VectorBase<Scalar> > f_out =
94 outArgs.
get_f().assert_not_null();
99 f_out_view[0] = x_in_view[1];
101 ((1.0-x_in_view[0]*x_in_view[0])*x_in_view[1]-x_in_view[0])/epsilon_;
105 RCP<const Thyra::VectorBase<Scalar> > x_dot_in;
106 x_dot_in = inArgs.
get_x_dot().assert_not_null();
109 f_out_view[0] = x_dot_in_view[0] - x_in_view[1];
110 f_out_view[1] = x_dot_in_view[1]
111 - ((1.0-x_in_view[0]*x_in_view[0])*x_in_view[1]-x_in_view[0])/epsilon_;
RCP< const VectorBase< Scalar > > get_x_dot() const
Scalar t0_ic_
initial time = 0
Thyra::ModelEvaluatorBase::OutArgs< Scalar > prototypicalOutArgs_
Prototypical OutArgs that just supports the evaluation vector (OUT_ARG_f)
Scalar epsilon_
This is a model parameter ( )
Evaluation< VectorBase< Scalar > > get_f() const
void evalModelImpl(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs_bar, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs_bar) const
Scalar x1_ic_
initial condition for
Scalar x0_ic_
initial condition for
VanDerPol_ModelEvaluator_02()
virtual std::string description() const
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > x_space_
Solution vector space (a defaultSpmdVectorSpace of dimension 2)
ModelEvaluator implementation for the example van der Pol Problem.
int dim_
Number of state unknowns (2)
Thyra::ModelEvaluatorBase::InArgs< Scalar > nominalValues_
Thyra::ModelEvaluatorBase::InArgs< Scalar > prototypicalInArgs_
RCP< const VectorBase< Scalar > > get_x() const
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > f_space_
Function evaluation vector space (a defaultSpmdVectorSpace of dimension 2)