Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Tempus_WrapperModelEvaluatorPairPartIMEX_CombinedFSA_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_ModelEvaluatorPairPartIMEX_CombinedFSA_decl_hpp
10 #define Tempus_ModelEvaluatorPairPartIMEX_CombinedFSA_decl_hpp
11 
13 #include "Tempus_WrapperModelEvaluatorPairPartIMEX_Basic.hpp"
14 #include "Tempus_CombinedForwardSensitivityModelEvaluator.hpp"
15 
16 #include "Thyra_ProductMultiVectorBase.hpp"
17 #include "Thyra_DefaultMultiVectorProductVectorSpace.hpp"
18 #include "Thyra_DefaultMultiVectorProductVector.hpp"
19 
20 namespace Tempus {
21 
22 /** \brief Specialization of IMEX-Part ME for "combined" FSA method.
23  *
24  * This specializes the implementation of several parts of
25  * WrapperModelEvaluatorPairPartIMEX_Basic for forward-sensitivity analysis
26  * with CombinedForwardSensitivityModelEvaluator. It deals with the product
27  * structure of the sensitivity solution vectors and incorporates the
28  * sensitivity of the implicit term with respect to the explicit-only vector.
29  */
30 template <typename Scalar>
32  : public SensitivityModelEvaluatorBase<Scalar>,
34 {
35 public:
36 
37  /// Constructor
39  const Teuchos::RCP<const WrapperModelEvaluatorPairPartIMEX_Basic<Scalar> >& forwardModel,
40  const Teuchos::RCP<const Teuchos::ParameterList>& pList = Teuchos::null);
41 
42  /// Destructor
44 
45  /// Initialize after setting member data.
46  virtual void initialize();
47 
48  /// \name Methods that apply to both explicit and implicit terms.
49  //@{
50 
51  virtual Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> >
52  get_p_space(int i) const;
53 
54  //@}
55 
56  //@{ \name Accessors
57 
58  /// Extract IMEX vector from a full solution vector
59  virtual Teuchos::RCP<Thyra::VectorBase<Scalar> >
61  const Teuchos::RCP<Thyra::VectorBase<Scalar> > & full) const;
62 
63  /// Extract IMEX vector for reading
64  virtual Teuchos::RCP<const Thyra::VectorBase<Scalar> >
66  const Teuchos::RCP<const Thyra::VectorBase<Scalar> > & full) const;
67 
68  /// Extract explicit-only vector from a full solution vector
69  virtual Teuchos::RCP<Thyra::VectorBase<Scalar> >
71  const Teuchos::RCP<Thyra::VectorBase<Scalar> > & full) const;
72 
73  /// Extract explicit-only vector for reading
74  virtual Teuchos::RCP<const Thyra::VectorBase<Scalar> >
76  const Teuchos::RCP<const Thyra::VectorBase<Scalar> > & full) const;
77 
78  //@}
79 
80  /// \name Overridden from Tempus::SensitivityModelEvaluatorBase
81  //@{
82 
83  /// Get the underlying forward model
84  virtual Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >
85  getForwardModel() const;
86 
87  //@}
88 
89  /// \name Overridden from Thyra::StateFuncModelEvaluatorBase
90  //@{
91 
92  virtual Thyra::ModelEvaluatorBase::InArgs<Scalar>
93  createInArgs() const;
94 
95  virtual void
97  const Thyra::ModelEvaluatorBase::InArgs<Scalar> & inArgs,
98  const Thyra::ModelEvaluatorBase::OutArgs<Scalar> & outArgs) const;
99 
100  //@}
101 
102  Teuchos::RCP<const Teuchos::ParameterList> getValidParameters() const;
103 
104 protected:
105 
107  typedef Thyra::DefaultMultiVectorProductVectorSpace<Scalar> DMVPVS;
108  typedef Thyra::DefaultMultiVectorProductVector<Scalar> DMVPV;
109  typedef Thyra::ProductMultiVectorBase<Scalar> PMVB;
111 
112  Teuchos::RCP<const WrapperModelEvaluatorPairPartIMEX_Basic<Scalar> > forwardModel_;
113  Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> > appExplicitModel_;
114  Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> > appImplicitModel_;
115  Teuchos::RCP<const FSAME> fsaExplicitModel_;
116  Teuchos::RCP<const FSAME> fsaImplicitModel_;
117 
120 
121  Teuchos::RCP<const DMVPVS> explicit_y_dydp_prod_space_;
122  Teuchos::RCP<const DMVPVS> explicit_dydp_prod_space_;
123  Teuchos::RCP<const DMVPVS> imex_x_dxdp_prod_space_;
124 
125  mutable Teuchos::RCP<Thyra::MultiVectorBase<Scalar> > my_dfdp_mv_;
126  mutable Teuchos::RCP<Thyra::LinearOpBase<Scalar> > my_dfdp_op_;
127 
128 };
129 
130 } // namespace Tempus
131 
132 #endif // Tempus_ModelEvaluatorPairPartIMEX_Basic_decl_hpp
WrapperModelEvaluatorPairPartIMEX_CombinedFSA(const Teuchos::RCP< const WrapperModelEvaluatorPairPartIMEX_Basic< Scalar > > &forwardModel, const Teuchos::RCP< const Teuchos::ParameterList > &pList=Teuchos::null)
Constructor.
Transform a ModelEvaluator&#39;s sensitivity equations to its residual.
virtual Teuchos::RCP< Thyra::VectorBase< Scalar > > getExplicitOnlyVector(const Teuchos::RCP< Thyra::VectorBase< Scalar > > &full) const
Extract explicit-only vector from a full solution vector.
virtual Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > getForwardModel() const
Get the underlying forward model.
Specialization of IMEX-Part ME for &quot;combined&quot; FSA method.
ModelEvaluator pair for implicit and explicit (IMEX) evaulations.
virtual Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_p_space(int i) const
Get the p space.
Teuchos::RCP< const WrapperModelEvaluatorPairPartIMEX_Basic< Scalar > > forwardModel_
A ModelEvaluator decorator for sensitivity analysis.
virtual void evalModelImpl(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
virtual Teuchos::RCP< Thyra::VectorBase< Scalar > > getIMEXVector(const Teuchos::RCP< Thyra::VectorBase< Scalar > > &full) const
Extract IMEX vector from a full solution vector.