59 const std::map<std::string,WorksetNeeds> & needs)
60 : wkstFactory_(factory), worksetSize_(-1)
70 : wkstFactory_(wc.wkstFactory_)
71 , worksetSize_(wc.worksetSize_)
94 std::map<std::string,WorksetNeeds>::const_iterator itr =
ebToNeeds_.find(eBlock);
97 "WorksetContainer::lookupNeeds no WorksetNeeds object is associated "
98 "with the element block \""+eBlock+
"\".");
107 WorksetMap::iterator itr =
worksets_.find(wd);
118 if(worksetVector!=Teuchos::null)
125 worksetVector = itr->second;
127 return worksetVector;
150 if(worksetMap!=Teuchos::null)
153 if(worksetMap!=Teuchos::null)
160 worksetMap = itr->second;
175 addBasis(
const std::string & type,
int order,
const std::string & rep_field)
185 needs.
bases.push_back(basis);
203 "global indexer is not set yet");
207 for(WorksetMap::iterator itr=
worksets_.begin();
209 std::string eBlock = itr->first.getElementBlock();
225 std::size_t hash = std::hash<WorksetDescriptor>()(wd);
226 for(std::size_t i=0;i<worksets.size();i++)
227 worksets[i].setIdentifier(hash+i);
233 std::size_t hash = std::hash<WorksetDescriptor>()(wd);
234 std::size_t offset = 0;
235 for(
auto itr : workset_map) {
237 workset_map[itr.first].setIdentifier(hash+offset);
257 fout <<
"Panzer Warning: No global indexer assigned to a workset container. "
258 <<
"Orientation of the basis for edge basis functions cannot be applied, "
259 <<
"if those basis functions are used, there will be problems!" << std::endl;
265 "intrepid2 orientation is not constructed");
274 if(needs.
bases.size()>0) {
278 for(std::size_t w=0;w<needs.
bases.size();w++) {
286 std::vector<Intrepid2::Orientation> ortsPerBlock;
289 for(std::size_t i=0;i<worksets.size();i++) {
291 if(worksets[i].num_cells<=0)
continue;
293 for(std::size_t j=0;j<worksets[i].numDetails();j++) {
296 ortsPerBlock.clear();
297 for (
int k=0;k<worksets[i].num_cells;++k) {
301 for(std::size_t basis_index=0;basis_index<details.
bases.size();basis_index++) {
305 if(layout->getBasis()->name()!=basis.
name())
310 if(layout->getBasis()->requiresOrientations()) {
312 details.
bases[basis_index]->applyOrientations(ortsPerBlock,(
int) worksets[i].num_cells);
319 else if(needs.
getBases().size()>0) {
325 for(
const auto & bd : needs.
getBases()) {
328 std::vector<Intrepid2::Orientation> ortsPerBlock;
331 for(std::size_t i=0;i<worksets.size();i++) {
333 if(worksets[i].num_cells<=0)
continue;
335 for(std::size_t j=0;j<worksets[i].numDetails();j++) {
338 ortsPerBlock.clear();
346 details.
getBasisValues(bd,
id).applyOrientations(ortsPerBlock,(
int) worksets[i].num_cells);
369 fout <<
"Panzer Warning: No global indexer assigned to a workset container. "
370 <<
"Orientation of the basis for edge basis functions cannot be applied, "
371 <<
"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 details.
bases[basis_index]->applyOrientations(ortsPerBlock,(
int) itr->second.num_cells);
426 else if(needs.
getBases().size()>0) {
432 for(
const auto & bd : needs.
getBases()) {
435 std::vector<Intrepid2::Orientation> ortsPerBlock;
438 for(std::map<unsigned,Workset>::iterator itr=worksets.begin();
439 itr!=worksets.end();++itr) {
442 if(itr->second.num_cells<=0)
continue;
444 for(std::size_t j=0;j<itr->second.numDetails();j++) {
447 ortsPerBlock.clear();
448 for (
int k=0;k<itr->second.num_cells;++k) {
454 details.
getBasisValues(bd,
id).applyOrientations(ortsPerBlock,(
int) itr->second.num_cells);
463 const std::vector<std::string> & elementBlockNames,
464 std::map<std::string,
Teuchos::RCP<std::vector<Workset> > > & volumeWksts)
466 for(std::size_t i=0;i<elementBlockNames.size();i++) {
468 volumeWksts[elementBlockNames[i]] = wc.
getWorksets(wd);
473 const std::vector<BC> & bcs,
476 for(std::size_t i=0;i<bcs.size();i++) {
479 if(wksts!=Teuchos::null)
480 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
Teuchos::RCP< std::vector< Intrepid2::Orientation > > orientations_
bool connectsElementBlocks() const
Identifies this workset as an interface between two element blocks.
void setGlobalIndexer(const Teuchos::RCP< const panzer::UniqueGlobalIndexerBase > &ugi)
WorksetContainer()
Default contructor, starts with no workset factory objects.
#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
Class that provides access to worksets on each element block and side set.
bool requiresOrientations() const
Teuchos::RCP< std::vector< Intrepid2::Orientation > > buildIntrepidOrientation(const Teuchos::RCP< const UniqueGlobalIndexerBase > globalIndexer)
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 applyOrientations(const Teuchos::RCP< const panzer::UniqueGlobalIndexerBase > &ugi)
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.
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 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)