27 const std::map<std::string,WorksetNeeds> & needs)
28 : wkstFactory_(factory), worksetSize_(0)
38 : wkstFactory_(wc.wkstFactory_)
39 , worksetSize_(wc.worksetSize_)
72 std::map<std::string,WorksetNeeds>::const_iterator itr =
ebToNeeds_.find(eBlock);
75 "WorksetContainer::lookupNeeds no WorksetNeeds object is associated "
76 "with the element block \""+eBlock+
"\".");
84 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::WorksetContainer::getWorksets()",pwkst_con_get_worksets);
87 WorksetMap::iterator itr =
worksets_.find(wd);
100 if(worksetVector!=Teuchos::null)
107 worksetVector = itr->second;
109 return worksetVector;
116 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::WorksetContainer::getSideWorksets()",pwkst_con_get_side_worksets);
134 if(worksetMap!=Teuchos::null)
137 if(worksetMap!=Teuchos::null)
144 worksetMap = itr->second;
159 addBasis(
const std::string & type,
int order,
const std::string & rep_field)
169 needs.
bases.push_back(basis);
180 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::WorksetContainer::applyOrientations(ugi)",pwkst_con_apply_orts);
189 "global indexer is not set yet");
193 for(WorksetMap::iterator itr=
worksets_.begin();
195 std::string eBlock = itr->first.getElementBlock();
211 std::size_t hash = std::hash<WorksetDescriptor>()(wd);
212 for(std::size_t i=0;i<worksets.size();i++)
213 worksets[i].setIdentifier(hash+i);
219 std::size_t hash = std::hash<WorksetDescriptor>()(wd);
220 std::size_t offset = 0;
221 for(
auto itr : workset_map) {
223 workset_map[itr.first].setIdentifier(hash+offset);
234 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::WorksetContainer::applyOrientations(eBlock,worksets)",pwkst_con_apply_orts_eb_w);
245 fout <<
"Panzer Warning: No global indexer assigned to a workset container or factory. "
246 <<
"Orientation of the basis for edge basis functions cannot be applied, "
247 <<
"if those basis functions are used, there will be problems!" << std::endl;
254 "intrepid2 orientation is not constructed");
266 if(needs.
bases.size()>0) {
270 for(std::size_t w=0;w<needs.
bases.size();w++) {
278 std::vector<Intrepid2::Orientation> ortsPerBlock;
281 for(std::size_t i=0;i<worksets.size();i++) {
283 if(worksets[i].num_cells<=0)
continue;
285 for(std::size_t j=0;j<worksets[i].numDetails();j++) {
288 ortsPerBlock.clear();
289 for (
int k=0;k<worksets[i].num_cells;++k) {
293 for(std::size_t basis_index=0;basis_index<details.
bases.size();basis_index++) {
297 if(layout->getBasis()->name()!=basis.
name())
302 if(layout->getBasis()->requiresOrientations()) {
304 auto & bv = *details.
bases[basis_index];
305 if(not bv.orientationsApplied())
306 bv.applyOrientations(ortsPerBlock,(
int) worksets[i].num_cells);
313 else if(needs.
getBases().size()>0) {
319 for(
const auto & bd : needs.
getBases()) {
322 std::vector<Intrepid2::Orientation> ortsPerBlock;
325 for(std::size_t i=0;i<worksets.size();i++) {
327 if(worksets[i].num_cells<=0)
continue;
329 for(std::size_t j=0;j<worksets[i].numDetails();j++) {
332 ortsPerBlock.clear();
341 if(not bv.orientationsApplied())
342 bv.applyOrientations(ortsPerBlock,(
int) worksets[i].num_cells);
356 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::WorksetContainer::applyOrientations(wd,worksets)",pwkst_con_apply_orts_wd_wksts);
367 fout <<
"Panzer Warning: No global indexer assigned to a workset container or factory. "
368 <<
"Orientation of the basis for edge basis functions cannot be applied, "
369 <<
"if those basis functions are used, there will be problems!";
381 if(needs.
bases.size()>0) {
384 for(std::size_t i=0;i<needs.
bases.size();i++) {
391 std::vector<Intrepid2::Orientation> ortsPerBlock;
394 for(std::map<unsigned,Workset>::iterator itr=worksets.begin();
395 itr!=worksets.end();++itr) {
398 if(itr->second.num_cells<=0)
continue;
400 for(std::size_t j=0;j<itr->second.numDetails();j++) {
403 ortsPerBlock.clear();
404 for (
int k=0;k<itr->second.num_cells;++k) {
408 for(std::size_t basis_index=0;basis_index<details.
bases.size();basis_index++) {
412 if(layout->getBasis()->name()!=basis.
name())
417 if(layout->getBasis()->requiresOrientations()) {
419 auto & bv = *details.
bases[basis_index];
420 if(not bv.orientationsApplied())
421 bv.applyOrientations(ortsPerBlock,(
int) itr->second.num_cells);
428 else if(needs.
getBases().size()>0) {
434 for(
const auto & bd : needs.
getBases()) {
437 std::vector<Intrepid2::Orientation> ortsPerBlock;
440 for(std::map<unsigned,Workset>::iterator itr=worksets.begin();
441 itr!=worksets.end();++itr) {
444 if(itr->second.num_cells<=0)
continue;
446 for(std::size_t j=0;j<itr->second.numDetails();j++) {
449 ortsPerBlock.clear();
450 for (
int k=0;k<itr->second.num_cells;++k) {
457 if(not bv.orientationsApplied())
458 bv.applyOrientations(ortsPerBlock,(
int) itr->second.num_cells);
467 const std::vector<std::string> & elementBlockNames,
468 std::map<std::string,
Teuchos::RCP<std::vector<Workset> > > & volumeWksts)
470 for(std::size_t i=0;i<elementBlockNames.size();i++) {
472 volumeWksts[elementBlockNames[i]] = wc.
getWorksets(wd);
477 const std::vector<BC> & bcs,
480 for(std::size_t i=0;i<bcs.size();i++) {
483 if(wksts!=Teuchos::null)
484 sideWksts[bcs[i]] = wksts;
std::string name() const
A unique key that is the combination of the basis type and basis order.
std::vector< Teuchos::RCP< const PureBasis > > bases
void setGlobalIndexer(const Teuchos::RCP< const panzer::GlobalIndexer > &ugi)
Teuchos::RCP< std::vector< Intrepid2::Orientation > > orientations_
bool connectsElementBlocks() const
Identifies this workset as an interface between two element blocks.
WorksetContainer()
Default contructor, starts with no workset factory objects.
std::vector< size_t > cell_local_ids
Teuchos::RCP< const panzer::GlobalIndexer > globalIndexer_
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
std::vector< Teuchos::RCP< panzer::BasisValues2< double > > > bases
Static basis function data, key is basis name, value is index in the static_bases vector...
Teuchos::RCP< const WorksetFactoryBase > wkstFactory_
const std::string & getElementBlock(const int block=0) const
Get element block name.
int numOwnedCells() const
Number of cells owned by this workset.
std::vector< std::string > rep_field_name
void buildIntrepidOrientation(std::vector< Intrepid2::Orientation > &orientation, panzer::ConnManager &connMgr)
Builds the element orientations for all element blocks.
Class that provides access to worksets on each element block and side set.
bool requiresOrientations() const
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.
const std::vector< panzer::BasisDescriptor > & getBases() const
Get a list of bases being requested.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
void clearVolumeWorksets()
Teuchos::RCP< std::vector< Workset > > getWorksets(const WorksetDescriptor &wd)
Access to volume worksets.
basic_FancyOStream & setOutputToRootOnly(const int rootRank)
bool applyOrientations() const
void setIdentifiers(const WorksetDescriptor &wd, std::vector< Workset > &worksets)
const std::vector< panzer::IntegrationDescriptor > & getIntegrators() const
Get a list of integrators being requested.
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 addBasis(const std::string &type, int order, const std::string &rep_field)
WorksetDescriptor blockDescriptor(const std::string &eBlock)
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.
Description and data layouts associated with a particular basis.
#define TEUCHOS_ASSERT(assertion_test)
void setNeeds(const std::string &eBlock, const WorksetNeeds &needs)
const panzer::BasisValues2< double > & getBasisValues(const panzer::BasisDescriptor &basis_description, const bool lazy_version=false) const
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)