Panzer  Version of the Day
Panzer_Response_Residual.hpp
Go to the documentation of this file.
1 #ifndef __Panzer_Response_Residual_hpp__
2 #define __Panzer_Response_Residual_hpp__
3 
4 #include <string>
5 
6 #include "Teuchos_RCP.hpp"
7 
8 #include "Thyra_VectorBase.hpp"
9 #include "Thyra_LinearOpBase.hpp"
10 
11 #include "Panzer_ResponseBase.hpp"
13 #include "Panzer_Traits.hpp"
14 
15 namespace panzer {
16 
21 template <typename EvalT>
23 public:
24  Response_Residual(const std::string & responseName,
26  ResponseBase(responseName) {}
27  virtual ~Response_Residual() {}
28  virtual void scatterResponse() {}
29  virtual void initializeResponse() {}
30 };
31 
38 template < >
40 private:
42 
45  // mutable because of lazy construction (as needed)
46 
47 public:
48  Response_Residual(const std::string & responseName,
50  : ResponseBase(responseName)
51  , linObjFactory_(lof) {}
52  virtual ~Response_Residual() {}
53 
58 
63 
67  void setResidual(const Teuchos::RCP<Thyra::VectorBase<panzer::Traits::RealType> > & res);
68 
72  Teuchos::RCP<Thyra::VectorBase<panzer::Traits::RealType> > allocateResidualVector() const;
73 
74  // Functions inherited from ResponseBase
75  virtual void initializeResponse() {}
76  virtual void scatterResponse() {}
77 };
78 
85 template < >
87 private:
89 
92  // mutable because of lazy construction (as needed)
93 
94 public:
95  Response_Residual(const std::string & responseName,
97  : ResponseBase(responseName)
98  , linObjFactory_(lof) {}
99  virtual ~Response_Residual() {}
100 
105 
110 
114  void setJacobian(const Teuchos::RCP<Thyra::LinearOpBase<panzer::Traits::RealType> > & res);
115 
120 
121  // Functions inherited from ResponseBase
122  virtual void initializeResponse() {}
123  virtual void scatterResponse() {}
124 };
125 
126 #ifdef Panzer_BUILD_HESSIAN_SUPPORT
127 
133 template < >
134 class Response_Residual<panzer::Traits::Hessian> : public ResponseBase {
135 private:
137 
140  // mutable because of lazy construction (as needed)
141 
142 public:
143  Response_Residual(const std::string & responseName,
145  : ResponseBase(responseName)
146  , linObjFactory_(lof) {}
147  virtual ~Response_Residual() {}
148 
153 
158 
162  void setHessian(const Teuchos::RCP<Thyra::LinearOpBase<panzer::Traits::RealType> > & res);
163 
168 
169  // Functions inherited from ResponseBase
170  virtual void initializeResponse() {}
171  virtual void scatterResponse() {}
172 };
173 #endif
174 
175 }
176 
177 #endif
Response_Residual(const std::string &responseName, const Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > &lof)
Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > linObjFactory_
Response_Residual(const std::string &responseName, const Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > &lof)
Teuchos::RCP< Thyra::VectorBase< panzer::Traits::RealType > > residual_
Response_Residual(const std::string &responseName, const Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > &lof)
Teuchos::RCP< Thyra::VectorBase< panzer::Traits::RealType > > ghostedResidual_
virtual void scatterResponse()
Prepare the response for access by the user (do global communication)
virtual void scatterResponse()
Prepare the response for access by the user (do global communication)
virtual void scatterResponse()
Prepare the response for access by the user (do global communication)
Teuchos::RCP< Thyra::LinearOpBase< panzer::Traits::RealType > > ghostedJacobian_
Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > linObjFactory_
Teuchos::RCP< Thyra::LinearOpBase< panzer::Traits::RealType > > jacobian_