26 std::vector<std::string> tokens;
35 if(tokens[0]!=
"blocked:")
39 bool acceptsHyphen =
false;
40 for(std::size_t i=1;i<tokens.size();i++) {
43 TEUCHOS_TEST_FOR_EXCEPTION(tokens[i]==
"-" && !acceptsHyphen,std::logic_error,
44 "Blocked assembly: Error \"Field Order\" hyphen error at "
47 if(acceptsHyphen && tokens[i]==
"-")
48 acceptsHyphen =
false;
58buildBlocking(
const std::string & fieldOrder,std::vector<std::vector<std::string> > & blocks)
63 std::vector<std::string> tokens;
68 Teuchos::RCP<std::vector<std::string> > current;
69 for(std::size_t i=1;i<tokens.size();i++) {
71 if(tokens[i]!=
"-" && tokens[i-1]!=
"-") {
73 if(current!=Teuchos::null)
74 blocks.push_back(*current);
76 current = Teuchos::rcp(
new std::vector<std::string>);
80 current->push_back(tokens[i]);
83 if(current!=Teuchos::null)
84 blocks.push_back(*current);
89 const std::vector<Teuchos::RCP<panzer::PhysicsBlock> > & physicsBlocks,
90 const Teuchos::RCP<ConnManager> & connMngr,
91 const std::string & fieldOrder)
const
95 Teuchos::RCP<Teuchos::FancyOStream> pout = Teuchos::getFancyOStream(Teuchos::rcpFromRef(std::cout));
96 pout->setShowProcRank(
true);
97 pout->setOutputToRootOnly(0);
100 Teuchos::RCP<panzer::BlockedDOFManager> dofManager
106 bool orientationsRequired =
false;
108 std::vector<Teuchos::RCP<panzer::PhysicsBlock> >::const_iterator physIter;
109 for(physIter=physicsBlocks.begin();physIter!=physicsBlocks.end();++physIter) {
110 Teuchos::RCP<const panzer::PhysicsBlock> pb = *physIter;
112 const std::vector<StrPureBasisPair> & blockFields = pb->getProvidedDOFs();
115 std::set<StrPureBasisPair,StrPureBasisComp> fieldNames;
116 fieldNames.insert(blockFields.begin(),blockFields.end());
119 std::set<StrPureBasisPair,StrPureBasisComp>::const_iterator fieldItr;
120 for (fieldItr=fieldNames.begin();fieldItr!=fieldNames.end();++fieldItr) {
122 orientationsRequired |= fieldItr->second->requiresOrientations();
124 Teuchos::RCP< Intrepid2::Basis<PHX::Device::execution_space,double,double> > intrepidBasis
125 = fieldItr->second->getIntrepid2Basis();
127 dofManager->addField(pb->elementBlockID(),fieldItr->first,fp);
132 dofManager->setOrientationsRequired(orientationsRequired);
134 std::vector<std::vector<std::string> > blocks;
136 dofManager->setFieldOrder(blocks);
138 dofManager->buildGlobalUnknowns();
virtual Teuchos::RCP< panzer::GlobalIndexer > buildGlobalIndexer(const Teuchos::RCP< const Teuchos::OpaqueWrapper< MPI_Comm > > &mpiComm, const std::vector< Teuchos::RCP< panzer::PhysicsBlock > > &physicsBlocks, const Teuchos::RCP< ConnManager > &connMngr, const std::string &fieldOrder="") const
void StringTokenizer(std::vector< std::string > &tokens, const std::string &str, const std::string delimiters, bool trim)
Tokenize a string, put tokens in a vector.