Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Tempus_WrapperModelEvaluatorPairIMEX_CombinedFSA.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_ModelEvaluatorPairIMEX_CombinedFSA_hpp
10 #define Tempus_ModelEvaluatorPairIMEX_CombinedFSA_hpp
11 
13 #include "Tempus_WrapperModelEvaluatorPairIMEX_Basic.hpp"
14 #include "Tempus_CombinedForwardSensitivityModelEvaluator.hpp"
15 
16 namespace Tempus {
17 
18 /** \brief Specialization of IMEX ME for "combined" FSA method.
19  *
20  * For the combined forward sensitivitymethod, the implementation found in
21  * WrapperModelEvaluatorPairIMEX_Basic works just fine. We go ahead and
22  * create a specialized class to follow the pattern of other methods and also
23  * handle the wrapping of the underlying MEs.
24  */
25 template <typename Scalar>
27  : public SensitivityModelEvaluatorBase<Scalar>,
29 {
30 public:
31 
32  /// Constructor
34  const Teuchos::RCP<const WrapperModelEvaluatorPairIMEX_Basic<Scalar> >& forwardModel,
35  const Teuchos::RCP<const Teuchos::ParameterList>& pList = Teuchos::null)
36  {
37  forwardModel_ = forwardModel;
38  appExplicitModel_ = forwardModel_->getExplicitModel();
39  appImplicitModel_ = forwardModel_->getImplicitModel();
40  fsaExplicitModel_ = rcp(new FSAME(appExplicitModel_, pList));
41  fsaImplicitModel_ = rcp(new FSAME(appImplicitModel_, pList));
43  }
44 
45  /// Destructor
47 
48  /// \name Overridden from Tempus::SensitivityModelEvaluatorBase
49  //@{
50 
51  /// Get the underlying forward model
52  virtual Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >
54  {
55  return forwardModel_;
56  }
57 
58  //@}
59 
60 private:
61 
62  /// Default constructor - not allowed
64 
65 protected:
66 
69 
70  Teuchos::RCP<const WrapperModelEvaluatorPairIMEX_Basic<Scalar> > forwardModel_;
71  Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> > appExplicitModel_;
72  Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> > appImplicitModel_;
73  Teuchos::RCP<FSAME> fsaExplicitModel_;
74  Teuchos::RCP<FSAME> fsaImplicitModel_;
75 };
76 
77 } // namespace Tempus
78 
79 #endif // Tempus_ModelEvaluatorPairIMEX_CombinedFSA_hpp
Transform a ModelEvaluator&#39;s sensitivity equations to its residual.
ModelEvaluator pair for implicit and explicit (IMEX) evaulations.
Specialization of IMEX ME for &quot;combined&quot; FSA method.
virtual Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > getForwardModel() const
Get the underlying forward model.
void setup(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &explicitModel, const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &implicitModel)
Setup ME when using default constructor – for derived classes.
WrapperModelEvaluatorPairIMEX_CombinedFSA(const Teuchos::RCP< const WrapperModelEvaluatorPairIMEX_Basic< Scalar > > &forwardModel, const Teuchos::RCP< const Teuchos::ParameterList > &pList=Teuchos::null)
Constructor.
Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > appExplicitModel_
Teuchos::RCP< const WrapperModelEvaluatorPairIMEX_Basic< Scalar > > forwardModel_
Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > appImplicitModel_
A ModelEvaluator decorator for sensitivity analysis.