59 const std::map<std::string,WorksetNeeds> & needs)
60 : wkstFactory_(factory), worksetSize_(0)
70 : wkstFactory_(wc.wkstFactory_)
71 , worksetSize_(wc.worksetSize_)
104 std::map<std::string,WorksetNeeds>::const_iterator itr =
ebToNeeds_.find(eBlock);
107 "WorksetContainer::lookupNeeds no WorksetNeeds object is associated "
108 "with the element block \""+eBlock+
"\".");
116 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::WorksetContainer::getWorksets()",pwkst_con_get_worksets);
119 WorksetMap::iterator itr =
worksets_.find(wd);
132 if(worksetVector!=Teuchos::null)
139 worksetVector = itr->second;
141 return worksetVector;
148 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::WorksetContainer::getSideWorksets()",pwkst_con_get_side_worksets);
166 if(worksetMap!=Teuchos::null)
169 if(worksetMap!=Teuchos::null)
176 worksetMap = itr->second;
191 addBasis(
const std::string & type,
int order,
const std::string & rep_field)
201 needs.
bases.push_back(basis);
212 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::WorksetContainer::applyOrientations(ugi)",pwkst_con_apply_orts);
221 "global indexer is not set yet");
225 for(WorksetMap::iterator itr=
worksets_.begin();
227 std::string eBlock = itr->first.getElementBlock();
243 std::size_t hash = std::hash<WorksetDescriptor>()(wd);
244 for(std::size_t i=0;i<worksets.size();i++)
245 worksets[i].setIdentifier(hash+i);
251 std::size_t hash = std::hash<WorksetDescriptor>()(wd);
252 std::size_t offset = 0;
253 for(
auto itr : workset_map) {
255 workset_map[itr.first].setIdentifier(hash+offset);
266 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::WorksetContainer::applyOrientations(eBlock,worksets)",pwkst_con_apply_orts_eb_w);
277 fout <<
"Panzer Warning: No global indexer assigned to a workset container or factory. "
278 <<
"Orientation of the basis for edge basis functions cannot be applied, "
279 <<
"if those basis functions are used, there will be problems!" << std::endl;
286 "intrepid2 orientation is not constructed");
298 if(needs.
bases.size()>0) {
302 for(std::size_t w=0;w<needs.
bases.size();w++) {
310 std::vector<Intrepid2::Orientation> ortsPerBlock;
313 for(std::size_t i=0;i<worksets.size();i++) {
315 if(worksets[i].num_cells<=0)
continue;
317 for(std::size_t j=0;j<worksets[i].numDetails();j++) {
320 ortsPerBlock.clear();
321 for (
int k=0;k<worksets[i].num_cells;++k) {
325 for(std::size_t basis_index=0;basis_index<details.
bases.size();basis_index++) {
329 if(layout->getBasis()->name()!=basis.
name())
334 if(layout->getBasis()->requiresOrientations()) {
336 auto & bv = *details.
bases[basis_index];
337 if(not bv.orientationsApplied())
338 bv.applyOrientations(ortsPerBlock,(
int) worksets[i].num_cells);
345 else if(needs.
getBases().size()>0) {
351 for(
const auto & bd : needs.
getBases()) {
354 std::vector<Intrepid2::Orientation> ortsPerBlock;
357 for(std::size_t i=0;i<worksets.size();i++) {
359 if(worksets[i].num_cells<=0)
continue;
361 for(std::size_t j=0;j<worksets[i].numDetails();j++) {
364 ortsPerBlock.clear();
373 if(not bv.orientationsApplied())
374 bv.applyOrientations(ortsPerBlock,(
int) worksets[i].num_cells);
388 PANZER_FUNC_TIME_MONITOR_DIFF(
"panzer::WorksetContainer::applyOrientations(wd,worksets)",pwkst_con_apply_orts_wd_wksts);
399 fout <<
"Panzer Warning: No global indexer assigned to a workset container or factory. "
400 <<
"Orientation of the basis for edge basis functions cannot be applied, "
401 <<
"if those basis functions are used, there will be problems!";
413 if(needs.
bases.size()>0) {
416 for(std::size_t i=0;i<needs.
bases.size();i++) {
423 std::vector<Intrepid2::Orientation> ortsPerBlock;
426 for(std::map<unsigned,Workset>::iterator itr=worksets.begin();
427 itr!=worksets.end();++itr) {
430 if(itr->second.num_cells<=0)
continue;
432 for(std::size_t j=0;j<itr->second.numDetails();j++) {
435 ortsPerBlock.clear();
436 for (
int k=0;k<itr->second.num_cells;++k) {
440 for(std::size_t basis_index=0;basis_index<details.
bases.size();basis_index++) {
444 if(layout->getBasis()->name()!=basis.
name())
449 if(layout->getBasis()->requiresOrientations()) {
451 auto & bv = *details.
bases[basis_index];
452 if(not bv.orientationsApplied())
453 bv.applyOrientations(ortsPerBlock,(
int) itr->second.num_cells);
460 else if(needs.
getBases().size()>0) {
466 for(
const auto & bd : needs.
getBases()) {
469 std::vector<Intrepid2::Orientation> ortsPerBlock;
472 for(std::map<unsigned,Workset>::iterator itr=worksets.begin();
473 itr!=worksets.end();++itr) {
476 if(itr->second.num_cells<=0)
continue;
478 for(std::size_t j=0;j<itr->second.numDetails();j++) {
481 ortsPerBlock.clear();
482 for (
int k=0;k<itr->second.num_cells;++k) {
489 if(not bv.orientationsApplied())
490 bv.applyOrientations(ortsPerBlock,(
int) itr->second.num_cells);
499 const std::vector<std::string> & elementBlockNames,
500 std::map<std::string,
Teuchos::RCP<std::vector<Workset> > > & volumeWksts)
502 for(std::size_t i=0;i<elementBlockNames.size();i++) {
504 volumeWksts[elementBlockNames[i]] = wc.
getWorksets(wd);
509 const std::vector<BC> & bcs,
512 for(std::size_t i=0;i<bcs.size();i++) {
515 if(wksts!=Teuchos::null)
516 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)