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+
"\".");
117 WorksetMap::iterator itr =
worksets_.find(wd);
128 if(worksetVector!=Teuchos::null)
135 worksetVector = itr->second;
137 return worksetVector;
160 if(worksetMap!=Teuchos::null)
163 if(worksetMap!=Teuchos::null)
170 worksetMap = itr->second;
185 addBasis(
const std::string & type,
int order,
const std::string & rep_field)
195 needs.
bases.push_back(basis);
213 "global indexer is not set yet");
217 for(WorksetMap::iterator itr=
worksets_.begin();
219 std::string eBlock = itr->first.getElementBlock();
235 std::size_t hash = std::hash<WorksetDescriptor>()(wd);
236 for(std::size_t i=0;i<worksets.size();i++)
237 worksets[i].setIdentifier(hash+i);
243 std::size_t hash = std::hash<WorksetDescriptor>()(wd);
244 std::size_t offset = 0;
245 for(
auto itr : workset_map) {
247 workset_map[itr.first].setIdentifier(hash+offset);
267 fout <<
"Panzer Warning: No global indexer assigned to a workset container. "
268 <<
"Orientation of the basis for edge basis functions cannot be applied, "
269 <<
"if those basis functions are used, there will be problems!" << std::endl;
275 "intrepid2 orientation is not constructed");
284 if(needs.
bases.size()>0) {
288 for(std::size_t w=0;w<needs.
bases.size();w++) {
296 std::vector<Intrepid2::Orientation> ortsPerBlock;
299 for(std::size_t i=0;i<worksets.size();i++) {
301 if(worksets[i].num_cells<=0)
continue;
303 for(std::size_t j=0;j<worksets[i].numDetails();j++) {
306 ortsPerBlock.clear();
307 for (
int k=0;k<worksets[i].num_cells;++k) {
311 for(std::size_t basis_index=0;basis_index<details.
bases.size();basis_index++) {
315 if(layout->getBasis()->name()!=basis.
name())
320 if(layout->getBasis()->requiresOrientations()) {
322 details.
bases[basis_index]->applyOrientations(ortsPerBlock,(
int) worksets[i].num_cells);
329 else if(needs.
getBases().size()>0) {
335 for(
const auto & bd : needs.
getBases()) {
338 std::vector<Intrepid2::Orientation> ortsPerBlock;
341 for(std::size_t i=0;i<worksets.size();i++) {
343 if(worksets[i].num_cells<=0)
continue;
345 for(std::size_t j=0;j<worksets[i].numDetails();j++) {
348 ortsPerBlock.clear();
356 details.
getBasisValues(bd,
id).applyOrientations(ortsPerBlock,(
int) worksets[i].num_cells);
379 fout <<
"Panzer Warning: No global indexer assigned to a workset container. "
380 <<
"Orientation of the basis for edge basis functions cannot be applied, "
381 <<
"if those basis functions are used, there will be problems!";
391 if(needs.
bases.size()>0) {
394 for(std::size_t i=0;i<needs.
bases.size();i++) {
401 std::vector<Intrepid2::Orientation> ortsPerBlock;
404 for(std::map<unsigned,Workset>::iterator itr=worksets.begin();
405 itr!=worksets.end();++itr) {
408 if(itr->second.num_cells<=0)
continue;
410 for(std::size_t j=0;j<itr->second.numDetails();j++) {
413 ortsPerBlock.clear();
414 for (
int k=0;k<itr->second.num_cells;++k) {
418 for(std::size_t basis_index=0;basis_index<details.
bases.size();basis_index++) {
422 if(layout->getBasis()->name()!=basis.
name())
427 if(layout->getBasis()->requiresOrientations()) {
429 details.
bases[basis_index]->applyOrientations(ortsPerBlock,(
int) itr->second.num_cells);
436 else if(needs.
getBases().size()>0) {
442 for(
const auto & bd : needs.
getBases()) {
445 std::vector<Intrepid2::Orientation> ortsPerBlock;
448 for(std::map<unsigned,Workset>::iterator itr=worksets.begin();
449 itr!=worksets.end();++itr) {
452 if(itr->second.num_cells<=0)
continue;
454 for(std::size_t j=0;j<itr->second.numDetails();j++) {
457 ortsPerBlock.clear();
458 for (
int k=0;k<itr->second.num_cells;++k) {
464 details.
getBasisValues(bd,
id).applyOrientations(ortsPerBlock,(
int) itr->second.num_cells);
473 const std::vector<std::string> & elementBlockNames,
474 std::map<std::string,
Teuchos::RCP<std::vector<Workset> > > & volumeWksts)
476 for(std::size_t i=0;i<elementBlockNames.size();i++) {
478 volumeWksts[elementBlockNames[i]] = wc.
getWorksets(wd);
483 const std::vector<BC> & bcs,
486 for(std::size_t i=0;i<bcs.size();i++) {
489 if(wksts!=Teuchos::null)
490 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.
Teuchos::RCP< const panzer::GlobalIndexer > globalIndexer_
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
panzer::BasisValues2< double > & getBasisValues(const panzer::BasisDescriptor &basis_description, const panzer::IntegrationDescriptor &integration_description)
Grab the basis values for a given basis description and integration description (throws error if it d...
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)
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)
std::vector< GO > cell_local_ids
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)