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 UniqueGlobalIndexerBase;
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 
126 
128  const WorksetNeeds & lookupNeeds(const std::string & eBlock) const;
129 
132 
135 
140 
144  void addBasis(const std::string & type,int order,const std::string & rep_field);
145 
149  { return orientations_; }
150 
151 private:
157 
161  void applyOrientations(const std::vector<Intrepid2::Orientation> & orientations,
162  const std::string & eBlock,
163  std::vector<Workset> & worksets) const;
164 
167  void applyOrientations(const std::vector<Intrepid2::Orientation> & orientations,
168  const WorksetDescriptor & desc,
169  std::map<unsigned,Workset> & worksets) const;
170 
171  typedef std::unordered_map<WorksetDescriptor,Teuchos::RCP<std::vector<Workset> > > WorksetMap;
172  typedef std::unordered_map<WorksetDescriptor,Teuchos::RCP<std::map<unsigned,Workset> > > SideMap;
173 
177  void applyOrientations(const std::string & eBlock,std::vector<Workset> & worksets) const;
178 
181  void applyOrientations(const WorksetDescriptor & desc,std::map<unsigned,Workset> & worksets) const;
182 
188  void setIdentifiers(const WorksetDescriptor & wd,std::vector<Workset> & worksets);
189 
195  void setIdentifiers(const WorksetDescriptor & wd,std::map<unsigned,Workset> & wkstMap);
196 
198  std::map<std::string,WorksetNeeds> ebToNeeds_;
199 
202 
203  std::size_t worksetSize_;
204 
206 
208 };
209 
220  const std::vector<std::string> & elementBlockNames,
221  std::map<std::string,Teuchos::RCP<std::vector<Workset> > > & volumeWksts);
222 
233  const std::vector<BC> & bcs,
234  std::map<BC,Teuchos::RCP<std::map<unsigned,Workset> >,LessBC> & sideWksts);
235 
236 }
237 
238 #endif
std::size_t getWorksetSize() const
get the workset size
Teuchos::RCP< std::vector< Intrepid2::Orientation > > orientations_
void setGlobalIndexer(const Teuchos::RCP< const panzer::UniqueGlobalIndexerBase > &ugi)
WorksetContainer()
Default contructor, starts with no workset factory objects.
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.
void applyOrientations(const Teuchos::RCP< const panzer::UniqueGlobalIndexerBase > &ugi)
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)
Teuchos::RCP< const panzer::UniqueGlobalIndexerBase > globalIndexer_
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)