Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_FieldManagerBuilder.cpp
Go to the documentation of this file.
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Panzer: A partial differential equation assembly
5 // engine for strongly coupled complex multiphysics systems
6 // Copyright (2011) Sandia Corporation
7 //
8 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact Roger P. Pawlowski (rppawlo@sandia.gov) and
39 // Eric C. Cyr (eccyr@sandia.gov)
40 // ***********************************************************************
41 // @HEADER
42 
43 #include <vector>
44 #include <string>
45 #include <sstream>
46 #include <fstream>
47 
49 
50 #include "Phalanx_DataLayout_MDALayout.hpp"
51 #include "Phalanx_FieldManager.hpp"
52 
53 #include "Teuchos_FancyOStream.hpp"
54 
55 #include "Shards_CellTopology.hpp"
56 
57 #include "Panzer_Traits.hpp"
58 #include "Panzer_Workset.hpp"
59 #include "Panzer_Workset_Builder.hpp"
60 #include "Panzer_PhysicsBlock.hpp"
64 #include "Panzer_CellData.hpp"
68 #include "Panzer_GlobalIndexer.hpp"
69 
70 //#include "EpetraExt_BlockMapOut.h"
71 
72 //=======================================================================
73 //=======================================================================
74 void panzer::FieldManagerBuilder::print(std::ostream& os) const
75 {
76  os << "panzer::FieldManagerBuilder output: Not implemented yet!";
77 }
78 
79 //=======================================================================
81 FieldManagerBuilder(bool disablePhysicsBlockScatter,
82  bool disablePhysicsBlockGather)
83  : disablePhysicsBlockScatter_(disablePhysicsBlockScatter)
84  , disablePhysicsBlockGather_(disablePhysicsBlockGather)
85  , active_evaluation_types_(Sacado::mpl::size<panzer::Traits::EvalTypes>::value, true)
86 {}
87 
88 //=======================================================================
89 namespace {
90  struct PostRegistrationFunctor {
91 
92  const std::vector<bool>& active_;
94  panzer::Traits::SD& setup_data_;
95 
96  PostRegistrationFunctor(const std::vector<bool>& active,
98  panzer::Traits::SD& setup_data)
99  : active_(active),fm_(fm),setup_data_(setup_data) {}
100 
101  template<typename T>
102  void operator()(T) const {
103  auto index = Sacado::mpl::find<panzer::Traits::EvalTypes,T>::value;
104  if (active_[index])
105  fm_.postRegistrationSetupForType<T>(setup_data_);
106  }
107  };
108 }
109 
110 //=======================================================================
112  const std::vector<Teuchos::RCP<panzer::PhysicsBlock> >& physicsBlocks,
113  const std::vector<WorksetDescriptor> & wkstDesc,
115  const Teuchos::ParameterList& closure_models,
116  const panzer::LinearObjFactory<panzer::Traits> & lo_factory,
117  const Teuchos::ParameterList& user_data,
118  const GenericEvaluatorFactory & gEvalFact,
119  bool closureModelByEBlock)
120 {
121  using Teuchos::RCP;
122  using Teuchos::rcp;
123 
124  PANZER_FUNC_TIME_MONITOR_DIFF("panzer::FieldManagerBuilder::setupVolumeFieldManagers",setup_field_managers);
125 
126  TEUCHOS_TEST_FOR_EXCEPTION(getWorksetContainer()==Teuchos::null,std::logic_error,
127  "panzer::FMB::setupVolumeFieldManagers: method function getWorksetContainer() returns null. "
128  "Plase call setWorksetContainer() before calling this method");
129  TEUCHOS_TEST_FOR_EXCEPTION(physicsBlocks.size()!=wkstDesc.size(),std::runtime_error,
130  "panzer::FMB::setupVolumeFieldManagers: physics block count must match workset descriptor count.");
131 
132  phx_volume_field_managers_.clear();
133 
135 
136  for (std::size_t blkInd=0;blkInd<physicsBlocks.size();++blkInd) {
137  RCP<panzer::PhysicsBlock> pb = physicsBlocks[blkInd];
138  const WorksetDescriptor wd = wkstDesc[blkInd];
139 
140  Traits::SD setupData;
141  {
142  PANZER_FUNC_TIME_MONITOR_DIFF("getWorksets()",get_worksets);
143  { setupData.worksets_ = getWorksetContainer()->getWorksets(wd); }
144  }
145  {
146  PANZER_FUNC_TIME_MONITOR_DIFF("getOrientations()",get_orientations);
147  { setupData.orientations_ = getWorksetContainer()->getOrientations(); }
148  }
149  if(setupData.worksets_->size()==0)
150  continue;
151 
152  // sanity check
154 
155  // build a field manager object
158 
159  // use the physics block to register active evaluators
160  pb->setActiveEvaluationTypes(active_evaluation_types_);
161 
162  {
163  PANZER_FUNC_TIME_MONITOR_DIFF("pb->buildAndRegisterEquationSetEvaluators()",build_and_reg_eq_set_eval);
164  { pb->buildAndRegisterEquationSetEvaluators(*fm, user_data); }
165  }
166 
167  if(!physicsBlockGatherDisabled()) {
168  PANZER_FUNC_TIME_MONITOR_DIFF("pb->buildAndRegisterGatherAndOrientationEvaluators()",build_and_reg_gath_and_orient_eval);
169  pb->buildAndRegisterGatherAndOrientationEvaluators(*fm,lo_factory,user_data);
170  }
171 
172  {
173  PANZER_FUNC_TIME_MONITOR_DIFF("pb->buildAndRegisterDOFProjectionsToIPEvaluators()",build_and_reg_dof_proj_eval);
174  pb->buildAndRegisterDOFProjectionsToIPEvaluators(*fm,Teuchos::ptrFromRef(lo_factory),user_data);
175  }
176 
177  if(!physicsBlockScatterDisabled()) {
178  PANZER_FUNC_TIME_MONITOR_DIFF("pb->buildAndRegisterScatterEvaluators()",build_and_reg_scatter_eval);
179  pb->buildAndRegisterScatterEvaluators(*fm,lo_factory,user_data);
180  }
181 
182  if(closureModelByEBlock) {
183  PANZER_FUNC_TIME_MONITOR_DIFF("pb->buildAndRegisterClosureModelEvaluators(): closureModelByEBlock==true",build_and_reg_closure_model_eval_if);
184  pb->buildAndRegisterClosureModelEvaluators(*fm,cm_factory,pb->elementBlockID(),closure_models,user_data);
185  }
186  else {
187  PANZER_FUNC_TIME_MONITOR_DIFF("pb->buildAndRegisterClosureModelEvaluators(): closureModelByEBlock==false",build_and_reg_closure_model_eval_else);
188  pb->buildAndRegisterClosureModelEvaluators(*fm,cm_factory,closure_models,user_data);
189  }
190 
191  // Reset active evaluation types
193 
194  // register additional model evaluator from the generic evaluator factory
195  gEvalFact.registerEvaluators(*fm,wd,*pb);
196 
197  // setup derivative information
198  setKokkosExtendedDataTypeDimensions(wd.getElementBlock(),*globalIndexer,user_data,*fm);
199 
200  // call postRegistrationSetup() for each active type
201  Sacado::mpl::for_each_no_kokkos<panzer::Traits::EvalTypes>(PostRegistrationFunctor(active_evaluation_types_,*fm,setupData));
202 
203  // make sure to add the field manager & workset to the list
204  volume_workset_desc_.push_back(wd);
205  phx_volume_field_managers_.push_back(fm);
206  }
207 }
208 
209 //=======================================================================
211  const std::vector<Teuchos::RCP<panzer::PhysicsBlock> >& physicsBlocks,
213  const Teuchos::ParameterList& closure_models,
214  const panzer::LinearObjFactory<panzer::Traits> & lo_factory,
215  const Teuchos::ParameterList& user_data)
216 {
217  std::vector<WorksetDescriptor> wkstDesc;
218  for(std::size_t i=0;i<physicsBlocks.size();i++)
219  wkstDesc.push_back(blockDescriptor(physicsBlocks[i]->elementBlockID()));
220 
222  setupVolumeFieldManagers(physicsBlocks,wkstDesc,cm_factory,closure_models,lo_factory,user_data,eef);
223 }
224 
225 //=======================================================================
226 //=======================================================================
228 setupBCFieldManagers(const std::vector<panzer::BC> & bcs,
229  const std::vector<Teuchos::RCP<panzer::PhysicsBlock> >& physicsBlocks,
230  const Teuchos::Ptr<const panzer::EquationSetFactory>& /* eqset_factory */,
232  const panzer::BCStrategyFactory& bc_factory,
233  const Teuchos::ParameterList& closure_models,
234  const panzer::LinearObjFactory<panzer::Traits> & lo_factory,
235  const Teuchos::ParameterList& user_data)
236 {
237  TEUCHOS_TEST_FOR_EXCEPTION(getWorksetContainer()==Teuchos::null,std::logic_error,
238  "panzer::FMB::setupBCFieldManagers: method function getWorksetContainer() returns null. "
239  "Plase call setWorksetContainer() before calling this method");
240 
242 
243  // for convenience build a map (element block id => physics block)
244  std::map<std::string,Teuchos::RCP<panzer::PhysicsBlock> > physicsBlocks_map;
245  {
246  std::vector<Teuchos::RCP<panzer::PhysicsBlock> >::const_iterator blkItr;
247  for(blkItr=physicsBlocks.begin();blkItr!=physicsBlocks.end();++blkItr) {
249  std::string blockId = pb->elementBlockID();
250 
251  // add block id, physics block pair to the map
252  physicsBlocks_map.insert(std::make_pair(blockId,pb));
253  }
254  }
255 
256  // ***************************
257  // BCs
258  // ***************************
259  std::vector<panzer::BC>::const_iterator bc;
260  for (bc=bcs.begin(); bc != bcs.end(); ++bc) {
263  currentWkst = getWorksetContainer()->getSideWorksets(wd);
264  if (currentWkst.is_null()) continue;
265 
266  BCType bc_type = bc->bcType();
267 
268  if (bc_type == BCT_Interface) {
269  // Loop over local face indices and setup each field manager
270  for (std::map<unsigned,panzer::Workset>::const_iterator wkst = currentWkst->begin();
271  wkst != currentWkst->end(); ++wkst) {
272  // Build one FieldManager for each local side workset for each bc
273  std::map<unsigned,PHX::FieldManager<panzer::Traits> >& field_managers =
274  bc_field_managers_[*bc];
275 
276  PHX::FieldManager<panzer::Traits>& fm = field_managers[wkst->first];
277 
278  int gid_count = 0;
279  for (int block_id_index = 0; block_id_index < 2; ++block_id_index) {
280  const std::string element_block_id = block_id_index == 0 ? bc->elementBlockID() : bc->elementBlockID2();
281 
282  std::map<std::string,Teuchos::RCP<panzer::PhysicsBlock> >::const_iterator
283  volume_pb_itr = physicsBlocks_map.find(element_block_id);
284 
285  TEUCHOS_TEST_FOR_EXCEPTION(volume_pb_itr == physicsBlocks_map.end(), std::logic_error,
286  "panzer::FMB::setupBCFieldManagers: Cannot find physics block corresponding to element block \""
287  << element_block_id << "\"");
288 
289  const Teuchos::RCP<const panzer::PhysicsBlock> volume_pb = physicsBlocks_map.find(element_block_id)->second;
290  const Teuchos::RCP<const shards::CellTopology> volume_cell_topology = volume_pb->cellData().getCellTopology();
291 
292  // register evaluators from strategy
293  const panzer::CellData side_cell_data(wkst->second.num_cells,
294  wkst->second.details(block_id_index).subcell_index,
295  volume_cell_topology);
296 
297  // Copy the physics block for side integrations
298  Teuchos::RCP<panzer::PhysicsBlock> side_pb = volume_pb->copyWithCellData(side_cell_data);
299 
301  bcstm = bc_factory.buildBCStrategy(*bc, side_pb->globalData());
302 
303  // Iterate over evaluation types
304  int i=0;
306  bcs_type = bcstm->begin(); bcs_type != bcstm->end(); ++bcs_type,++i) {
307  if (active_evaluation_types_[i]) {
308  bcs_type->setDetailsIndex(block_id_index);
309  side_pb->setDetailsIndex(block_id_index);
310  bcs_type->setup(*side_pb, user_data);
311  bcs_type->buildAndRegisterEvaluators(fm, *side_pb, cm_factory, closure_models, user_data);
312  bcs_type->buildAndRegisterGatherAndOrientationEvaluators(fm, *side_pb, lo_factory, user_data);
313  if ( ! physicsBlockScatterDisabled())
314  bcs_type->buildAndRegisterScatterEvaluators(fm, *side_pb, lo_factory, user_data);
315  }
316  }
317 
318  gid_count += globalIndexer->getElementBlockGIDCount(element_block_id);
319  }
320 
321  { // Use gid_count to set up the derivative information.
322  std::vector<PHX::index_size_type> derivative_dimensions;
323  derivative_dimensions.push_back(gid_count);
324  fm.setKokkosExtendedDataTypeDimensions<panzer::Traits::Jacobian>(derivative_dimensions);
325 
326  #ifdef Panzer_BUILD_HESSIAN_SUPPORT
327  fm.setKokkosExtendedDataTypeDimensions<panzer::Traits::Hessian>(derivative_dimensions);
328  #endif
329 
330  derivative_dimensions[0] = 1;
331  if (user_data.isType<int>("Tangent Dimension"))
332  derivative_dimensions[0] = user_data.get<int>("Tangent Dimension");
333  fm.setKokkosExtendedDataTypeDimensions<panzer::Traits::Tangent>(derivative_dimensions);
334  }
335 
336  // Set up the field manager
337  Traits::SD setupData;
338  Teuchos::RCP<std::vector<panzer::Workset> > worksets = Teuchos::rcp(new std::vector<panzer::Workset>);
339  worksets->push_back(wkst->second);
340  setupData.worksets_ = worksets;
341  setupData.orientations_ = getWorksetContainer()->getOrientations();
342 
343  Sacado::mpl::for_each_no_kokkos<panzer::Traits::EvalTypes>(PostRegistrationFunctor(active_evaluation_types_,fm,setupData));
344 
345  }
346  } else {
347  const std::string element_block_id = bc->elementBlockID();
348 
349  std::map<std::string,Teuchos::RCP<panzer::PhysicsBlock> >::const_iterator volume_pb_itr
350  = physicsBlocks_map.find(element_block_id);
351 
352  TEUCHOS_TEST_FOR_EXCEPTION(volume_pb_itr==physicsBlocks_map.end(),std::logic_error,
353  "panzer::FMB::setupBCFieldManagers: Cannot find physics block corresponding to element block \"" << element_block_id << "\"");
354 
355  Teuchos::RCP<const panzer::PhysicsBlock> volume_pb = physicsBlocks_map.find(element_block_id)->second;
356  Teuchos::RCP<const shards::CellTopology> volume_cell_topology = volume_pb->cellData().getCellTopology();
357 
358  // Build one FieldManager for each local side workset for each dirichlet bc
359  std::map<unsigned,PHX::FieldManager<panzer::Traits> >& field_managers =
360  bc_field_managers_[*bc];
361 
362  // Loop over local face indices and setup each field manager
363  for (std::map<unsigned,panzer::Workset>::const_iterator wkst =
364  currentWkst->begin(); wkst != currentWkst->end();
365  ++wkst) {
366 
367  PHX::FieldManager<panzer::Traits>& fm = field_managers[wkst->first];
368 
369  // register evaluators from strategy
370  const panzer::CellData side_cell_data(wkst->second.num_cells,
371  wkst->first,volume_cell_topology);
372 
373  // Copy the physics block for side integrations
374  Teuchos::RCP<panzer::PhysicsBlock> side_pb = volume_pb->copyWithCellData(side_cell_data);
375 
377  bc_factory.buildBCStrategy(*bc,side_pb->globalData());
378 
379  // Iterate over evaluation types
380  int i=0;
382  bcs_type = bcstm->begin(); bcs_type != bcstm->end(); ++bcs_type,++i) {
383  if (active_evaluation_types_[i]) {
384  bcs_type->setup(*side_pb,user_data);
385  bcs_type->buildAndRegisterEvaluators(fm,*side_pb,cm_factory,closure_models,user_data);
386  bcs_type->buildAndRegisterGatherAndOrientationEvaluators(fm,*side_pb,lo_factory,user_data);
387  if(!physicsBlockScatterDisabled())
388  bcs_type->buildAndRegisterScatterEvaluators(fm,*side_pb,lo_factory,user_data);
389  }
390  }
391 
392  // Setup the fieldmanager
393  Traits::SD setupData;
395  Teuchos::rcp(new(std::vector<panzer::Workset>));
396  worksets->push_back(wkst->second);
397  setupData.worksets_ = worksets;
398  setupData.orientations_ = getWorksetContainer()->getOrientations();
399 
400  // setup derivative information
401  setKokkosExtendedDataTypeDimensions(element_block_id,*globalIndexer,user_data,fm);
402 
403  Sacado::mpl::for_each_no_kokkos<panzer::Traits::EvalTypes>(PostRegistrationFunctor(active_evaluation_types_,fm,setupData));
404  }
405  }
406  }
407 }
408 
409 //=======================================================================
410 //=======================================================================
412 writeVolumeGraphvizDependencyFiles(std::string filename_prefix,
413  const std::vector<Teuchos::RCP<panzer::PhysicsBlock> >& physicsBlocks) const
414 {
415  if(phx_volume_field_managers_.size()<1)
416  return; // nothing to see here folks
417 
418  TEUCHOS_ASSERT(phx_volume_field_managers_.size()==physicsBlocks.size());
419 
420  std::vector<Teuchos::RCP<panzer::PhysicsBlock> >::const_iterator blkItr;
421  int index = 0;
422  for (blkItr=physicsBlocks.begin();blkItr!=physicsBlocks.end();++blkItr,++index) {
423  std::string blockId = (*blkItr)->elementBlockID();
424  phx_volume_field_managers_[index]->writeGraphvizFile(filename_prefix+"_VOLUME_"+blockId);
425  }
426 
427 }
428 
429 //=======================================================================
430 //=======================================================================
432 writeBCGraphvizDependencyFiles(std::string filename_prefix) const
433 {
434  typedef std::map<panzer::BC,std::map<unsigned,PHX::FieldManager<panzer::Traits> >,panzer::LessBC> FMMap;
435 
436  FMMap::const_iterator blkItr;
437  int bc_index = 0;
438  for (blkItr=bc_field_managers_.begin();blkItr!=bc_field_managers_.end();++blkItr,++bc_index) {
439  panzer::BC bc = blkItr->first;
440  const PHX::FieldManager<panzer::Traits> & fm = blkItr->second.begin()->second; // get the first field manager
441 
442  BCType bc_type = bc.bcType();
443  std::string type;
444  if (bc_type == BCT_Dirichlet)
445  type = "_Dirichlet_";
446  else if (bc_type == BCT_Neumann)
447  type = "_Neumann_";
448  else if (bc_type == BCT_Interface)
449  type = "_Interface_";
450  else
451  TEUCHOS_ASSERT(false);
452 
453  std::string blockId = bc.elementBlockID();
454  std::string sideId = bc.sidesetID();
455  fm.writeGraphvizFile(filename_prefix+"_BC_"+std::to_string(bc_index)+type+sideId+"_"+blockId);
456  }
457 
458 }
459 
460 //=======================================================================
461 //=======================================================================
463 writeVolumeTextDependencyFiles(std::string filename_prefix,
464  const std::vector<Teuchos::RCP<panzer::PhysicsBlock> >& physicsBlocks) const
465 {
466  if(phx_volume_field_managers_.size()<1)
467  return; // nothing to see here folks
468 
469  TEUCHOS_ASSERT(phx_volume_field_managers_.size()==physicsBlocks.size());
470 
471  std::vector<Teuchos::RCP<panzer::PhysicsBlock> >::const_iterator blkItr;
472  int index = 0;
473  for (blkItr=physicsBlocks.begin();blkItr!=physicsBlocks.end();++blkItr,++index) {
474 
475  std::string blockId = (*blkItr)->elementBlockID();
476 
477  std::string filename = filename_prefix+"_VOLUME_"+blockId+".txt";
478  std::ofstream ofs;
479  ofs.open(filename.c_str());
480 
481  ofs << *(phx_volume_field_managers_[index]) << std::endl;
482 
483  ofs.close();
484  }
485 
486 }
487 
488 //=======================================================================
489 //=======================================================================
491 writeBCTextDependencyFiles(std::string filename_prefix) const
492 {
493  typedef std::map<panzer::BC,std::map<unsigned,PHX::FieldManager<panzer::Traits> >,panzer::LessBC> FMMap;
494 
495  FMMap::const_iterator blkItr;
496  int bc_index = 0;
497  for (blkItr=bc_field_managers_.begin();blkItr!=bc_field_managers_.end();++blkItr,++bc_index) {
498  panzer::BC bc = blkItr->first;
499  const PHX::FieldManager<panzer::Traits> & fm = blkItr->second.begin()->second; // get the first field manager
500 
501  BCType bc_type = bc.bcType();
502  std::string type;
503  if (bc_type == BCT_Dirichlet)
504  type = "_Dirichlet_";
505  else if (bc_type == BCT_Neumann)
506  type = "_Neumann_";
507  else if (bc_type == BCT_Interface)
508  type = "_Interface_";
509  else
510  TEUCHOS_ASSERT(false);
511 
512  std::string blockId = bc.elementBlockID();
513  std::string sideId = bc.sidesetID();
514 
515  std::string filename = filename_prefix+"_BC_"+std::to_string(bc_index)+type+sideId+"_"+blockId+".txt";
516  std::ofstream ofs;
517  ofs.open(filename.c_str());
518 
519  ofs << fm << std::endl;
520 
521  ofs.close();
522  }
523 
524 }
525 
526 //=======================================================================
527 //=======================================================================
529 setKokkosExtendedDataTypeDimensions(const std::string & eblock,
530  const panzer::GlobalIndexer & globalIndexer,
531  const Teuchos::ParameterList& user_data,
533 {
534  // setup Jacobian derivative terms
535  {
536  std::vector<PHX::index_size_type> derivative_dimensions;
537  derivative_dimensions.push_back(globalIndexer.getElementBlockGIDCount(eblock));
538 
539  fm.setKokkosExtendedDataTypeDimensions<panzer::Traits::Jacobian>(derivative_dimensions);
540 
541  }
542 
543  #ifdef Panzer_BUILD_HESSIAN_SUPPORT
544  {
545  std::vector<PHX::index_size_type> derivative_dimensions;
546  derivative_dimensions.push_back(globalIndexer.getElementBlockGIDCount(eblock));
547 
548  fm.setKokkosExtendedDataTypeDimensions<panzer::Traits::Hessian>(derivative_dimensions);
549  }
550  #endif
551 
552  {
553  std::vector<PHX::index_size_type> derivative_dimensions;
554  derivative_dimensions.push_back(1);
555  if (user_data.isType<int>("Tangent Dimension"))
556  derivative_dimensions[0] = user_data.get<int>("Tangent Dimension");
557  fm.setKokkosExtendedDataTypeDimensions<panzer::Traits::Tangent>(derivative_dimensions);
558  }
559 }
560 
562 {active_evaluation_types_ = aet;}
563 
564 //=======================================================================
565 //=======================================================================
567 {
568  phx_volume_field_managers_.clear();
569  volume_workset_desc_.clear();
570  if (clearVolumeWorksets)
571  worksetContainer_->clearVolumeWorksets();
572 }
573 
574 //=======================================================================
575 //=======================================================================
576 std::ostream& panzer::operator<<(std::ostream& os, const panzer::FieldManagerBuilder& rfd)
577 {
578  rfd.print(os);
579  return os;
580 }
Interface for constructing a BCStrategy_TemplateManager.
void setupVolumeFieldManagers(const std::vector< Teuchos::RCP< panzer::PhysicsBlock > > &physicsBlocks, const panzer::ClosureModelFactory_TemplateManager< panzer::Traits > &cm_factory, const Teuchos::ParameterList &closure_models, const LinearObjFactory< panzer::Traits > &lo_factory, const Teuchos::ParameterList &user_data)
Teuchos::RCP< const std::vector< Intrepid2::Orientation > > orientations_
BCType
Type of boundary condition.
Definition: Panzer_BC.hpp:74
std::string elementBlockID() const
Returns the element block id associated with this sideset.
Definition: Panzer_BC.cpp:200
virtual Teuchos::RCP< const panzer::GlobalIndexer > getRangeGlobalIndexer() const =0
Get the range global indexer object associated with this factory.
T & get(const std::string &name, T def_value)
FieldManager::iterator begin()
void writeVolumeGraphvizDependencyFiles(std::string filename_prefix, const std::vector< Teuchos::RCP< panzer::PhysicsBlock > > &physicsBlocks) const
virtual int getElementBlockGIDCount(const std::size_t &blockIndex) const =0
How any GIDs are associate with each element in a particular element block.
void buildAndRegisterClosureModelEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::ClosureModelFactory_TemplateManager< panzer::Traits > &factory, const Teuchos::ParameterList &models, const Teuchos::ParameterList &user_data) const
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
void buildAndRegisterScatterEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::LinearObjFactory< panzer::Traits > &lof, const Teuchos::ParameterList &user_data) const
const std::string & getElementBlock(const int block=0) const
Get element block name.
void writeBCGraphvizDependencyFiles(std::string filename_prefix) const
void writeGraphvizFile(const std::string filename="graph.dot", bool writeEvaluatedFields=true, bool writeDependentFields=true, bool debugRegisteredEvaluators=false) const
void clearVolumeFieldManagers(bool clearVolumeWorksets=true)
Delete all volume field managers, retaining the BC ones.
void setKokkosExtendedDataTypeDimensions(const std::string &eblock, const panzer::GlobalIndexer &globalIndexer, const Teuchos::ParameterList &user_data, PHX::FieldManager< panzer::Traits > &fm) const
void buildAndRegisterGatherAndOrientationEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::LinearObjFactory< panzer::Traits > &lof, const Teuchos::ParameterList &user_data) const
virtual Teuchos::RCP< panzer::BCStrategy_TemplateManager< panzer::Traits > > buildBCStrategy(const panzer::BC &bc, const Teuchos::RCP< panzer::GlobalData > &global_data) const =0
void writeBCTextDependencyFiles(std::string filename_prefix) const
Teuchos::RCP< panzer::GlobalData > globalData() const
void setActiveEvaluationTypes(const std::vector< bool > &aet)
Used to save memory by disabling unneeded evaluation types.
void buildAndRegisterDOFProjectionsToIPEvaluators(PHX::FieldManager< panzer::Traits > &fm, const Teuchos::Ptr< const panzer::LinearObjFactory< panzer::Traits > > &lof, const Teuchos::ParameterList &user_data) const
void print(std::ostream &os) const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Data for determining cell topology and dimensionality.
void writeVolumeTextDependencyFiles(std::string filename_prefix, const std::vector< Teuchos::RCP< panzer::PhysicsBlock > > &physicsBlocks) const
std::string elementBlockID() const
BCType bcType() const
Returns the boundary condition type (Dirichlet or Neumann or Interface).
Definition: Panzer_BC.cpp:186
virtual bool registerEvaluators(PHX::FieldManager< panzer::Traits > &fm, const WorksetDescriptor &wd, const PhysicsBlock &pb) const =0
void activateAllEvaluationTypes()
Used to reactivate all evaluation types if some were temporarily disabled with a call to setActiveEva...
std::string sidesetID() const
Returns the set id.
Definition: Panzer_BC.cpp:193
std::ostream & operator<<(std::ostream &os, const AssemblyEngineInArgs &in)
bool isType(const std::string &name) const
FieldManagerBuilder(bool disablePhysicsBlockScatter=false, bool disablePhysicsBlockGather=false)
WorksetDescriptor blockDescriptor(const std::string &eBlock)
WorksetDescriptor bcDescriptor(const panzer::BC &bc)
Definition: Panzer_BC.cpp:332
Stores input information for a boundary condition.
Definition: Panzer_BC.hpp:81
void setupBCFieldManagers(const std::vector< panzer::BC > &bcs, const std::vector< Teuchos::RCP< panzer::PhysicsBlock > > &physicsBlocks, const panzer::EquationSetFactory &eqset_factory, const panzer::ClosureModelFactory_TemplateManager< panzer::Traits > &cm_factory, const panzer::BCStrategyFactory &bc_factory, const Teuchos::ParameterList &closure_models, const LinearObjFactory< panzer::Traits > &lo_factory, const Teuchos::ParameterList &user_data)
#define TEUCHOS_ASSERT(assertion_test)
void setActiveEvaluationTypes(const std::vector< bool > &aet)
Set a vector of active evaluation types to allocate.
void buildAndRegisterEquationSetEvaluators(PHX::FieldManager< panzer::Traits > &fm, const Teuchos::ParameterList &user_data) const
Teuchos::RCP< const std::vector< panzer::Workset > > worksets_
bool is_null() const