Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Tempus_WrapperModelEvaluatorPairIMEX.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_ModelEvaluatorPairIMEX_hpp
10 #define Tempus_ModelEvaluatorPairIMEX_hpp
11 
13 
14 
15 namespace Tempus {
16 
17 /** \brief ModelEvaluator pair for implicit and explicit (IMEX) evaluations.
18  *
19  * This is an interface for a ModelEvaluator that takes a state, x,
20  * and determines the explicit and implicit residuals.
21  *
22  * This was taken and modified from Drekar's IMEXModelPair class.
23  */
24 template <typename Scalar>
26  : public Tempus::WrapperModelEvaluator<Scalar>
27 {
28 public:
29 
30  /// Initialize after setting member data.
31  virtual void initialize() = 0;
32 
33  /// \name Vector Methods.
34  //@{
35  virtual Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> >
36  get_x_space() const = 0;
37 
38  virtual Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> >
39  get_f_space() const = 0;
40 
41  virtual Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> >
42  get_g_space(int i) const = 0;
43 
44  virtual Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> >
45  get_p_space(int i) const = 0;
46  //@}
47 
48  //@{ \name Accessors
49  virtual void setExplicitModel(
50  const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> > & ) = 0;
51  virtual void setImplicitModel(
52  const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> > & ) = 0;
53  virtual Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >
54  getExplicitModel() const = 0;
55  virtual Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >
56  getImplicitModel() const = 0;
57  //@}
58 
59  /// \name Overridden from Thyra::StateFuncModelEvaluatorBase
60  //@{
61  virtual Teuchos::RCP<Thyra::LinearOpBase<Scalar> > create_W_op() const = 0;
62 
63  Teuchos::RCP<const Thyra::LinearOpWithSolveFactoryBase<Scalar> >
64  get_W_factory() const = 0;
65 
66  virtual Thyra::ModelEvaluatorBase::InArgs<Scalar>
67  getNominalValues() const = 0;
68 
69  virtual Thyra::ModelEvaluatorBase::InArgs<Scalar> createInArgs() const = 0;
70 
71  virtual Thyra::ModelEvaluatorBase::OutArgs<Scalar>
72  createOutArgsImpl() const = 0;
73 
74  virtual void evalModelImpl(
75  const Thyra::ModelEvaluatorBase::InArgs<Scalar> & in,
76  const Thyra::ModelEvaluatorBase::OutArgs<Scalar> & out) const = 0;
77  //@}
78 
79  /// Set parameters for application implicit ModelEvaluator solve.
80  virtual void setForSolve(Teuchos::RCP<TimeDerivative<Scalar> > timeDer,
81  Thyra::ModelEvaluatorBase::InArgs<Scalar> inArgs,
82  Thyra::ModelEvaluatorBase::OutArgs<Scalar> outArgs,
83  EVALUATION_TYPE evaluationType = SOLVE_FOR_X) = 0;
84 };
85 
86 } // namespace Tempus
87 
88 #endif // Tempus_ModelEvaluatorPairIMEX_hpp
EVALUATION_TYPE
EVALUATION_TYPE indicates the evaluation to apply to the implicit ODE.
virtual Thyra::ModelEvaluatorBase::InArgs< Scalar > createInArgs() const =0
virtual void evalModelImpl(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &in, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &out) const =0
virtual Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_x_space() const =0
Get the x-solution space.
ModelEvaluator pair for implicit and explicit (IMEX) evaluations.
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 Teuchos::RCP< Thyra::LinearOpBase< Scalar > > create_W_op() const =0
virtual void setExplicitModel(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &)=0
virtual Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > getExplicitModel() const =0
virtual Thyra::ModelEvaluatorBase::InArgs< Scalar > getNominalValues() const =0
virtual void initialize()=0
Initialize after setting member data.
A ModelEvaluator which wraps the application ModelEvaluator.
virtual void setImplicitModel(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &)=0
virtual Thyra::ModelEvaluatorBase::OutArgs< Scalar > createOutArgsImpl() const =0
virtual Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_f_space() const =0
This interface defines the time derivative connection between an implicit Stepper and WrapperModelEva...
virtual Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > getImplicitModel() const =0
Solve for x and determine xDot from x.
virtual void setForSolve(Teuchos::RCP< TimeDerivative< Scalar > > timeDer, Thyra::ModelEvaluatorBase::InArgs< Scalar > inArgs, Thyra::ModelEvaluatorBase::OutArgs< Scalar > outArgs, EVALUATION_TYPE evaluationType=SOLVE_FOR_X)=0
Set parameters for application implicit ModelEvaluator solve.
Teuchos::RCP< const Thyra::LinearOpWithSolveFactoryBase< Scalar > > get_W_factory() const =0