Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Tempus_WrapperModelEvaluatorBasic_decl.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_WrapperModelEvaluatorBasic_decl_hpp
10 #define Tempus_WrapperModelEvaluatorBasic_decl_hpp
11 
12 #include <functional>
13 #include "Tempus_config.hpp"
15 
16 namespace Tempus {
17 
18 
26 template <typename Scalar>
28  : public Tempus::WrapperModelEvaluator<Scalar>
29 {
30 public:
31 
34  const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >& appModel)
35  : appModel_(appModel), timeDer_(Teuchos::null), evaluationType_(SOLVE_FOR_X)
36  {
37  wrapperInArgs_ = this->createInArgs();
39  }
40 
42  virtual void setAppModel(
44  { appModel_ = me; }
45 
48  getAppModel() const { return appModel_; }
49 
52  { wrapperInArgs_.setArgs(inArgs); }
53 
56  { return wrapperInArgs_; }
57 
60  { wrapperOutArgs_.setArgs(outArgs); }
61 
64  { return wrapperOutArgs_; }
65 
70  EVALUATION_TYPE evaluationType = SOLVE_FOR_X)
71  {
72  timeDer_ = timeDer;
73  wrapperInArgs_.setArgs(inArgs);
74  wrapperOutArgs_.setArgs(outArgs);
75  evaluationType_ = evaluationType;
76  }
77 
79 
81  { return appModel_->create_W_op(); }
82 
84  { return appModel_->create_W_prec(); }
85 
87  get_W_factory() const { return appModel_->get_W_factory(); }
88 
90  { return appModel_->get_f_space(); }
91 
93  { return appModel_->get_p_space(p); }
94 
96  { return appModel_->get_p_names(p); }
97 
99  { return appModel_->get_x_space(); }
100 
102  { return appModel_->get_g_space(i); }
103 
105  { return appModel_->getNominalValues(); }
106 
109 
110  void evalModelImpl(
112  const Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs) const;
114 
115 private:
118 
119 private:
125 };
126 
127 } // namespace Tempus
128 
129 #endif // Tempus_WrapperModelEvaluatorBasic_decl_hpp
virtual ModelEvaluatorBase::OutArgs< Scalar > createOutArgs() const =0
Teuchos::RCP< const Teuchos::Array< std::string > > get_p_names(int p) const
virtual void setInArgs(Thyra::ModelEvaluatorBase::InArgs< Scalar > inArgs)
Set InArgs the wrapper ModelEvalutor.
EVALUATION_TYPE
EVALUATION_TYPE indicates the evaluation to apply to the implicit ODE.
Thyra::ModelEvaluatorBase::InArgs< Scalar > wrapperInArgs_
virtual Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > getAppModel() const
Get the underlying application model &#39;f&#39;.
virtual void setOutArgs(Thyra::ModelEvaluatorBase::OutArgs< Scalar > outArgs)
Set OutArgs the wrapper ModelEvalutor.
Thyra::ModelEvaluatorBase::InArgs< Scalar > getNominalValues() const
Teuchos::RCP< TimeDerivative< Scalar > > timeDer_
Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > appModel_
Teuchos::RCP< const Thyra::LinearOpWithSolveFactoryBase< Scalar > > get_W_factory() const
virtual Thyra::ModelEvaluatorBase::InArgs< Scalar > getInArgs()
Get InArgs the wrapper ModelEvalutor.
virtual void setForSolve(Teuchos::RCP< TimeDerivative< Scalar > > timeDer, Thyra::ModelEvaluatorBase::InArgs< Scalar > inArgs, Thyra::ModelEvaluatorBase::OutArgs< Scalar > outArgs, EVALUATION_TYPE evaluationType=SOLVE_FOR_X)
Set parameters for application implicit ModelEvaluator solve.
A ModelEvaluator which wraps the application ModelEvaluator.
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_g_space(int i) const
Get the g space.
virtual void setAppModel(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &me)
Set the underlying application ModelEvaluator.
WrapperModelEvaluatorBasic(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &appModel)
Constructor.
virtual Thyra::ModelEvaluatorBase::OutArgs< Scalar > getOutArgs()
Get OutArgs the wrapper ModelEvalutor.
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > create_W_op() const
Teuchos::RCP< Thyra::PreconditionerBase< Scalar > > create_W_prec() const
This interface defines the time derivative connection between an implicit Stepper and WrapperModelEva...
void evalModelImpl(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_f_space() const
WrapperModelEvaluatorBasic()
Default constructor - not allowed.
Thyra::ModelEvaluatorBase::InArgs< Scalar > createInArgs() const
Thyra::ModelEvaluatorBase::OutArgs< Scalar > wrapperOutArgs_
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...
Solve for x and determine xDot from x.
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_p_space(int p) const
Get the p space.
Thyra::ModelEvaluatorBase::OutArgs< Scalar > createOutArgsImpl() const