Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HarmonicOscillatorModel_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_TEST_HARMONIC_OSCILLATOR_MODEL_DECL_HPP
10 #define TEMPUS_TEST_HARMONIC_OSCILLATOR_MODEL_DECL_HPP
11 
12 #include "Thyra_ModelEvaluator.hpp" // Interface
13 #include "Thyra_StateFuncModelEvaluatorBase.hpp" // Implementation
14 
15 #include "Teuchos_ParameterListAcceptorDefaultBase.hpp"
17 
18 namespace Tempus_Test {
19 
51 template<class Scalar>
53  : public Thyra::StateFuncModelEvaluatorBase<Scalar>,
55 {
56  public:
57 
58  // Constructor
59  HarmonicOscillatorModel(Teuchos::RCP<Teuchos::ParameterList> pList = Teuchos::null, const bool use_accel_IC = false);
60 
61  // Exact solution
63 
66 
74 
78 
80 
86 
87 private:
88 
89  void setupInOutArgs_() const;
90 
94  void evalModelImpl(
97  ) const;
99 
100 private:
108  int vecLength_; //Number of state unknowns (1)
109  int numResponses_; //Number of responses (1)
113  mutable bool isInitialized_;
114  double c_; //damping coefficient
115  double f_; //forcing coefficient
116  double k_; //coefficient multiplying x in ODE
117  double m_; //mass coefficient
119 };
120 
121 
122 
123 } // namespace Tempus_Test
124 #endif // TEMPUS_TEST_HARMONIC_OSCILLATOR_MODEL_DECL_HPP
Thyra::ModelEvaluatorBase::InArgs< Scalar > getNominalValues() const
Thyra::ModelEvaluatorBase::OutArgs< Scalar > createOutArgsImpl() const
Teuchos::RCP< Thyra::VectorBase< Scalar > > p_init_
Teuchos::RCP< Thyra::VectorBase< Scalar > > x_dot_vec_
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > g_space_
Teuchos::RCP< const Thyra::LinearOpWithSolveFactoryBase< Scalar > > get_W_factory() const
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Teuchos::RCP< const Teuchos::Array< std::string > > get_p_names(int l) const
Thyra::ModelEvaluatorBase::InArgs< Scalar > getExactSolution(double t) const
void evalModelImpl(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs_bar, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs_bar) const
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_x_space() const
Consider the ODE: where is a constant, is a constant damping parameter, is a constant forcing par...
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_g_space(int j) const
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > p_space_
Teuchos::RCP< Teuchos::FancyOStream > out_
Teuchos::RCP< Thyra::VectorBase< Scalar > > x_dot_dot_vec_
Thyra::ModelEvaluatorBase::InArgs< Scalar > nominalValues_
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_p_space(int l) const
Teuchos::RCP< Thyra::LinearOpWithSolveBase< Scalar > > create_W() const
void setParameterList(Teuchos::RCP< Teuchos::ParameterList > const &paramList)
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > x_space_
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > create_W_op() const
HarmonicOscillatorModel(Teuchos::RCP< Teuchos::ParameterList > pList=Teuchos::null, const bool use_accel_IC=false)
Teuchos::RCP< Thyra::VectorBase< Scalar > > x_vec_
Thyra::ModelEvaluatorBase::InArgs< Scalar > createInArgs() const
Thyra::ModelEvaluatorBase::OutArgs< Scalar > outArgs_
Thyra::ModelEvaluatorBase::InArgs< Scalar > inArgs_
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_f_space() const