Tempus Version of the Day
Time Integration
Loading...
Searching...
No Matches
Tempus_WrapperModelEvaluator.hpp
Go to the documentation of this file.
1//@HEADER
2// *****************************************************************************
3// Tempus: Time Integration and Sensitivity Analysis Package
4//
5// Copyright 2017 NTESS and the Tempus contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8//@HEADER
9
10#ifndef Tempus_WrapperModelEvaluator_hpp
11#define Tempus_WrapperModelEvaluator_hpp
12
13#include "Tempus_config.hpp"
15#include "Thyra_StateFuncModelEvaluatorBase.hpp"
16
17namespace Tempus {
18
25
26template <class Scalar>
28 public:
31 : timeDer_(Teuchos::null),
32 timeStepSize_(Scalar(0.0)),
33 alpha_(Scalar(0.0)),
34 beta_(Scalar(0.0)),
37 {
38 }
41 Scalar timeStepSize, Scalar alpha, Scalar beta,
42 EVALUATION_TYPE evaluationType = SOLVE_FOR_X,
43 int stageNumber = 0)
44 : timeDer_(timeDer),
45 timeStepSize_(timeStepSize),
46 alpha_(alpha),
47 beta_(beta),
48 evaluationType_(evaluationType),
49 stageNumber_(stageNumber)
50 {
51 }
52
53 Teuchos::RCP<TimeDerivative<Scalar> > timeDer_;
55 Scalar alpha_;
56 Scalar beta_;
59};
60
69template <typename Scalar>
71 : public Thyra::StateFuncModelEvaluatorBase<Scalar> {
72 public:
74
75
76 virtual Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> > get_x_space()
77 const = 0;
78
80 virtual Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> > get_g_space(
81 int i) const = 0;
82
84 virtual Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> > get_p_space(
85 int i) const = 0;
87
89 virtual void setAppModel(
90 const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >& me) = 0;
91
93 virtual Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> > getAppModel()
94 const = 0;
95
97 virtual void setForSolve(
98 const Teuchos::RCP<Thyra::VectorBase<Scalar> >& x,
99 const Teuchos::RCP<Thyra::VectorBase<Scalar> >& xDot, const Scalar time,
100 const Teuchos::RCP<ImplicitODEParameters<Scalar> >& p,
101 const Teuchos::RCP<Thyra::VectorBase<Scalar> >& y = Teuchos::null,
102 const int index = -1 /* index and y are for IMEX_RK_Partition */) = 0;
103};
104
105} // namespace Tempus
106
107#endif // Tempus_WrapperModelEvaluator_hpp
Teuchos::RCP< TimeDerivative< Scalar > > timeDer_
ImplicitODEParameters(Teuchos::RCP< TimeDerivative< Scalar > > timeDer, Scalar timeStepSize, Scalar alpha, Scalar beta, EVALUATION_TYPE evaluationType=SOLVE_FOR_X, int stageNumber=0)
Constructor.
This interface defines the time derivative connection between an implicit Stepper and WrapperModelEva...
A ModelEvaluator which wraps the application ModelEvaluator.
virtual void setForSolve(const Teuchos::RCP< Thyra::VectorBase< Scalar > > &x, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &xDot, const Scalar time, const Teuchos::RCP< ImplicitODEParameters< Scalar > > &p, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &y=Teuchos::null, const int index=-1)=0
Set parameters for application implicit ModelEvaluator solve.
virtual Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_p_space(int i) const =0
Get the p space.
virtual Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > getAppModel() const =0
Get the underlying application ModelEvaluator.
virtual void setAppModel(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &me)=0
Set the underlying application ModelEvaluator.
virtual Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_g_space(int i) const =0
Get the g space.
virtual Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_x_space() const =0
Get the x-solution space.
EVALUATION_TYPE
EVALUATION_TYPE indicates the evaluation to apply to the implicit ODE.
@ SOLVE_FOR_XDOT_CONST_X
Solve for xDot keeping x constant (for ICs).
@ SOLVE_FOR_X
Solve for x and determine xDot from x.
@ EVALUATE_RESIDUAL
Evaluate residual for the implicit ODE.