Panzer
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
disc-fe
src
responses
Panzer_Response_Residual.cpp
Go to the documentation of this file.
1
#include "
Panzer_Response_Residual.hpp
"
2
3
#include "
Panzer_ThyraObjFactory.hpp
"
4
#include "
Panzer_ThyraObjContainer.hpp
"
5
6
#include "Thyra_VectorSpaceBase.hpp"
7
8
namespace
panzer
{
9
12
13
Teuchos::RCP<Thyra::VectorBase<panzer::Traits::RealType> >
14
Response_Residual<panzer::Traits::Residual>::
15
getGhostedResidual
()
const
16
{
17
using
Teuchos::RCP;
18
using
Teuchos::rcp_dynamic_cast;
19
20
typedef
ThyraObjContainer<panzer::Traits::RealType>
TOC;
21
22
// if already computed, uses that ghosted vector
23
if
(
ghostedResidual_
!=Teuchos::null)
24
return
ghostedResidual_
;
25
26
// otherwise, allocate a new ghosted vector
27
RCP<LinearObjContainer> loc =
linObjFactory_
->buildGhostedLinearObjContainer();
28
linObjFactory_
->initializeGhostedContainer(
LinearObjContainer::F
,*loc);
29
30
RCP<TOC> th_loc = rcp_dynamic_cast<TOC>(loc);
31
return
th_loc->get_f_th();
32
}
33
34
Teuchos::RCP<Thyra::VectorBase<panzer::Traits::RealType> >
35
Response_Residual<panzer::Traits::Residual>::
36
getResidual
()
const
37
{
38
return
residual_
;
39
}
40
41
void
42
Response_Residual<panzer::Traits::Residual>::
43
setResidual
(
const
Teuchos::RCP<
Thyra::VectorBase<panzer::Traits::RealType>
> & res)
44
{
45
residual_
= res;
46
}
47
48
Teuchos::RCP<Thyra::VectorBase<panzer::Traits::RealType> >
49
Response_Residual<panzer::Traits::Residual>::
50
allocateResidualVector
()
const
51
{
52
using
Teuchos::RCP;
53
using
Teuchos::rcp_dynamic_cast;
54
55
typedef
ThyraObjFactory<panzer::Traits::RealType>
ObjFactory;
56
57
RCP<const ObjFactory> objFactory = rcp_dynamic_cast<const ObjFactory>(
linObjFactory_
);
58
return
Thyra::createMember(objFactory->getThyraRangeSpace());
59
}
60
63
64
Teuchos::RCP<Thyra::LinearOpBase<panzer::Traits::RealType> >
65
Response_Residual<panzer::Traits::Jacobian>::
66
getGhostedJacobian
()
const
67
{
68
using
Teuchos::RCP;
69
using
Teuchos::rcp_dynamic_cast;
70
71
typedef
ThyraObjContainer<panzer::Traits::RealType>
TOC;
72
73
// if already computed, uses that ghosted vector
74
if
(
ghostedJacobian_
!=Teuchos::null)
75
return
ghostedJacobian_
;
76
77
// otherwise, allocate a new ghosted vector
78
RCP<LinearObjContainer> loc =
linObjFactory_
->buildGhostedLinearObjContainer();
79
linObjFactory_
->initializeGhostedContainer(
LinearObjContainer::Mat
,*loc);
80
81
RCP<TOC> th_loc = rcp_dynamic_cast<TOC>(loc);
82
return
th_loc->get_A_th();
83
}
84
85
Teuchos::RCP<Thyra::LinearOpBase<panzer::Traits::RealType> >
86
Response_Residual<panzer::Traits::Jacobian>::
87
getJacobian
()
const
88
{
89
return
jacobian_
;
90
}
91
92
void
93
Response_Residual<panzer::Traits::Jacobian>::
94
setJacobian
(
const
Teuchos::RCP<
Thyra::LinearOpBase<panzer::Traits::RealType>
> & jac)
95
{
96
jacobian_
= jac;
97
}
98
99
Teuchos::RCP<Thyra::LinearOpBase<panzer::Traits::RealType> >
100
Response_Residual<panzer::Traits::Jacobian>::
101
allocateJacobian
()
const
102
{
103
using
Teuchos::RCP;
104
using
Teuchos::rcp_dynamic_cast;
105
106
typedef
ThyraObjFactory<panzer::Traits::RealType>
ObjFactory;
107
108
RCP<const ObjFactory> objFactory = rcp_dynamic_cast<const ObjFactory>(
linObjFactory_
);
109
return
objFactory->getThyraMatrix();
110
}
111
114
115
#ifdef Panzer_BUILD_HESSIAN_SUPPORT
116
117
Teuchos::RCP<Thyra::LinearOpBase<panzer::Traits::RealType> >
118
Response_Residual<panzer::Traits::Hessian>::
119
getGhostedHessian
()
const
120
{
121
using
Teuchos::RCP;
122
using
Teuchos::rcp_dynamic_cast;
123
124
typedef
ThyraObjContainer<panzer::Traits::RealType>
TOC;
125
126
// if already computed, uses that ghosted vector
127
if
(
ghostedHessian_
!=Teuchos::null)
128
return
ghostedHessian_
;
129
130
// otherwise, allocate a new ghosted vector
131
RCP<LinearObjContainer> loc =
linObjFactory_
->buildGhostedLinearObjContainer();
132
linObjFactory_
->initializeGhostedContainer(
LinearObjContainer::Mat
,*loc);
133
134
RCP<TOC> th_loc = rcp_dynamic_cast<TOC>(loc);
135
return
th_loc->get_A_th();
136
}
137
138
Teuchos::RCP<Thyra::LinearOpBase<panzer::Traits::RealType> >
139
Response_Residual<panzer::Traits::Hessian>::
140
getHessian
()
const
141
{
142
return
hessian_
;
143
}
144
145
void
146
Response_Residual<panzer::Traits::Hessian>::
147
setHessian
(
const
Teuchos::RCP<
Thyra::LinearOpBase<panzer::Traits::RealType>
> & jac)
148
{
149
hessian_
= jac;
150
}
151
152
Teuchos::RCP<Thyra::LinearOpBase<panzer::Traits::RealType> >
153
Response_Residual<panzer::Traits::Hessian>::
154
allocateHessian
()
const
155
{
156
using
Teuchos::RCP;
157
using
Teuchos::rcp_dynamic_cast;
158
159
typedef
ThyraObjFactory<panzer::Traits::RealType>
ObjFactory;
160
161
RCP<const ObjFactory> objFactory = rcp_dynamic_cast<const ObjFactory>(
linObjFactory_
);
162
return
objFactory->getThyraMatrix();
163
}
164
#endif
165
168
169
}
// end namespace panzer
Panzer_Response_Residual.hpp
Panzer_ThyraObjContainer.hpp
Panzer_ThyraObjFactory.hpp
Thyra::LinearOpBase
Thyra::VectorBase
panzer::LinearObjContainer::F
@ F
Definition
Panzer_LinearObjContainer.hpp:63
panzer::LinearObjContainer::Mat
@ Mat
Definition
Panzer_LinearObjContainer.hpp:63
panzer::Response_Residual< panzer::Traits::Hessian >::Response_Residual
Response_Residual(const std::string &responseName, const Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > &lof)
Definition
Panzer_Response_Residual.hpp:185
panzer::Response_Residual< panzer::Traits::Hessian >::ghostedHessian_
Teuchos::RCP< Thyra::LinearOpBase< panzer::Traits::RealType > > ghostedHessian_
Definition
Panzer_Response_Residual.hpp:181
panzer::Response_Residual< panzer::Traits::Hessian >::hessian_
Teuchos::RCP< Thyra::LinearOpBase< panzer::Traits::RealType > > hessian_
Definition
Panzer_Response_Residual.hpp:180
panzer::Response_Residual< panzer::Traits::Hessian >::linObjFactory_
Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > linObjFactory_
Definition
Panzer_Response_Residual.hpp:178
panzer::Response_Residual< panzer::Traits::Jacobian >::jacobian_
Teuchos::RCP< Thyra::LinearOpBase< panzer::Traits::RealType > > jacobian_
Definition
Panzer_Response_Residual.hpp:132
panzer::Response_Residual< panzer::Traits::Jacobian >::linObjFactory_
Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > linObjFactory_
Definition
Panzer_Response_Residual.hpp:130
panzer::Response_Residual< panzer::Traits::Jacobian >::ghostedJacobian_
Teuchos::RCP< Thyra::LinearOpBase< panzer::Traits::RealType > > ghostedJacobian_
Definition
Panzer_Response_Residual.hpp:133
panzer::Response_Residual< panzer::Traits::Jacobian >::Response_Residual
Response_Residual(const std::string &responseName, const Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > &lof)
Definition
Panzer_Response_Residual.hpp:137
panzer::Response_Residual< panzer::Traits::Residual >::linObjFactory_
Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > linObjFactory_
Definition
Panzer_Response_Residual.hpp:83
panzer::Response_Residual< panzer::Traits::Residual >::Response_Residual
Response_Residual(const std::string &responseName, const Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > &lof)
Definition
Panzer_Response_Residual.hpp:90
panzer::Response_Residual< panzer::Traits::Residual >::ghostedResidual_
Teuchos::RCP< Thyra::VectorBase< panzer::Traits::RealType > > ghostedResidual_
Definition
Panzer_Response_Residual.hpp:86
panzer::Response_Residual< panzer::Traits::Residual >::residual_
Teuchos::RCP< Thyra::VectorBase< panzer::Traits::RealType > > residual_
Definition
Panzer_Response_Residual.hpp:85
panzer::ThyraObjContainer
Definition
Panzer_ThyraObjContainer.hpp:59
panzer::ThyraObjFactory
Definition
Panzer_ThyraObjFactory.hpp:59
panzer
Computes .
Definition
Panzer_BasisValues_Evaluator_decl.hpp:54
Generated by
1.17.0