Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SinCosModel_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_SINCOS_MODEL_DECL_HPP
10 #define TEMPUS_TEST_SINCOS_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 
90 template<class Scalar>
92  : public Thyra::StateFuncModelEvaluatorBase<Scalar>,
94 {
95  public:
96 
97  // Constructor
99 
100  // Exact solution
102 
103  // Exact sensitivity solution
105 
108 
116 
120 
122 
128 
129 private:
130 
131  void setupInOutArgs_() const;
132 
136  void evalModelImpl(
139  ) const;
141 
142  void calculateCoeffFromIC_();
143 
144 private:
145  int dim_;
146  int Np_;
147  int np_;
148  int Ng_;
149  int ng_;
150  bool haveIC_;
153  mutable bool isInitialized_;
162 
163  // Parameters for the model: x_0(t) = a + b*sin(f*t+phi)
164  // x_1(t) = b*f*cos(f*t+phi)
165  Scalar a_;
166  Scalar f_;
167  Scalar L_;
168  Scalar phi_;
169  Scalar b_;
170  Scalar t0_ic_;
171  Scalar x0_ic_;
172  Scalar x1_ic_;
173 };
174 
175 
177 //Teuchos::RCP<SinCosModel> sineCosineModel(
178 // Teuchos::RCP<Teuchos::ParameterList> pList_)
179 //{
180 // Teuchos::RCP<SinCosModel> model = rcp(new SinCosModel(pList_));
181 // return(model);
182 //}
183 
184 
185 } // namespace Tempus_Test
186 #endif // TEMPUS_TEST_SINCOS_MODEL_DECL_HPP
Scalar b_
Parameter determined from the IC.
Scalar L_
Model parameter.
int Ng_
Number of observation functions (1)
int ng_
Number of elements in this observation function (1)
Thyra::ModelEvaluatorBase::InArgs< Scalar > nominalValues_
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > DxDp_space_
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > p_space_
Scalar f_
Model parameter.
Thyra::ModelEvaluatorBase::InArgs< Scalar > createInArgs() const
bool useDfDpAsTangent_
Treat DfDp OutArg as tangent (df/dx*dx/dp+df/dp)
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > f_space_
Sine-Cosine model problem from Rythmos. This is a canonical Sine-Cosine differential equation with a...
int dim_
Number of state unknowns (2)
int Np_
Number of parameter vectors (1)
Teuchos::RCP< Thyra::LinearOpWithSolveBase< Scalar > > create_W() const
Thyra::ModelEvaluatorBase::InArgs< Scalar > getNominalValues() const
bool haveIC_
false =&gt; no nominal values are provided (default=true)
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_f_space() const
Thyra::ModelEvaluatorBase::OutArgs< Scalar > outArgs_
bool acceptModelParams_
Changes inArgs to require parameters.
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > create_W_op() const
Scalar t0_ic_
Time value where the initial condition is specified.
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_x_space() const
Thyra::ModelEvaluatorBase::InArgs< Scalar > getExactSolution(double t) const
Thyra::ModelEvaluatorBase::InArgs< Scalar > inArgs_
SinCosModel(Teuchos::RCP< Teuchos::ParameterList > pList=Teuchos::null)
int np_
Number of parameters in this vector (2)
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_p_space(int l) const
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > g_space_
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
void evalModelImpl(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs_bar, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs_bar) const
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > x_space_
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_g_space(int j) const
Scalar x1_ic_
Initial condition for x1.
Thyra::ModelEvaluatorBase::OutArgs< Scalar > createOutArgsImpl() const
Teuchos::RCP< const Teuchos::Array< std::string > > get_p_names(int l) const
Scalar phi_
Parameter determined from the IC.
Thyra::ModelEvaluatorBase::InArgs< Scalar > getExactSensSolution(int j, double t) const
Scalar x0_ic_
Initial condition for x0.
Teuchos::RCP< const Thyra::LinearOpWithSolveFactoryBase< Scalar > > get_W_factory() const
Scalar a_
Model parameter.
void setParameterList(Teuchos::RCP< Teuchos::ParameterList > const &paramList)