Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_Response_Residual.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Panzer: A partial differential equation assembly
4 // engine for strongly coupled complex multiphysics systems
5 //
6 // Copyright 2011 NTESS and the Panzer contributors.
7 // SPDX-License-Identifier: BSD-3-Clause
8 // *****************************************************************************
9 // @HEADER
10 
11 #ifndef __Panzer_Response_Residual_hpp__
12 #define __Panzer_Response_Residual_hpp__
13 
14 #include <string>
15 
16 #include "Teuchos_RCP.hpp"
17 
18 #include "Thyra_VectorBase.hpp"
19 #include "Thyra_LinearOpBase.hpp"
20 
21 #include "Panzer_ResponseBase.hpp"
23 #include "Panzer_Traits.hpp"
24 
25 namespace panzer {
26 
31 template <typename EvalT>
33 public:
34  Response_Residual(const std::string & responseName,
35  const Teuchos::RCP<const panzer::LinearObjFactory<panzer::Traits> > & /* lof */) :
36  ResponseBase(responseName) {}
37  virtual ~Response_Residual() {}
38  virtual void scatterResponse() {}
39  virtual void initializeResponse() {}
40 };
41 
48 template < >
50 private:
52 
55  // mutable because of lazy construction (as needed)
56 
57 public:
58  Response_Residual(const std::string & responseName,
60  : ResponseBase(responseName)
61  , linObjFactory_(lof) {}
62  virtual ~Response_Residual() {}
63 
68 
73 
77  void setResidual(const Teuchos::RCP<Thyra::VectorBase<panzer::Traits::RealType> > & res);
78 
82  Teuchos::RCP<Thyra::VectorBase<panzer::Traits::RealType> > allocateResidualVector() const;
83 
84  // Functions inherited from ResponseBase
85  virtual void initializeResponse() {}
86  virtual void scatterResponse() {}
87 };
88 
95 template < >
97 private:
99 
102  // mutable because of lazy construction (as needed)
103 
104 public:
105  Response_Residual(const std::string & responseName,
107  : ResponseBase(responseName)
108  , linObjFactory_(lof) {}
109  virtual ~Response_Residual() {}
110 
115 
120 
124  void setJacobian(const Teuchos::RCP<Thyra::LinearOpBase<panzer::Traits::RealType> > & res);
125 
130 
131  // Functions inherited from ResponseBase
132  virtual void initializeResponse() {}
133  virtual void scatterResponse() {}
134 };
135 
136 #ifdef Panzer_BUILD_HESSIAN_SUPPORT
137 
143 template < >
145 private:
147 
150  // mutable because of lazy construction (as needed)
151 
152 public:
153  Response_Residual(const std::string & responseName,
155  : ResponseBase(responseName)
156  , linObjFactory_(lof) {}
157  virtual ~Response_Residual() {}
158 
163 
168 
172  void setHessian(const Teuchos::RCP<Thyra::LinearOpBase<panzer::Traits::RealType> > & res);
173 
178 
179  // Functions inherited from ResponseBase
180  virtual void initializeResponse() {}
181  virtual void scatterResponse() {}
182 };
183 #endif
184 
185 }
186 
187 #endif
Response_Residual(const std::string &responseName, const Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > &lof)
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< const panzer::LinearObjFactory< panzer::Traits > > linObjFactory_
Teuchos::RCP< Thyra::VectorBase< panzer::Traits::RealType > > residual_
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)
Teuchos::RCP< Thyra::LinearOpBase< panzer::Traits::RealType > > hessian_
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< Thyra::LinearOpBase< panzer::Traits::RealType > > ghostedHessian_
Response_Residual(const std::string &responseName, const Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > &)
Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > linObjFactory_
Teuchos::RCP< Thyra::LinearOpBase< panzer::Traits::RealType > > jacobian_