60 : wkstFactory_(factory), worksetSize_(wkstSz)
66 const std::map<std::string,WorksetNeeds> & needs)
67 : wkstFactory_(factory), worksetSize_(-1)
77 : wkstFactory_(wc.wkstFactory_)
78 , worksetSize_(wc.worksetSize_)
86 for(std::size_t i=0;i<physicsBlocks.size();i++) {
87 ebToPb_[physicsBlocks[i]->elementBlockID()] = physicsBlocks[i];
90 for(std::size_t i=0;i<physicsBlocks.size();i++) {
93 needs.
cellData = physicsBlocks[i]->cellData();
95 const std::map<int,RCP<panzer::IntegrationRule> >& int_rules = physicsBlocks[i]->getIntegrationRules();
97 ir_itr != int_rules.end(); ++ir_itr)
98 needs.
int_rules.push_back(ir_itr->second);
100 const std::map<std::string,Teuchos::RCP<panzer::PureBasis> >& bases = physicsBlocks[i]->getBases();
101 const std::vector<StrPureBasisPair>& fieldToBasis = physicsBlocks[i]->getProvidedDOFs();
103 b_itr != bases.end(); ++b_itr) {
104 needs.
bases.push_back(b_itr->second);
107 for(std::size_t d=0;d<fieldToBasis.size();d++) {
108 if(fieldToBasis[d].second->name()==b_itr->second->name()) {
135 std::map<std::string,Teuchos::RCP<PhysicsBlock> >::const_iterator itr =
ebToPb_.find(eBlock);
138 "WorksetContainer::lookupPhysicsBlock no PhysicsBlock object is associated " 139 "with the element block \""+eBlock+
"\".");
147 std::map<std::string,WorksetNeeds>::const_iterator itr =
ebToNeeds_.find(eBlock);
150 "WorksetContainer::lookupNeeds no WorksetNeeds object is associated " 151 "with the element block \""+eBlock+
"\".");
176 if(worksetVector!=Teuchos::null)
183 worksetVector = itr->second;
185 return worksetVector;
201 const std::string & eBlock = side.
eblk_id;
208 if(worksetMap!=Teuchos::null)
215 worksetMap = itr->second;
223 for(std::size_t i=0;i<eBlocks.size();i++) {
225 const std::string & eBlock = eBlocks[i];
240 for(std::size_t i=0;i<bcs.size();i++) {
242 const BC & bc = bcs[i];
264 addBasis(
const std::string & type,
int order,
const std::string & rep_field)
293 std::string eBlock = itr->first.getElementBlock();
301 SideId sideId = itr->first;
312 typedef double Scalar;
313 typedef PHX::MDField<Scalar,Cell,BASIS>
Array;
324 fout <<
"Panzer Warning: No global indexer assigned to a workset container. " 325 <<
"Orientation of the basis for edge basis functions cannot be applied, " 326 <<
"if those basis functions are used, there will be problems!" << std::endl;
338 for(std::size_t i=0;i<needs.
bases.size();i++) {
343 if(!
basis.requiresOrientations())
continue;
347 = buildOrientationContainer<Scalar,Array>(
globalIndexer_,fieldName);
352 for(std::size_t i=0;i<worksets.size();i++) {
353 for(std::size_t j=0;j<worksets[i].numDetails();j++) {
356 if(worksets[i].num_cells<=0)
continue;
362 Array orientations = fc_factory.buildStaticArray<double,panzer::Cell,panzer::BASIS>(
"orientations",array0_sz,array1_sz);
367 orientationContainer->getOrientations(eBlock,
details.cell_local_ids,orientations);
373 if(layout->getBasis()->name()==
basis.name()) {
388 typedef double Scalar;
389 typedef PHX::MDField<Scalar,Cell,BASIS>
Array;
400 fout <<
"Panzer Warning: No global indexer assigned to a workset container. " 401 <<
"Orientation of the basis for edge basis functions cannot be applied, " 402 <<
"if those basis functions are used, there will be problems!";
414 for(std::size_t i=0;i<needs.
bases.size();i++) {
419 if(!
basis.requiresOrientations())
continue;
423 = buildOrientationContainer<Scalar,Array>(
globalIndexer_,fieldName);
426 for(std::map<unsigned,Workset>::iterator itr=worksets.begin();
427 itr!=worksets.end();++itr) {
430 if(itr->second.num_cells<=0)
continue;
432 int array0_sz = itr->second.num_cells;
436 Array orientations = fc_factory.
buildStaticArray<double,panzer::Cell,panzer::BASIS>(
"orientations",array0_sz,array1_sz);
438 for(std::size_t j=0;j<itr->second.numDetails();j++) {
443 orientationContainer->getOrientations(sideId.
eblk_id,
details.cell_local_ids,orientations);
449 if(layout->getBasis()->name()==
basis.name()) {
460 const std::vector<std::string> & elementBlockNames,
461 std::map<std::string,
Teuchos::RCP<std::vector<Workset> > > & volumeWksts)
463 for(std::size_t i=0;i<elementBlockNames.size();i++)
468 const std::vector<BC> & bcs,
471 for(std::size_t i=0;i<bcs.size();i++) {
473 if(wksts!=Teuchos::null)
474 sideWksts[bcs[i]] = wksts;
Teuchos::RCP< std::map< unsigned, Workset > > getSideWorksets(const BC &bc)
Access, and construction of side worksets.
std::vector< Teuchos::RCP< const PureBasis > > bases
PHX::MDField< Scalar, T0 > buildStaticArray(const std::string &str, int d0) const
const PhysicsBlock & lookupPhysicsBlock(const std::string &eBlock) const
Look up an input physics block, throws an exception if it can not be found.
Object that contains information on the physics and discretization of a block of elements with the SA...
void setGlobalIndexer(const Teuchos::RCP< const panzer::UniqueGlobalIndexerBase > &ugi)
WorksetContainer()
Default contructor, starts with no workset factory objects.
std::string elementBlockID2() const
Returns the second element block id associated with this sideset.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
BCType bcType() const
Returns the boundary condition type (Dirichlet or Neumann or Interface).
Teuchos::RCP< const WorksetFactoryBase > wkstFactory_
std::vector< Teuchos::RCP< const IntegrationRule > > int_rules
std::vector< std::string > rep_field_name
Class that provides access to worksets on each element block and side set.
PHX::MDField< ScalarT > vector
void allocateVolumeWorksets(const std::vector< std::string > &eBlocks)
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)
int dimension() const
Returns the dimension of the basis from the topology.
std::string getElementBlock() const
Get element block.
const WorksetNeeds & lookupNeeds(const std::string &eBlock) const
Look up an input physics block, throws an exception if it can not be found.
Teuchos::RCP< const panzer::UniqueGlobalIndexerBase > globalIndexer_
std::map< std::string, Teuchos::RCP< PhysicsBlock > > ebToPb_
How to construct worksets.
std::string elementBlockID() const
Returns the element block id associated with this sideset.
Teuchos::RCP< const panzer::PureBasis > basis
Interpolates basis DOF values to IP DOF values.
VolumeMap volWorksets_
Maps element blocks to input physics block objects.
void setPhysicsBlockVector(const std::vector< Teuchos::RCP< PhysicsBlock > > &physicsBlocks)
The physics block vector.
void addBasis(const std::string &type, int order, const std::string &rep_field)
void allocateSideWorksets(const std::vector< BC > &bcs)
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)
std::size_t numCells() const
Teuchos::RCP< std::vector< Workset > > getVolumeWorksets(const std::string &eBlock)
Access to volume worksets.
std::map< std::string, WorksetNeeds > ebToNeeds_
Maps element blocks to input physics block objects.
void getVolumeWorksetsFromContainer(WorksetContainer &wc, const std::vector< std::string > &elementBlockNames, std::map< std::string, Teuchos::RCP< std::vector< Workset > > > &volumeWksts)