Panzer Version of the Day
Loading...
Searching...
No Matches
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
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
56namespace panzer {
57
58// forward declaration
59class GlobalIndexer;
60
74public:
77
85 WorksetContainer(const Teuchos::RCP<const WorksetFactoryBase> & factory,
86 const std::map<std::string,WorksetNeeds> & needs = {});
87
92
96 void setFactory(const Teuchos::RCP<const WorksetFactoryBase> & factory)
97 { clear(); wkstFactory_ = factory; }
98
100 Teuchos::RCP<const WorksetFactoryBase> getFactory() const
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
145 Teuchos::RCP<std::vector<Workset> > getWorksets(const WorksetDescriptor & wd);
146
148 Teuchos::RCP<std::map<unsigned,Workset> > getSideWorksets(const WorksetDescriptor & desc);
149
153 void setGlobalIndexer(const Teuchos::RCP<const panzer::GlobalIndexer> & ugi);
154
158 void addBasis(const std::string & type,int order,const std::string & rep_field);
159
162 Teuchos::RCP<const std::vector<Intrepid2::Orientation> > getOrientations() const
163 { return orientations_; }
164
165private:
170 void applyOrientations(const Teuchos::RCP<const panzer::GlobalIndexer> & ugi);
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
215 bool hasNeeds() const
216 {return ebToNeeds_.size() > 0;}
217
218 Teuchos::RCP<const WorksetFactoryBase> wkstFactory_;
219 std::map<std::string,WorksetNeeds> ebToNeeds_;
220
223
224 std::size_t worksetSize_;
225
226 Teuchos::RCP<const panzer::GlobalIndexer> globalIndexer_;
227
228 Teuchos::RCP<std::vector<Intrepid2::Orientation> > orientations_;
229};
230
241 const std::vector<std::string> & elementBlockNames,
242 std::map<std::string,Teuchos::RCP<std::vector<Workset> > > & volumeWksts);
243
254 const std::vector<BC> & bcs,
255 std::map<BC,Teuchos::RCP<std::map<unsigned,Workset> >,LessBC> & sideWksts);
256
257}
258
259#endif
Stores input information for a boundary condition.
Definition Panzer_BC.hpp:81
Class that provides access to worksets on each element block and side set.
void applyOrientations(const std::vector< Intrepid2::Orientation > &orientations, const std::string &eBlock, std::vector< Workset > &worksets) const
Teuchos::RCP< std::vector< Workset > > getWorksets(const WorksetDescriptor &wd)
Access to volume worksets.
std::size_t getWorksetSize() const
get the workset size
const WorksetNeeds & lookupNeeds(const std::string &eBlock) const
Look up an input physics block, throws an exception if it can not be found.
void setIdentifiers(const WorksetDescriptor &wd, std::vector< Workset > &worksets)
void setWorksetSize(std::size_t worksetSize)
set the workset size
void applyOrientations(const Teuchos::RCP< const panzer::GlobalIndexer > &ugi)
void addBasis(const std::string &type, int order, const std::string &rep_field)
WorksetMap worksets_
Maps element blocks to input physics block objects.
void applyOrientations(const std::vector< Intrepid2::Orientation > &orientations, const WorksetDescriptor &desc, std::map< unsigned, Workset > &worksets) const
void setGlobalIndexer(const Teuchos::RCP< const panzer::GlobalIndexer > &ugi)
void setNeeds(const std::string &eBlock, const WorksetNeeds &needs)
Teuchos::RCP< std::vector< Intrepid2::Orientation > > orientations_
std::unordered_map< WorksetDescriptor, Teuchos::RCP< std::map< unsigned, Workset > > > SideMap
Teuchos::RCP< std::map< unsigned, Workset > > getSideWorksets(const WorksetDescriptor &desc)
Access, and construction of side worksets.
WorksetContainer()
Default contructor, starts with no workset factory objects.
Teuchos::RCP< const WorksetFactoryBase > wkstFactory_
void setFactory(const Teuchos::RCP< const WorksetFactoryBase > &factory)
Teuchos::RCP< const WorksetFactoryBase > getFactory() const
Access the workset factory pointer.
Teuchos::RCP< const panzer::GlobalIndexer > globalIndexer_
std::unordered_map< WorksetDescriptor, Teuchos::RCP< std::vector< Workset > > > WorksetMap
std::map< std::string, WorksetNeeds > ebToNeeds_
How to construct worksets.
Teuchos::RCP< const std::vector< Intrepid2::Orientation > > getOrientations() const
void getVolumeWorksetsFromContainer(WorksetContainer &wc, const std::vector< std::string > &elementBlockNames, std::map< std::string, Teuchos::RCP< std::vector< Workset > > > &volumeWksts)
void getSideWorksetsFromContainer(WorksetContainer &wc, const std::vector< BC > &bcs, std::map< BC, Teuchos::RCP< std::map< unsigned, Workset > >, LessBC > &sideWksts)