Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Tempus_WrapperModelEvaluator.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ****************************************************************************
3 // Tempus: Copyright (2017) Sandia Corporation
4 //
5 // Distributed under BSD 3-clause license (See accompanying file Copyright.txt)
6 // ****************************************************************************
7 // @HEADER
8 
9 #ifndef Tempus_WrapperModelEvaluator_hpp
10 #define Tempus_WrapperModelEvaluator_hpp
11 
12 #include "Tempus_config.hpp"
14 #include "Thyra_StateFuncModelEvaluatorBase.hpp"
15 
16 namespace Tempus {
17 
23 };
24 
25 template <class Scalar>
27  public:
30  : timeDer_(Teuchos::null),
31  timeStepSize_(Scalar(0.0)),
32  alpha_(Scalar(0.0)),
33  beta_(Scalar(0.0)),
35  stageNumber_(0)
36  {
37  }
40  Scalar timeStepSize, Scalar alpha, Scalar beta,
41  EVALUATION_TYPE evaluationType = SOLVE_FOR_X,
42  int stageNumber = 0)
43  : timeDer_(timeDer),
44  timeStepSize_(timeStepSize),
45  alpha_(alpha),
46  beta_(beta),
47  evaluationType_(evaluationType),
48  stageNumber_(stageNumber)
49  {
50  }
51 
53  Scalar timeStepSize_;
54  Scalar alpha_;
55  Scalar beta_;
58 };
59 
68 template <typename Scalar>
70  : public Thyra::StateFuncModelEvaluatorBase<Scalar> {
71  public:
73 
76  const = 0;
77 
80  int i) const = 0;
81 
84  int i) const = 0;
86 
88  virtual void setAppModel(
89  const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >& me) = 0;
90 
93  const = 0;
94 
96  virtual void setForSolve(
98  const Teuchos::RCP<Thyra::VectorBase<Scalar> >& xDot, const Scalar time,
100  const Teuchos::RCP<Thyra::VectorBase<Scalar> >& y = Teuchos::null,
101  const int index = -1 /* index and y are for IMEX_RK_Partition */) = 0;
102 };
103 
104 } // namespace Tempus
105 
106 #endif // Tempus_WrapperModelEvaluator_hpp
ImplicitODEParameters(Teuchos::RCP< TimeDerivative< Scalar > > timeDer, Scalar timeStepSize, Scalar alpha, Scalar beta, EVALUATION_TYPE evaluationType=SOLVE_FOR_X, int stageNumber=0)
Constructor.
Evaluate residual for the implicit ODE.
EVALUATION_TYPE
EVALUATION_TYPE indicates the evaluation to apply to the implicit ODE.
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_p_space(int i) const =0
Get the p space.
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.
Teuchos::RCP< TimeDerivative< Scalar > > timeDer_
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.
A ModelEvaluator which wraps the application ModelEvaluator.
Solve for xDot keeping x constant (for ICs).
This interface defines the time derivative connection between an implicit Stepper and WrapperModelEva...
Solve for x and determine xDot from x.
virtual Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_x_space() const =0
Get the x-solution space.