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 #include "Phalanx_KokkosViewOfViews.hpp"
18 
20 
21 #include "PanzerDiscFE_config.hpp"
22 #include "Panzer_Dimension.hpp"
23 #include "Panzer_Traits.hpp"
26 
27 #include "Panzer_NodeType.hpp"
28 
30 
31 namespace panzer {
32 
33 class GlobalIndexer;
34 
43 template<typename EvalT, typename Traits,typename LO,typename GO,typename NodeT=panzer::TpetraNodeType>
45 
46 // **************************************************************
47 // **************************************************************
48 // * Specializations
49 // **************************************************************
50 // **************************************************************
51 
52 
53 // **************************************************************
54 // Residual
55 // **************************************************************
56 template<typename TRAITS,typename LO,typename GO,typename NodeT>
57 class ScatterDirichletResidual_Tpetra<panzer::Traits::Residual,TRAITS,LO,GO,NodeT>
58  : public panzer::EvaluatorWithBaseImpl<TRAITS>,
59  public PHX::EvaluatorDerived<panzer::Traits::Residual, TRAITS>,
61 
62 public:
64  : globalIndexer_(indexer) {}
65 
67  const Teuchos::ParameterList& p);
68 
69  void postRegistrationSetup(typename TRAITS::SetupData d,
71 
72  void preEvaluate(typename TRAITS::PreEvalData d);
73 
74  void evaluateFields(typename TRAITS::EvalData workset);
75 
78 
79 private:
82 
83  // dummy field so that the evaluator will have something to do
85 
86  // fields that need to be scattered will be put in this vector
87  std::vector< PHX::MDField<const ScalarT,Cell,NODE> > scatterFields_;
88 
89  // maps the local (field,element,basis) triplet to a global ID
90  // for scattering
92  std::vector<int> fieldIds_; // field IDs needing mapping
93 
94  // This maps the scattered field names to the DOF manager field
95  // For instance a Navier-Stokes map might look like
96  // fieldMap_["RESIDUAL_Velocity"] --> "Velocity"
97  // fieldMap_["RESIDUAL_Pressure"] --> "Pressure"
99 
100  std::size_t side_subcell_dim_;
101  std::size_t local_side_id_;
102 
104 
106 
107  std::string globalDataKey_; // what global data does this fill?
109 
112 
113  // If set to true, scattering an initial condition
115 
116  // Allows runtime disabling of dirichlet BCs on node-by-node basis
117  std::vector< PHX::MDField<const bool,Cell,NODE> > applyBC_;
118 
119  PHX::View<int**> scratch_lids_;
120  std::vector<PHX::View<int*> > scratch_offsets_;
121  std::vector<PHX::View<int*> > scratch_basisIds_;
122 };
123 
124 // **************************************************************
125 // Tangent
126 // **************************************************************
127 template<typename TRAITS,typename LO,typename GO,typename NodeT>
128 class ScatterDirichletResidual_Tpetra<panzer::Traits::Tangent,TRAITS,LO,GO,NodeT>
129  : public panzer::EvaluatorWithBaseImpl<TRAITS>,
130  public PHX::EvaluatorDerived<panzer::Traits::Tangent, TRAITS>,
132 
133 public:
135  : globalIndexer_(indexer) {}
136 
138  const Teuchos::ParameterList& p);
139 
140  void postRegistrationSetup(typename TRAITS::SetupData d,
142 
143  void preEvaluate(typename TRAITS::PreEvalData d);
144 
145  void evaluateFields(typename TRAITS::EvalData workset);
146 
149 
150 private:
152  typedef typename panzer::Traits::RealType RealT;
154 
155  // dummy field so that the evaluator will have something to do
157 
158  // fields that need to be scattered will be put in this vector
159  std::vector< PHX::MDField<const ScalarT,Cell,NODE> > scatterFields_;
160 
161  // maps the local (field,element,basis) triplet to a global ID
162  // for scattering
164  std::vector<int> fieldIds_; // field IDs needing mapping
165 
166  // This maps the scattered field names to the DOF manager field
167  // For instance a Navier-Stokes map might look like
168  // fieldMap_["RESIDUAL_Velocity"] --> "Velocity"
169  // fieldMap_["RESIDUAL_Pressure"] --> "Pressure"
171 
172  std::size_t side_subcell_dim_;
173  std::size_t local_side_id_;
174 
176 
178 
179  std::string globalDataKey_; // what global data does this fill?
181  std::vector< Teuchos::ArrayRCP<double> > dfdp_vectors_;
182 
185 
186  // If set to true, scattering an initial condition
188 
189  // Allows runtime disabling of dirichlet BCs on node-by-node basis
190  std::vector< PHX::MDField<const bool,Cell,NODE> > applyBC_;
191 
192  PHX::View<int**> scratch_lids_;
193  std::vector<PHX::View<int*> > scratch_offsets_;
194  std::vector<PHX::View<int*> > scratch_basisIds_;
195 
198 };
199 
200 // **************************************************************
201 // Jacobian
202 // **************************************************************
203 template<typename TRAITS,typename LO,typename GO,typename NodeT>
204 class ScatterDirichletResidual_Tpetra<panzer::Traits::Jacobian,TRAITS,LO,GO,NodeT>
205  : public panzer::EvaluatorWithBaseImpl<TRAITS>,
206  public PHX::EvaluatorDerived<panzer::Traits::Jacobian, TRAITS>,
208 
209 public:
211  : globalIndexer_(indexer) {}
212 
214  const Teuchos::ParameterList& p);
215 
216  void preEvaluate(typename TRAITS::PreEvalData d);
217 
218  void postRegistrationSetup(typename TRAITS::SetupData d,
220 
221  void evaluateFields(typename TRAITS::EvalData workset);
222 
225 
226 private:
227 
230 
231  // dummy field so that the evaluator will have something to do
233 
234  // fields that need to be scattered will be put in this vector
235  std::vector< PHX::MDField<const ScalarT,Cell,NODE> > scatterFields_;
236 
237  // maps the local (field,element,basis) triplet to a global ID
238  // for scattering
240  std::vector<int> fieldIds_; // field IDs needing mapping
241 
242  // This maps the scattered field names to the DOF manager field
243  // For instance a Navier-Stokes map might look like
244  // fieldMap_["RESIDUAL_Velocity"] --> "Velocity"
245  // fieldMap_["RESIDUAL_Pressure"] --> "Pressure"
247 
248  std::size_t num_nodes;
249  std::size_t num_eq;
250 
251  std::size_t side_subcell_dim_;
252  std::size_t local_side_id_;
253 
255 
257 
258  std::string globalDataKey_; // what global data does this fill?
260 
263 
264  // Allows runtime disabling of dirichlet BCs on node-by-node basis
265  std::vector< PHX::MDField<const bool,Cell,NODE> > applyBC_;
266 };
267 
268 }
269 
270 // optionally include hessian support
271 #ifdef Panzer_BUILD_HESSIAN_SUPPORT
273 #endif
274 
275 // **************************************************************
276 #endif
PHX::ViewOfViews< 1, Kokkos::View< RealT **, Kokkos::LayoutLeft, PHX::Device > > dfdpFieldsVoV_
Storage for the tangent data.
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.