43 #ifndef PANZER_BlockedDOF_MANAGER_FACTORY_IMPL_HPP
44 #define PANZER_BlockedDOF_MANAGER_FACTORY_IMPL_HPP
54 template <
typename LO,
typename GO>
58 std::vector<std::string> tokens;
67 if(tokens[0]!=
"blocked:")
71 bool acceptsHyphen =
false;
72 for(std::size_t i=1;i<tokens.size();i++) {
76 "Blocked assembly: Error \"Field Order\" hyphen error at "
79 if(acceptsHyphen && tokens[i]==
"-")
80 acceptsHyphen =
false;
89 template <
typename LO,
typename GO>
91 buildBlocking(
const std::string & fieldOrder,std::vector<std::vector<std::string> > & blocks)
96 std::vector<std::string> tokens;
102 for(std::size_t i=1;i<tokens.size();i++) {
104 if(tokens[i]!=
"-" && tokens[i-1]!=
"-") {
106 if(current!=Teuchos::null)
107 blocks.push_back(*current);
113 current->push_back(tokens[i]);
116 if(current!=Teuchos::null)
117 blocks.push_back(*current);
120 template <
typename LO,
typename GO>
125 const std::string & fieldOrder)
const
136 dofManager->enableTieBreak(useTieBreak_);
137 dofManager->setUseDOFManagerFEI(useDOFManagerFEI_);
140 bool orientationsRequired =
false;
142 std::vector<Teuchos::RCP<panzer::PhysicsBlock> >::const_iterator physIter;
143 for(physIter=physicsBlocks.begin();physIter!=physicsBlocks.end();++physIter) {
146 const std::vector<StrPureBasisPair> & blockFields = pb->
getProvidedDOFs();
149 std::set<StrPureBasisPair,StrPureBasisComp> fieldNames;
150 fieldNames.insert(blockFields.begin(),blockFields.end());
153 std::set<StrPureBasisPair,StrPureBasisComp>::const_iterator fieldItr;
154 for (fieldItr=fieldNames.begin();fieldItr!=fieldNames.end();++fieldItr) {
156 orientationsRequired |= fieldItr->second->requiresOrientations();
159 = fieldItr->second->getIntrepid2Basis();
166 dofManager->setOrientationsRequired(orientationsRequired);
168 std::vector<std::vector<std::string> > blocks;
169 buildBlocking(fieldOrder,blocks);
170 dofManager->setFieldOrder(blocks);
172 dofManager->buildGlobalUnknowns();
basic_FancyOStream & setShowProcRank(const bool showProcRank)
static void buildBlocking(const std::string &fieldorder, std::vector< std::vector< std::string > > &blocks)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
std::string elementBlockID() const
basic_FancyOStream & setOutputToRootOnly(const int rootRank)
virtual Teuchos::RCP< panzer::UniqueGlobalIndexer< LO, std::pair< int, GO > > > buildUniqueGlobalIndexer(const Teuchos::RCP< const Teuchos::OpaqueWrapper< MPI_Comm > > &mpiComm, const std::vector< Teuchos::RCP< panzer::PhysicsBlock > > &physicsBlocks, const Teuchos::RCP< ConnManager< LO, GO > > &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.
#define TEUCHOS_ASSERT(assertion_test)
static bool requiresBlocking(const std::string &fieldorder)
const std::vector< StrPureBasisPair > & getProvidedDOFs() const