9 #ifndef Tempus_WrapperModelEvaluatorSecondOrder_decl_hpp
10 #define Tempus_WrapperModelEvaluatorSecondOrder_decl_hpp
14 #include "Thyra_VectorBase.hpp"
15 #include "Thyra_VectorStdOps.hpp"
31 template <
typename Scalar>
36 typedef Thyra::VectorBase<Scalar>
Vector;
40 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& appModel,
const std::string schemeName)
42 out_(Teuchos::VerboseObjectBase::getDefaultOStream())
44 #ifdef VERBOSE_DEBUG_OUTPUT
45 *
out_ <<
"DEBUG: " << __PRETTY_FUNCTION__ <<
"\n";
46 *
out_ <<
" schemeName = " << schemeName <<
"\n";
48 if (schemeName ==
"Newmark Implicit a-Form" || schemeName ==
"HHT-Alpha") {
51 else if (schemeName ==
"Newmark Implicit d-Form") {
55 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
56 "Error: WrapperModelEvaluatorSecondOrder called with unsopported schemeName = " << schemeName
57 <<
"! Supported schemeNames are: 'Newmark Implicit a-Form' and 'HHT-Alpha'.\n");
63 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> > & me)
65 #ifdef VERBOSE_DEBUG_OUTPUT
66 *
out_ <<
"DEBUG: " << __PRETTY_FUNCTION__ <<
"\n";
72 Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >
getAppModel()
const
74 #ifdef VERBOSE_DEBUG_OUTPUT
75 *
out_ <<
"DEBUG: " << __PRETTY_FUNCTION__ <<
"\n";
82 Teuchos::RCP<const Vector> d_pred, Scalar delta_t,
83 Scalar t, Scalar beta, Scalar gamma)
85 #ifdef VERBOSE_DEBUG_OUTPUT
86 *
out_ <<
"DEBUG: " << __PRETTY_FUNCTION__ <<
"\n";
94 Teuchos::RCP<Thyra::LinearOpBase<Scalar> >
create_W_op()
const
96 #ifdef VERBOSE_DEBUG_OUTPUT
97 *
out_ <<
"DEBUG: " << __PRETTY_FUNCTION__ <<
"\n";
102 Teuchos::RCP<const Thyra::LinearOpWithSolveFactoryBase<Scalar> >
105 #ifdef VERBOSE_DEBUG_OUTPUT
106 *
out_ <<
"DEBUG: " << __PRETTY_FUNCTION__ <<
"\n";
111 Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> >
get_f_space()
const
113 #ifdef VERBOSE_DEBUG_OUTPUT
114 *
out_ <<
"DEBUG: " << __PRETTY_FUNCTION__ <<
"\n";
119 Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> >
get_p_space(
int p)
const
121 #ifdef VERBOSE_DEBUG_OUTPUT
122 *
out_ <<
"DEBUG: " << __PRETTY_FUNCTION__ <<
"\n";
127 Teuchos::RCP<const Teuchos::Array<std::string> >
get_p_names(
int p)
const
129 #ifdef VERBOSE_DEBUG_OUTPUT
130 *
out_ <<
"DEBUG: " << __PRETTY_FUNCTION__ <<
"\n";
135 Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> >
get_x_space()
const
137 #ifdef VERBOSE_DEBUG_OUTPUT
138 *
out_ <<
"DEBUG: " << __PRETTY_FUNCTION__ <<
"\n";
143 Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> >
get_g_space(
int i)
const
148 #ifdef VERBOSE_DEBUG_OUTPUT
149 *
out_ <<
"DEBUG: " << __PRETTY_FUNCTION__ <<
"\n";
155 virtual void setInArgs(Thyra::ModelEvaluatorBase::InArgs<Scalar> inArgs)
159 virtual Thyra::ModelEvaluatorBase::InArgs<Scalar>
getInArgs()
163 virtual void setOutArgs(Thyra::ModelEvaluatorBase::OutArgs<Scalar> outArgs)
167 virtual Thyra::ModelEvaluatorBase::OutArgs<Scalar>
getOutArgs()
172 Thyra::ModelEvaluatorBase::InArgs<Scalar> inArgs,
173 Thyra::ModelEvaluatorBase::OutArgs<Scalar> outArgs,
181 Thyra::ModelEvaluatorBase::InArgs<Scalar>
createInArgs()
const;
185 const Thyra::ModelEvaluatorBase::InArgs<Scalar> &inArgs,
186 const Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs)
const;
198 Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >
appModel_;
205 Teuchos::RCP<Teuchos::FancyOStream>
out_;
216 #endif // Tempus_WrapperModelEvaluatorSecondOrder_hpp
EVALUATION_TYPE
EVALUATION_TYPE indicates the evaluation to apply to the implicit ODE.
virtual Thyra::ModelEvaluatorBase::OutArgs< Scalar > getOutArgs()
Get OutArgs the wrapper ModelEvalutor.
Thyra::ModelEvaluatorBase::OutArgs< Scalar > createOutArgsImpl() const
void initializeNewmark(Teuchos::RCP< const Vector > v_pred, Teuchos::RCP< const Vector > d_pred, Scalar delta_t, Scalar t, Scalar beta, Scalar gamma)
Set values needed in evalModelImpl.
void setAppModel(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &me)
Set the underlying application ModelEvaluator.
Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > getAppModel() const
Get the underlying application model 'f'.
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_p_space(int p) const
Get the p space.
Thyra::VectorBase< Scalar > Vector
Teuchos::RCP< const Vector > d_pred_
Teuchos::RCP< TimeDerivative< Scalar > > timeDer_
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_x_space() const
Get the x-solution space.
A ModelEvaluator for residual evaluations given a state. This ModelEvaluator takes a state...
Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > appModel_
Teuchos::RCP< const Thyra::LinearOpWithSolveFactoryBase< Scalar > > get_W_factory() const
Thyra::ModelEvaluatorBase::OutArgs< Scalar > wrapperOutArgs_
WrapperModelEvaluatorSecondOrder(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &appModel, const std::string schemeName)
Constructor.
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_f_space() const
A ModelEvaluator which wraps the application ModelEvaluator.
Thyra::ModelEvaluatorBase::InArgs< Scalar > getNominalValues() const
Teuchos::RCP< const Vector > v_pred_
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > create_W_op() const
Thyra::ModelEvaluatorBase::InArgs< Scalar > wrapperInArgs_
Teuchos::RCP< const Teuchos::Array< std::string > > get_p_names(int p) const
This interface defines the time derivative connection between an implicit Stepper and WrapperModelEva...
virtual void setForSolve(Teuchos::RCP< TimeDerivative< Scalar > > timeDer, Thyra::ModelEvaluatorBase::InArgs< Scalar > inArgs, Thyra::ModelEvaluatorBase::OutArgs< Scalar > outArgs, EVALUATION_TYPE=SOLVE_FOR_X)
Set parameters for application implicit ModelEvaluator solve.
virtual Thyra::ModelEvaluatorBase::InArgs< Scalar > getInArgs()
Get InArgs the wrapper ModelEvalutor.
WrapperModelEvaluatorSecondOrder()
Default constructor - not allowed.
virtual void setInArgs(Thyra::ModelEvaluatorBase::InArgs< Scalar > inArgs)
Set InArgs the wrapper ModelEvalutor.
void evalModelImpl(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
Teuchos::RCP< Teuchos::FancyOStream > out_
Solve for x and determine xDot from x.
Thyra::ModelEvaluatorBase::InArgs< Scalar > createInArgs() const
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_g_space(int i) const
Get the g space.
virtual void setOutArgs(Thyra::ModelEvaluatorBase::OutArgs< Scalar > outArgs)
Set OutArgs the wrapper ModelEvalutor.