Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_ScatterDirichletResidual_Tpetra_decl.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_EVALUATOR_SCATTER_DIRICHLET_RESIDUAL_TPETRA_DECL_HPP
12 #define PANZER_EVALUATOR_SCATTER_DIRICHLET_RESIDUAL_TPETRA_DECL_HPP
13 
14 #include "Phalanx_config.hpp"
15 #include "Phalanx_Evaluator_Macros.hpp"
16 #include "Phalanx_MDField.hpp"
17 
19 
20 #include "PanzerDiscFE_config.hpp"
21 #include "Panzer_Dimension.hpp"
22 #include "Panzer_Traits.hpp"
25 
26 #include "Panzer_NodeType.hpp"
27 
29 
30 namespace panzer {
31 
32 class GlobalIndexer;
33 
42 template<typename EvalT, typename Traits,typename LO,typename GO,typename NodeT=panzer::TpetraNodeType>
44 
45 // **************************************************************
46 // **************************************************************
47 // * Specializations
48 // **************************************************************
49 // **************************************************************
50 
51 
52 // **************************************************************
53 // Residual
54 // **************************************************************
55 template<typename TRAITS,typename LO,typename GO,typename NodeT>
56 class ScatterDirichletResidual_Tpetra<panzer::Traits::Residual,TRAITS,LO,GO,NodeT>
57  : public panzer::EvaluatorWithBaseImpl<TRAITS>,
58  public PHX::EvaluatorDerived<panzer::Traits::Residual, TRAITS>,
60 
61 public:
63  : globalIndexer_(indexer) {}
64 
66  const Teuchos::ParameterList& p);
67 
68  void postRegistrationSetup(typename TRAITS::SetupData d,
70 
71  void preEvaluate(typename TRAITS::PreEvalData d);
72 
73  void evaluateFields(typename TRAITS::EvalData workset);
74 
77 
78 private:
81 
82  // dummy field so that the evaluator will have something to do
84 
85  // fields that need to be scattered will be put in this vector
86  std::vector< PHX::MDField<const ScalarT,Cell,NODE> > scatterFields_;
87 
88  // maps the local (field,element,basis) triplet to a global ID
89  // for scattering
91  std::vector<int> fieldIds_; // field IDs needing mapping
92 
93  // This maps the scattered field names to the DOF manager field
94  // For instance a Navier-Stokes map might look like
95  // fieldMap_["RESIDUAL_Velocity"] --> "Velocity"
96  // fieldMap_["RESIDUAL_Pressure"] --> "Pressure"
98 
99  std::size_t num_nodes;
100 
101  std::size_t side_subcell_dim_;
102  std::size_t local_side_id_;
103 
105 
107 
108  std::string globalDataKey_; // what global data does this fill?
110 
113 
114  // If set to true, scattering an initial condition
116 
117  // Allows runtime disabling of dirichlet BCs on node-by-node basis
118  std::vector< PHX::MDField<const bool,Cell,NODE> > applyBC_;
119 };
120 
121 // **************************************************************
122 // Tangent
123 // **************************************************************
124 template<typename TRAITS,typename LO,typename GO,typename NodeT>
125 class ScatterDirichletResidual_Tpetra<panzer::Traits::Tangent,TRAITS,LO,GO,NodeT>
126  : public panzer::EvaluatorWithBaseImpl<TRAITS>,
127  public PHX::EvaluatorDerived<panzer::Traits::Tangent, TRAITS>,
129 
130 public:
132  : globalIndexer_(indexer) {}
133 
135  const Teuchos::ParameterList& p);
136 
137  void postRegistrationSetup(typename TRAITS::SetupData d,
139 
140  void preEvaluate(typename TRAITS::PreEvalData d);
141 
142  void evaluateFields(typename TRAITS::EvalData workset);
143 
146 
147 private:
150 
151  // dummy field so that the evaluator will have something to do
153 
154  // fields that need to be scattered will be put in this vector
155  std::vector< PHX::MDField<const ScalarT,Cell,NODE> > scatterFields_;
156 
157  // maps the local (field,element,basis) triplet to a global ID
158  // for scattering
160  std::vector<int> fieldIds_; // field IDs needing mapping
161 
162  // This maps the scattered field names to the DOF manager field
163  // For instance a Navier-Stokes map might look like
164  // fieldMap_["RESIDUAL_Velocity"] --> "Velocity"
165  // fieldMap_["RESIDUAL_Pressure"] --> "Pressure"
167 
168  std::size_t num_nodes;
169 
170  std::size_t side_subcell_dim_;
171  std::size_t local_side_id_;
172 
174 
176 
177  std::string globalDataKey_; // what global data does this fill?
179  std::vector< Teuchos::ArrayRCP<double> > dfdp_vectors_;
180 
183 
184  // If set to true, scattering an initial condition
186 
187  // Allows runtime disabling of dirichlet BCs on node-by-node basis
188  std::vector< PHX::MDField<const bool,Cell,NODE> > applyBC_;
189 };
190 
191 // **************************************************************
192 // Jacobian
193 // **************************************************************
194 template<typename TRAITS,typename LO,typename GO,typename NodeT>
195 class ScatterDirichletResidual_Tpetra<panzer::Traits::Jacobian,TRAITS,LO,GO,NodeT>
196  : public panzer::EvaluatorWithBaseImpl<TRAITS>,
197  public PHX::EvaluatorDerived<panzer::Traits::Jacobian, TRAITS>,
199 
200 public:
202  : globalIndexer_(indexer) {}
203 
205  const Teuchos::ParameterList& p);
206 
207  void preEvaluate(typename TRAITS::PreEvalData d);
208 
209  void postRegistrationSetup(typename TRAITS::SetupData d,
211 
212  void evaluateFields(typename TRAITS::EvalData workset);
213 
216 
217 private:
218 
221 
222  // dummy field so that the evaluator will have something to do
224 
225  // fields that need to be scattered will be put in this vector
226  std::vector< PHX::MDField<const ScalarT,Cell,NODE> > scatterFields_;
227 
228  // maps the local (field,element,basis) triplet to a global ID
229  // for scattering
231  std::vector<int> fieldIds_; // field IDs needing mapping
232 
233  // This maps the scattered field names to the DOF manager field
234  // For instance a Navier-Stokes map might look like
235  // fieldMap_["RESIDUAL_Velocity"] --> "Velocity"
236  // fieldMap_["RESIDUAL_Pressure"] --> "Pressure"
238 
239  std::size_t num_nodes;
240  std::size_t num_eq;
241 
242  std::size_t side_subcell_dim_;
243  std::size_t local_side_id_;
244 
246 
248 
249  std::string globalDataKey_; // what global data does this fill?
251 
254 
255  // Allows runtime disabling of dirichlet BCs on node-by-node basis
256  std::vector< PHX::MDField<const bool,Cell,NODE> > applyBC_;
257 };
258 
259 }
260 
261 // optionally include hessian support
262 #ifdef Panzer_BUILD_HESSIAN_SUPPORT
264 #endif
265 
266 // **************************************************************
267 #endif
virtual Teuchos::RCP< CloneableEvaluator > clone(const Teuchos::ParameterList &pl) const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Wrapper to PHX::EvaluatorWithBaseImpl that implements Panzer-specific helpers.
Pushes residual values into the residual vector for a Newton-based solve.
bool checkApplyBC_
If set to true, allows runtime disabling of dirichlet BCs on node-by-node basis.
virtual Teuchos::RCP< CloneableEvaluator > clone(const Teuchos::ParameterList &pl) const
bool checkApplyBC_
If set to true, allows runtime disabling of dirichlet BCs on node-by-node basis.
bool checkApplyBC_
If set to true, allows runtime disabling of dirichlet BCs on node-by-node basis.
virtual Teuchos::RCP< CloneableEvaluator > clone(const Teuchos::ParameterList &pl) const
Non-templated empty base class for template managers.