Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_FieldManagerBuilder.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_FIELD_MANAGER_BUILDER_HPP
12 #define PANZER_FIELD_MANAGER_BUILDER_HPP
13 
14 #include <iostream>
15 #include <vector>
16 #include <map>
17 #include "Teuchos_RCP.hpp"
18 #include "Panzer_BC.hpp"
22 
23 // Forward Declarations
24 namespace panzer {
25  struct Traits;
26  class Workset;
27  struct EquationSetFactory;
28  struct BCStrategyFactory;
29  class PhysicsBlock;
30 }
31 
32 namespace PHX {
33  template<typename T> class FieldManager;
34 }
35 
36 namespace panzer {
37 
39  public:
40  virtual bool registerEvaluators(PHX::FieldManager<panzer::Traits> & fm,const WorksetDescriptor & wd, const PhysicsBlock & pb) const = 0;
41  };
42 
44  public:
45  bool registerEvaluators(PHX::FieldManager<panzer::Traits> & /* fm */, const WorksetDescriptor & /* wd */, const PhysicsBlock & /* pb */) const
46  { return false; }
47  };
48 
50 
51  public:
52 
53  typedef std::map<unsigned,panzer::Workset> BCFaceWorksetMap;
54 
55  FieldManagerBuilder(bool disablePhysicsBlockScatter=false,bool disablePhysicsBlockGather=false);
56 
57  void print(std::ostream& os) const;
58 
60  { return disablePhysicsBlockScatter_; }
61 
63  { return disablePhysicsBlockGather_; }
64 
66  { worksetContainer_ = wc; }
67 
69  { return worksetContainer_; }
70 
71  const std::vector< Teuchos::RCP< PHX::FieldManager<panzer::Traits> > >&
73 
77  {
78  const std::vector<WorksetDescriptor> & wkstDesc = getVolumeWorksetDescriptors();
79  std::vector<WorksetDescriptor>::const_iterator itr = std::find(wkstDesc.begin(),wkstDesc.end(),wd);
80  TEUCHOS_ASSERT(itr!=wkstDesc.end());
81 
82  // get volume field manager associated with the block ID
83  int index = itr - wkstDesc.begin();
84  return getVolumeFieldManagers()[index];
85  }
86 
87  const std::vector<WorksetDescriptor> &
89 
90  const std::map<panzer::BC,
91  std::map<unsigned,PHX::FieldManager<panzer::Traits> >,
94 
95  // The intention of the next set of functions is to simplify and eventually
96  // replace the setup routine above. Its not clear that these functions
97  // belong in the field manager builder. Additionally this will add increased
98  // flexibility to the field manager build in that the DOFManager will be
99  // specified in a more flexable and generic way. Onward.... (ECC - 1/13/11)
100 
104  void setupVolumeFieldManagers(const std::vector<Teuchos::RCP<panzer::PhysicsBlock> >& physicsBlocks,
106  const Teuchos::ParameterList& closure_models,
107  const LinearObjFactory<panzer::Traits> & lo_factory,
108  const Teuchos::ParameterList& user_data);
109 
110  void setupVolumeFieldManagers(const std::vector<Teuchos::RCP<panzer::PhysicsBlock> >& physicsBlocks,
111  const std::vector<WorksetDescriptor> & wkstDesc,
113  const Teuchos::ParameterList& closure_models,
114  const LinearObjFactory<panzer::Traits> & lo_factory,
115  const Teuchos::ParameterList& user_data,
116  const GenericEvaluatorFactory & gEvalFact,
117  bool closureModelByEBlock=false);
118 
121  void setupBCFieldManagers(const std::vector<panzer::BC> & bcs,
122  const std::vector<Teuchos::RCP<panzer::PhysicsBlock> >& physicsBlocks,
123  const panzer::EquationSetFactory & eqset_factory,
125  const panzer::BCStrategyFactory& bc_factory,
126  const Teuchos::ParameterList& closure_models,
127  const LinearObjFactory<panzer::Traits> & lo_factory,
128  const Teuchos::ParameterList& user_data)
129  { setupBCFieldManagers(bcs,physicsBlocks,Teuchos::ptrFromRef(eqset_factory),cm_factory,bc_factory,closure_models,lo_factory,user_data); }
130 
131  void setupBCFieldManagers(const std::vector<panzer::BC> & bcs,
132  const std::vector<Teuchos::RCP<panzer::PhysicsBlock> >& physicsBlocks,
134  const panzer::BCStrategyFactory& bc_factory,
135  const Teuchos::ParameterList& closure_models,
136  const LinearObjFactory<panzer::Traits> & lo_factory,
137  const Teuchos::ParameterList& user_data)
138  { setupBCFieldManagers(bcs,physicsBlocks,Teuchos::null,cm_factory,bc_factory,closure_models,lo_factory,user_data); }
139 
140  void writeVolumeGraphvizDependencyFiles(std::string filename_prefix,
141  const std::vector<Teuchos::RCP<panzer::PhysicsBlock> >& physicsBlocks) const;
142 
143  void writeBCGraphvizDependencyFiles(std::string filename_prefix) const;
144 
145  void writeVolumeTextDependencyFiles(std::string filename_prefix,
146  const std::vector<Teuchos::RCP<panzer::PhysicsBlock> >& physicsBlocks) const;
147 
148  void writeBCTextDependencyFiles(std::string filename_prefix) const;
149 
151  void clearVolumeFieldManagers(bool clearVolumeWorksets = true);
152 
154  void setActiveEvaluationTypes(const std::vector<bool>& aet);
155 
156  private:
159  void setupBCFieldManagers(const std::vector<panzer::BC> & bcs,
160  const std::vector<Teuchos::RCP<panzer::PhysicsBlock> >& physicsBlocks,
163  const panzer::BCStrategyFactory& bc_factory,
164  const Teuchos::ParameterList& closure_models,
165  const LinearObjFactory<panzer::Traits> & lo_factory,
166  const Teuchos::ParameterList& user_data);
167 
168  void setKokkosExtendedDataTypeDimensions(const std::string & eblock,
169  const panzer::GlobalIndexer & globalIndexer,
170  const Teuchos::ParameterList& user_data,
172 
174  std::vector< Teuchos::RCP< PHX::FieldManager<panzer::Traits> > >
176 
180  std::vector<WorksetDescriptor> volume_workset_desc_;
181 
188  std::map<panzer::BC,
189  std::map<unsigned,PHX::FieldManager<panzer::Traits> >,
191 
193 
198 
203 
205  std::vector<bool> active_evaluation_types_;
206  };
207 
208 std::ostream& operator<<(std::ostream& os, const panzer::FieldManagerBuilder & rfd);
209 
210 } // namespace panzer
211 
212 #endif
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)
Allocates and initializes an equation set template manager.
const std::map< panzer::BC, std::map< unsigned, PHX::FieldManager< panzer::Traits > >, panzer::LessBC > & getBCFieldManagers() const
Object that contains information on the physics and discretization of a block of elements with the SA...
void writeVolumeGraphvizDependencyFiles(std::string filename_prefix, const std::vector< Teuchos::RCP< panzer::PhysicsBlock > > &physicsBlocks) const
void writeBCGraphvizDependencyFiles(std::string filename_prefix) 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 writeBCTextDependencyFiles(std::string filename_prefix) const
void setWorksetContainer(const Teuchos::RCP< WorksetContainer > &wc)
Teuchos::RCP< WorksetContainer > getWorksetContainer() const
bool registerEvaluators(PHX::FieldManager< panzer::Traits > &, const WorksetDescriptor &, const PhysicsBlock &) const
void print(std::ostream &os) const
void writeVolumeTextDependencyFiles(std::string filename_prefix, const std::vector< Teuchos::RCP< panzer::PhysicsBlock > > &physicsBlocks) const
const std::vector< Teuchos::RCP< PHX::FieldManager< panzer::Traits > > > & getVolumeFieldManagers() const
Teuchos::RCP< WorksetContainer > worksetContainer_
std::vector< WorksetDescriptor > volume_workset_desc_
Matches volume field managers so you can determine the appropriate set of worksets for each field man...
std::vector< Teuchos::RCP< PHX::FieldManager< panzer::Traits > > > phx_volume_field_managers_
Phalanx volume field managers for each element block.
void setupBCFieldManagers(const std::vector< panzer::BC > &bcs, const std::vector< Teuchos::RCP< panzer::PhysicsBlock > > &physicsBlocks, 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)
virtual bool registerEvaluators(PHX::FieldManager< panzer::Traits > &fm, const WorksetDescriptor &wd, const PhysicsBlock &pb) const =0
std::ostream & operator<<(std::ostream &os, const AssemblyEngineInArgs &in)
FieldManagerBuilder(bool disablePhysicsBlockScatter=false, bool disablePhysicsBlockGather=false)
std::map< panzer::BC, std::map< unsigned, PHX::FieldManager< panzer::Traits > >, panzer::LessBC > bc_field_managers_
Field managers for the boundary conditions.
Teuchos::RCP< PHX::FieldManager< panzer::Traits > > getVolumeFieldManager(const WorksetDescriptor &wd) const
Look up field manager by an element block ID.
Stores input information for a boundary condition.
Definition: Panzer_BC.hpp:48
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)
std::map< unsigned, panzer::Workset > BCFaceWorksetMap
#define TEUCHOS_ASSERT(assertion_test)
std::vector< bool > active_evaluation_types_
Entries correspond to evaluation type mpl vector in traits. A value of true means the evaluation type...
void setActiveEvaluationTypes(const std::vector< bool > &aet)
Set a vector of active evaluation types to allocate.
const std::vector< WorksetDescriptor > & getVolumeWorksetDescriptors() const