43 #ifndef __Panzer_DOFManager_hpp__ 44 #define __Panzer_DOFManager_hpp__ 49 #include "PanzerDofMgr_config.hpp" 57 #include "Teuchos_RCP.hpp" 59 #include "Tpetra_Map.hpp" 60 #include "Tpetra_MultiVector.hpp" 65 template <
typename LocalOrdinalT,
typename GlobalOrdinalT>
66 class DOFManager :
public UniqueGlobalIndexer<LocalOrdinalT, GlobalOrdinalT> {
68 typedef GlobalOrdinalT
GO;
69 typedef LocalOrdinalT
LO;
102 int addField(
const std::string & str,
const Teuchos::RCP<const FieldPattern> & pattern);
105 int addField(
const std::string & blockID,
const std::string & str,
const Teuchos::RCP<const FieldPattern> & pattern);
121 Teuchos::RCP<const FieldPattern>
getFieldPattern(
const std::string & name)
const;
136 Teuchos::RCP<const FieldPattern>
getFieldPattern(
const std::string & blockId,
const std::string & fieldName)
const;
147 const std::vector<int> &
getGIDFieldOffsets(
const std::string & blockID,
int fieldNum)
const;
150 void getElementGIDs(
LO localElementID, std::vector<GO> & gids,
const std::string & blockIdHint=
"")
const;
160 Teuchos::RCP<Teuchos::Comm<int> >
getComm()
const 167 {
connMngr_->getElementBlockIds(elementBlockIds); }
187 const std::pair<std::vector<int>,std::vector<int> > &
192 {
return connMngr_->getElementBlock(blockId); }
194 void ownedIndices(
const std::vector<GlobalOrdinalT> & indices,std::vector<bool> & isOwned)
const;
196 void setFieldOrder(
const std::vector<std::string> & fieldOrder );
198 void getFieldOrder(std::vector<std::string> & fieldOrder)
const;
200 bool validFieldOrder(
const std::vector<std::string> & proposed_fieldOrder);
225 Teuchos::RCP<ConnManager<LocalOrdinalT,GlobalOrdinalT> >
resetIndices();
276 Teuchos::RCP<const Tpetra::Map<LO,GO,panzer::TpetraNodeType> >
277 runLocalRCMReordering(
const Teuchos::RCP<
const Tpetra::Map<LocalOrdinalT,GlobalOrdinalT,panzer::TpetraNodeType> > &);
299 return connMngr_->getElementBlock(eBlock);
301 return connMngr_->getNeighborElementBlock(eBlock);
309 Teuchos::RCP<const Tpetra::Map<LO,GO,panzer::TpetraNodeType> >
315 Teuchos::RCP<Tpetra::MultiVector<GO,LO,GO,panzer::TpetraNodeType> >
323 std::pair<Teuchos::RCP<Tpetra::MultiVector<GO,LO,GO,panzer::TpetraNodeType> >,
324 Teuchos::RCP<Tpetra::MultiVector<GO,LO,GO,panzer::TpetraNodeType> > >
326 Tpetra::MultiVector<GO,LO,GO,panzer::TpetraNodeType> & overlap_mv)
const;
330 const Tpetra::Map<LO,GO,panzer::TpetraNodeType> & overlapmap,
331 const Tpetra::MultiVector<GO,LO,GO,panzer::TpetraNodeType> & overlap_mv)
const;
350 Teuchos::RCP<const panzer::FieldPattern>
ga_fp_;
351 std::vector<Teuchos::RCP<panzer::FieldAggPattern> >
fa_fps_;
void buildLocalIdsFromOwnedAndGhostedElements()
const std::vector< int > & getBlockFieldNumbers(const std::string &blockId) const
int getFieldNum(const std::string &string) const
Get the number used for access to this field.
ElementBlockAccess(bool owned, const Teuchos::RCP< const ConnManager< LO, GO > > &connMngr)
void getElementGIDs(LO localElementID, std::vector< GO > &gids, const std::string &blockIdHint="") const
get associated GIDs for a given local element
const std::string & getFieldString(int num) const
Reverse lookup of the field string from a field number.
bool buildConnectivityRun_
void fillGIDsFromOverlappedMV(const ElementBlockAccess &access, std::vector< std::vector< GO > > &elementGIDs, const Tpetra::Map< LO, GO, panzer::TpetraNodeType > &overlapmap, const Tpetra::MultiVector< GO, LO, GO, panzer::TpetraNodeType > &overlap_mv) const
Teuchos::RCP< const ConnManager< LO, GO > > connMngr_
void getElementBlockIds(std::vector< std::string > &elementBlockIds) const
void useNeighbors(bool flag)
std::map< std::string, int > blockNameToID_
void setOrientationsRequired(bool ro)
std::vector< std::vector< char > > orientation_
void setConnManager(const Teuchos::RCP< ConnManager< LO, GO > > &connMngr, MPI_Comm mpiComm)
Adds a Connection Manager that will be associated with this DOFManager.
const std::vector< int > & getGIDFieldOffsets(const std::string &blockID, int fieldNum) const
Teuchos::RCP< const Tpetra::Map< LO, GO, panzer::TpetraNodeType > > buildOverlapMapFromElements(const ElementBlockAccess &access) const
PHX::MDField< ScalarT > vector
const std::vector< LO > & getElementBlock(const std::string &eBlock) const
Teuchos::RCP< Teuchos::Comm< int > > communicator_
bool getOrientationsRequired() const
const std::vector< LocalOrdinalT > & getElementBlock(const std::string &blockId) const
Get the owned element block.
Teuchos::RCP< ConnManager< LocalOrdinalT, GlobalOrdinalT > > resetIndices()
Reset the indices for this DOF manager.
std::size_t blockIdToIndex(const std::string &blockId) const
Teuchos::RCP< const FieldPattern > getFieldPattern(const std::string &name) const
Find a field pattern stored for a particular block and field number. This will retrive the pattern ad...
Teuchos::RCP< const FieldPattern > getGeometricFieldPattern() const
void setFieldOrder(const std::vector< std::string > &fieldOrder)
std::vector< int > elementBlockGIDCount_
virtual Teuchos::RCP< const ConnManagerBase< LocalOrdinalT > > getConnManagerBase() const
Returns the connection manager currently being used.
void getOwnedAndGhostedIndices(std::vector< GlobalOrdinalT > &indices) const
Teuchos::RCP< ConnManager< LO, GO > > getConnManager() const
std::vector< GO > ghosted_
Teuchos::RCP< const Tpetra::Map< LO, GO, panzer::TpetraNodeType > > runLocalRCMReordering(const Teuchos::RCP< const Tpetra::Map< LocalOrdinalT, GlobalOrdinalT, panzer::TpetraNodeType > > &)
int addField(const std::string &str, const Teuchos::RCP< const FieldPattern > &pattern)
Add a field to the DOF manager.
std::vector< std::vector< GO > > elementGIDs_
void buildUnknownsOrientation()
void buildGlobalUnknowns()
builds the global unknowns array
PHX::MDField< const ScalarT, Cell, IP > field
Teuchos::RCP< const panzer::FieldPattern > ga_fp_
bool requireOrientations_
bool validFieldOrder(const std::vector< std::string > &proposed_fieldOrder)
std::vector< int > fieldAIDOrder_
std::vector< Teuchos::RCP< const FieldPattern > > fieldPatterns_
Teuchos::RCP< Teuchos::Comm< int > > getComm() const
void getFieldOrder(std::vector< std::string > &fieldOrder) const
void getOwnedIndices(std::vector< GlobalOrdinalT > &indices) const
std::map< std::string, int > fieldNameToAID_
void enableTieBreak(bool enable)
Teuchos::RCP< ConnManager< LO, GO > > connMngr_
std::pair< Teuchos::RCP< Tpetra::MultiVector< GO, LO, GO, panzer::TpetraNodeType > >, Teuchos::RCP< Tpetra::MultiVector< GO, LO, GO, panzer::TpetraNodeType > > > buildGlobalUnknowns_GUN(const Tpetra::MultiVector< GO, LO, GO, panzer::TpetraNodeType > &tagged_overlap_mv, Tpetra::MultiVector< GO, LO, GO, panzer::TpetraNodeType > &overlap_mv) const
Teuchos::RCP< Tpetra::MultiVector< GO, LO, GO, panzer::TpetraNodeType > > buildTaggedMultiVector(const ElementBlockAccess &access)
void printFieldInformation(std::ostream &os) const
virtual int getElementBlockGIDCount(const std::string &blockId) const
How any GIDs are associate with a particular element block.
std::vector< Teuchos::RCP< panzer::FieldAggPattern > > fa_fps_
void getElementOrientation(LocalOrdinalT localElmtId, std::vector< double > &gidsOrientation) const
Get a vector containg the orientation of the GIDs relative to the neighbors.
int getNumFields() const
gets the number of fields
bool fieldInBlock(const std::string &field, const std::string &block) const
const std::pair< std::vector< int >, std::vector< int > > & getGIDFieldOffsets_closure(const std::string &blockId, int fieldNum, int subcellDim, int subcellId) const
Use the field pattern so that you can find a particular field in the GIDs array. This version lets yo...
std::size_t getNumberElementGIDArrays() const
std::vector< std::string > fieldStringOrder_
std::vector< std::vector< int > > blockToAssociatedFP_
std::vector< std::string > blockOrder_
void ownedIndices(const std::vector< GlobalOrdinalT > &indices, std::vector< bool > &isOwned) const
virtual int getElementBlockGIDCount(const std::size_t &blockIndex) const
How any GIDs are associate with a particular element block.