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 //
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 #ifndef __Panzer_WorksetContainer_hpp__
44 #define __Panzer_WorksetContainer_hpp__
45 
46 #include "Teuchos_RCP.hpp"
47 
48 #include "Intrepid2_Orientation.hpp"
49 
50 #include "Panzer_PhysicsBlock.hpp"
51 #include "Panzer_BC.hpp"
53 #include "Panzer_WorksetDescriptor.hpp" // what the workset is defined over
54 #include "Panzer_WorksetNeeds.hpp" // whats in a workset basis/integration rules
55 
56 namespace panzer {
57 
58 // forward declaration
59 class GlobalIndexer;
60 
74 public:
77 
86  const std::map<std::string,WorksetNeeds> & needs);
87 
92 
97  { clear(); wkstFactory_ = factory; }
98 
101  { return wkstFactory_; }
102 
104  void setWorksetSize(std::size_t worksetSize)
105  { worksetSize_ = worksetSize; }
106 
108  std::size_t getWorksetSize() const
109  { return worksetSize_; }
110 
119  void setNeeds(const std::string & eBlock,const WorksetNeeds & needs);
120 
124  void clear();
125 
133  void clearVolumeWorksets();
134 
139  void clearSideWorksets();
140 
142  const WorksetNeeds & lookupNeeds(const std::string & eBlock) const;
143 
146 
149 
154 
158  void addBasis(const std::string & type,int order,const std::string & rep_field);
159 
163  { return orientations_; }
164 
165 private:
171 
175  void applyOrientations(const std::vector<Intrepid2::Orientation> & orientations,
176  const std::string & eBlock,
177  std::vector<Workset> & worksets) const;
178 
181  void applyOrientations(const std::vector<Intrepid2::Orientation> & orientations,
182  const WorksetDescriptor & desc,
183  std::map<unsigned,Workset> & worksets) const;
184 
185  typedef std::unordered_map<WorksetDescriptor,Teuchos::RCP<std::vector<Workset> > > WorksetMap;
186  typedef std::unordered_map<WorksetDescriptor,Teuchos::RCP<std::map<unsigned,Workset> > > SideMap;
187 
191  void applyOrientations(const std::string & eBlock,std::vector<Workset> & worksets) const;
192 
195  void applyOrientations(const WorksetDescriptor & desc,std::map<unsigned,Workset> & worksets) const;
196 
202  void setIdentifiers(const WorksetDescriptor & wd,std::vector<Workset> & worksets);
203 
209  void setIdentifiers(const WorksetDescriptor & wd,std::map<unsigned,Workset> & wkstMap);
210 
212  std::map<std::string,WorksetNeeds> ebToNeeds_;
213 
216 
217  std::size_t worksetSize_;
218 
220 
222 };
223 
234  const std::vector<std::string> & elementBlockNames,
235  std::map<std::string,Teuchos::RCP<std::vector<Workset> > > & volumeWksts);
236 
247  const std::vector<BC> & bcs,
248  std::map<BC,Teuchos::RCP<std::map<unsigned,Workset> >,LessBC> & sideWksts);
249 
250 }
251 
252 #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:81
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)