Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_WorksetContainer.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_WorksetContainer_hpp__
12 #define __Panzer_WorksetContainer_hpp__
13 
14 #include "Teuchos_RCP.hpp"
15 
16 #include "Intrepid2_Orientation.hpp"
17 
18 #include "Panzer_PhysicsBlock.hpp"
19 #include "Panzer_BC.hpp"
21 #include "Panzer_WorksetDescriptor.hpp" // what the workset is defined over
22 #include "Panzer_WorksetNeeds.hpp" // whats in a workset basis/integration rules
23 
24 namespace panzer {
25 
26 // forward declaration
27 class GlobalIndexer;
28 
42 public:
45 
54  const std::map<std::string,WorksetNeeds> & needs = {});
55 
60 
65  { clear(); wkstFactory_ = factory; }
66 
69  { return wkstFactory_; }
70 
72  void setWorksetSize(std::size_t worksetSize)
73  { worksetSize_ = worksetSize; }
74 
76  std::size_t getWorksetSize() const
77  { return worksetSize_; }
78 
87  void setNeeds(const std::string & eBlock,const WorksetNeeds & needs);
88 
92  void clear();
93 
101  void clearVolumeWorksets();
102 
107  void clearSideWorksets();
108 
110  const WorksetNeeds & lookupNeeds(const std::string & eBlock) const;
111 
114 
117 
122 
126  void addBasis(const std::string & type,int order,const std::string & rep_field);
127 
131  { return orientations_; }
132 
133 private:
139 
143  void applyOrientations(const std::vector<Intrepid2::Orientation> & orientations,
144  const std::string & eBlock,
145  std::vector<Workset> & worksets) const;
146 
149  void applyOrientations(const std::vector<Intrepid2::Orientation> & orientations,
150  const WorksetDescriptor & desc,
151  std::map<unsigned,Workset> & worksets) const;
152 
153  typedef std::unordered_map<WorksetDescriptor,Teuchos::RCP<std::vector<Workset> > > WorksetMap;
154  typedef std::unordered_map<WorksetDescriptor,Teuchos::RCP<std::map<unsigned,Workset> > > SideMap;
155 
159  void applyOrientations(const std::string & eBlock,std::vector<Workset> & worksets) const;
160 
163  void applyOrientations(const WorksetDescriptor & desc,std::map<unsigned,Workset> & worksets) const;
164 
170  void setIdentifiers(const WorksetDescriptor & wd,std::vector<Workset> & worksets);
171 
177  void setIdentifiers(const WorksetDescriptor & wd,std::map<unsigned,Workset> & wkstMap);
178 
183  bool hasNeeds() const
184  {return ebToNeeds_.size() > 0;}
185 
187  std::map<std::string,WorksetNeeds> ebToNeeds_;
188 
191 
192  std::size_t worksetSize_;
193 
195 
197 };
198 
209  const std::vector<std::string> & elementBlockNames,
210  std::map<std::string,Teuchos::RCP<std::vector<Workset> > > & volumeWksts);
211 
222  const std::vector<BC> & bcs,
223  std::map<BC,Teuchos::RCP<std::map<unsigned,Workset> >,LessBC> & sideWksts);
224 
225 }
226 
227 #endif
std::size_t getWorksetSize() const
get the workset size
void setGlobalIndexer(const Teuchos::RCP< const panzer::GlobalIndexer > &ugi)
Teuchos::RCP< std::vector< Intrepid2::Orientation > > orientations_
WorksetContainer()
Default contructor, starts with no workset factory objects.
Teuchos::RCP< const panzer::GlobalIndexer > globalIndexer_
Teuchos::RCP< const WorksetFactoryBase > wkstFactory_
Teuchos::RCP< const std::vector< Intrepid2::Orientation > > getOrientations() const
void setWorksetSize(std::size_t worksetSize)
set the workset size
std::unordered_map< WorksetDescriptor, Teuchos::RCP< std::map< unsigned, Workset > > > SideMap
Class that provides access to worksets on each element block and side set.
Teuchos::RCP< const WorksetFactoryBase > getFactory() const
Access the workset factory pointer.
WorksetMap worksets_
Maps element blocks to input physics block objects.
Teuchos::RCP< std::map< unsigned, Workset > > getSideWorksets(const WorksetDescriptor &desc)
Access, and construction of side worksets.
Teuchos::RCP< std::vector< Workset > > getWorksets(const WorksetDescriptor &wd)
Access to volume worksets.
std::unordered_map< WorksetDescriptor, Teuchos::RCP< std::vector< Workset > > > WorksetMap
void setIdentifiers(const WorksetDescriptor &wd, std::vector< Workset > &worksets)
void applyOrientations(const Teuchos::RCP< const panzer::GlobalIndexer > &ugi)
const WorksetNeeds & lookupNeeds(const std::string &eBlock) const
Look up an input physics block, throws an exception if it can not be found.
void setFactory(const Teuchos::RCP< const WorksetFactoryBase > &factory)
void addBasis(const std::string &type, int order, const std::string &rep_field)
void getSideWorksetsFromContainer(WorksetContainer &wc, const std::vector< BC > &bcs, std::map< BC, Teuchos::RCP< std::map< unsigned, Workset > >, LessBC > &sideWksts)
Stores input information for a boundary condition.
Definition: Panzer_BC.hpp:48
void setNeeds(const std::string &eBlock, const WorksetNeeds &needs)
std::map< std::string, WorksetNeeds > ebToNeeds_
How to construct worksets.
void getVolumeWorksetsFromContainer(WorksetContainer &wc, const std::vector< std::string > &elementBlockNames, std::map< std::string, Teuchos::RCP< std::vector< Workset > > > &volumeWksts)