Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros 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 
13 #include "Thyra_StateFuncModelEvaluatorBase.hpp"
14 
15 namespace Tempus {
16 
17 /// EVALUATION_TYPE indicates the evaluation to apply to the implicit ODE.
19  EVALUATE_RESIDUAL, ///< Evaluate residual for the implicit ODE
20  SOLVE_FOR_X, ///< Solve for x and determine xDot from x.
21  SOLVE_FOR_XDOT_CONST_X ///< Solve for xDot keeping x constant (for ICs).
22 };
23 
24 
25 /** \brief A ModelEvaluator which wraps the application ModelEvaluator.
26  *
27  * The WrapperModelEvaluator takes a state, \f$x\f$, computes time
28  * derivative(s), \f$\dot{x}\f$ and/or \f$\ddot{x}\f$, from the
29  * implicit stepper (StepperImplicit) and calls the application
30  * ModelEvaluator to determine its residual, \f$\mathcal{F}(x)\f$,
31  * which is suitable for the nonlinear solve.
32  */
33 template <typename Scalar>
34 class WrapperModelEvaluator : public Thyra::StateFuncModelEvaluatorBase<Scalar>
35 {
36 public:
37 
38  /// \name Vector Methods.
39  //@{
40  /// Get the x-solution space
41  virtual Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> >
42  get_x_space() const = 0;
43 
44  /// Get the g space
45  virtual Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> >
46  get_g_space(int i) const = 0;
47 
48  /// Get the p space
49  virtual Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> >
50  get_p_space(int i) const = 0;
51  //@}
52 
53  /// Set the underlying application ModelEvaluator
54  virtual void setAppModel(
55  const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> > & me) = 0;
56 
57  /// Get the underlying application ModelEvaluator
58  virtual Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >
59  getAppModel() const = 0;
60 
61  /// Set InArgs the wrapper ModelEvalutor.
62  virtual void setInArgs(Thyra::ModelEvaluatorBase::InArgs<Scalar> inArgs) = 0;
63 
64  /// Get InArgs the wrapper ModelEvalutor.
65  virtual Thyra::ModelEvaluatorBase::InArgs<Scalar> getInArgs() = 0;
66 
67  /// Set OutArgs the wrapper ModelEvalutor.
68  virtual void setOutArgs(Thyra::ModelEvaluatorBase::OutArgs<Scalar> outArgs)=0;
69 
70  /// Get OutArgs the wrapper ModelEvalutor.
71  virtual Thyra::ModelEvaluatorBase::OutArgs<Scalar> getOutArgs() = 0;
72 
73  /// Set parameters for application implicit ModelEvaluator solve.
74  virtual void setForSolve(Teuchos::RCP<TimeDerivative<Scalar> > td,
75  Thyra::ModelEvaluatorBase::InArgs<Scalar> inArgs,
76  Thyra::ModelEvaluatorBase::OutArgs<Scalar> outArgs,
77  EVALUATION_TYPE evaluationType = SOLVE_FOR_X) = 0;
78 };
79 
80 } // namespace Tempus
81 
82 #endif // Tempus_WrapperModelEvaluator_hpp
virtual void setOutArgs(Thyra::ModelEvaluatorBase::OutArgs< Scalar > outArgs)=0
Set OutArgs the wrapper ModelEvalutor.
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 void setInArgs(Thyra::ModelEvaluatorBase::InArgs< Scalar > inArgs)=0
Set InArgs the wrapper ModelEvalutor.
virtual Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_p_space(int i) const =0
Get the p space.
virtual void setForSolve(Teuchos::RCP< TimeDerivative< Scalar > > td, Thyra::ModelEvaluatorBase::InArgs< Scalar > inArgs, Thyra::ModelEvaluatorBase::OutArgs< Scalar > outArgs, EVALUATION_TYPE evaluationType=SOLVE_FOR_X)=0
Set parameters for application implicit ModelEvaluator solve.
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.
virtual Thyra::ModelEvaluatorBase::InArgs< Scalar > getInArgs()=0
Get InArgs the wrapper ModelEvalutor.
Solve for xDot keeping x constant (for ICs).
This interface defines the time derivative connection between an implicit Stepper and WrapperModelEva...
virtual Thyra::ModelEvaluatorBase::OutArgs< Scalar > getOutArgs()=0
Get OutArgs the wrapper ModelEvalutor.
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.