Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DahlquistTestModel_decl.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_TEST_DAHLQUIST_TEST_MODEL_DECL_HPP
11 #define TEMPUS_TEST_DAHLQUIST_TEST_MODEL_DECL_HPP
12 
13 #include "Thyra_ModelEvaluator.hpp" // Interface
14 #include "Thyra_StateFuncModelEvaluatorBase.hpp" // Implementation
15 
16 namespace Tempus_Test {
17 
34 template <class Scalar>
36  public:
37  // Default Constructor
39 
40  // Constructor
41  DahlquistTestModel(Scalar lambda, bool includeXDot);
42 
43  void constructDahlquistTestModel(Scalar lambda, bool includeXDot);
44 
46  ~DahlquistTestModel() = default;
47 
50 
51  Scalar getLambda() const { return lambda_; }
52 
61  get_W_factory() const;
63 
68 
69  private:
73  void evalModelImpl(
75  const Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs_bar) const;
77 
78  private:
79  int dim_;
80  int Np_;
81  int np_;
82  int Ng_;
83  int ng_;
84  bool haveIC_;
86  Scalar lambda_;
88 
89  mutable bool isInitialized_;
98 
99  Scalar xIC_;
100  Scalar xDotIC_;
101 };
102 
103 } // namespace Tempus_Test
104 #endif // TEMPUS_TEST_DAHLQUIST_TEST_MODEL_DECL_HPP
Thyra::ModelEvaluatorBase::InArgs< Scalar > getNominalValues() const
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > x_space_
void evalModelImpl(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs_bar, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs_bar) const
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > p_space_
The classic Dahlquist Test Problem.
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > create_W_op() const
Scalar xIC_
Initial condition for x.
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > g_space_
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_x_space() const
Thyra::ModelEvaluatorBase::OutArgs< Scalar > createOutArgsImpl() const
Thyra::ModelEvaluatorBase::InArgs< Scalar > createInArgs() const
Thyra::ModelEvaluatorBase::InArgs< Scalar > inArgs_
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > f_space_
Thyra::ModelEvaluatorBase::InArgs< Scalar > getExactSolution(double t) const
Exact solution.
Scalar xDotIC_
Initial condition for xDot.
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_f_space() const
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > DxDp_space_
~DahlquistTestModel()=default
Default destructor.
Thyra::ModelEvaluatorBase::OutArgs< Scalar > outArgs_
Teuchos::RCP< const Thyra::LinearOpWithSolveFactoryBase< Scalar > > get_W_factory() const
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_g_space(int j) const
Teuchos::RCP< const Teuchos::Array< std::string > > get_p_names(int l) const
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_p_space(int l) const
Teuchos::RCP< Thyra::LinearOpWithSolveBase< Scalar > > create_W() const
void constructDahlquistTestModel(Scalar lambda, bool includeXDot)
Thyra::ModelEvaluatorBase::InArgs< Scalar > nominalValues_