43 #ifndef __Panzer_BlockedDOFManager_hpp__ 44 #define __Panzer_BlockedDOFManager_hpp__ 53 #include "PanzerDofMgr_config.hpp" 62 #include "Teuchos_RCP.hpp" 63 #include "Teuchos_DefaultMpiComm.hpp" 65 #include <unordered_set> 69 template <
typename LocalOrdinalT,
typename GlobalOrdinalT>
70 class BlockedDOFManager :
public UniqueGlobalIndexer<LocalOrdinalT,std::pair<int,GlobalOrdinalT> > {
93 virtual Teuchos::RCP<Teuchos::Comm<int> >
getComm()
const 134 virtual bool fieldInBlock(
const std::string &
field,
const std::string & block)
const;
143 virtual const std::vector<LocalOrdinal> &
getElementBlock(
const std::string & blockId)
const 153 void getElementGIDs(LocalOrdinalT localElmtId,std::vector<GlobalOrdinal> & gids,
const std::string & blockIdHint=
"")
const;
157 virtual void getElementOrientation(LocalOrdinalT localElmtId,std::vector<double> & gidsOrientation)
const;
162 virtual const std::vector<int> &
getGIDFieldOffsets(
const std::string & blockId,
int fieldNum)
const;
178 virtual const std::pair<std::vector<int>,std::vector<int> > &
189 std::vector<GlobalOrdinal>& indices)
const;
199 std::vector<GlobalOrdinal>& indices)
const;
209 std::vector<GlobalOrdinal>& indices)
const;
237 virtual void ownedIndices(
const std::vector<GlobalOrdinal> & indices,std::vector<bool> & isOwned)
const;
283 Teuchos::RCP<ConnManager<LocalOrdinalT,GlobalOrdinalT> >
resetIndices();
297 void addField(
const std::string & str,
const Teuchos::RCP<const FieldPattern> & pattern);
299 void addField(
const std::string & blockId,
const std::string & str,
const Teuchos::RCP<const FieldPattern> & pattern);
309 void setFieldOrder(
const std::vector<std::vector<std::string> > & fieldOrder);
318 void getFieldOrder(std::vector<std::vector<std::string> > & fieldOrder)
const;
320 void getFieldOrder(std::vector<std::string>& )
const { TEUCHOS_ASSERT(
false); }
335 Teuchos::RCP<const FieldPattern>
getFieldPattern(
const std::string & blockId,
const std::string & fieldName)
const;
348 Teuchos::RCP<const ConnManager<LocalOrdinalT,GlobalOrdinalT> >
getConnManager()
const 407 bool validFieldOrder(
const std::vector<std::vector<std::string> > & fieldOrder_ut,
const std::set<std::string> & fields)
const;
422 const std::vector<Teuchos::RCP<UniqueGlobalIndexer<LocalOrdinalT,GlobalOrdinalT> > > &
445 std::map<std::pair<std::string,int>,
int>::const_iterator itr =
488 MPI_Comm mpiComm)
const;
528 Teuchos::RCP<ConnManager<LocalOrdinalT,GlobalOrdinalT> >
connMngr_;
576 {
bool operator()(
const Teuchos::Tuple<int,3> & a,
const Teuchos::Tuple<int,3> & b)
const; };
Teuchos::RCP< const ConnManager< LocalOrdinalT, GlobalOrdinalT > > getConnManager() const
std::pair< int, GlobalOrdinalT > GlobalOrdinal
LocalOrdinalT LocalOrdinal
Teuchos::RCP< const FieldPattern > getFieldPattern(const std::string &blockId, const std::string &fieldName) const
Find a field pattern stored for a particular block and field number. This will retrive the pattern ad...
std::map< std::pair< std::string, int >, int > blockGIDOffset_
(element block,field block) ==> gid offset
std::unordered_set< GlobalOrdinal, panzer::pair_hash > ownedGIDHashTable_
void enableTieBreak(bool useTieBreak)
int getFieldBlock(int fieldNum) const
virtual Teuchos::RCP< const ConnManagerBase< LocalOrdinalT > > getConnManagerBase() const
Returns the connection manager currently being used.
void setOrientationsRequired(bool ro)
std::map< int, int > fieldNumToFieldBlk_
field number ==> field block
virtual void getElementBlockIds(std::vector< std::string > &elementBlockIds) const
std::map< int, std::string >::const_iterator const_field_iterator
virtual 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...
void setConnManager(const Teuchos::RCP< ConnManager< LocalOrdinalT, GlobalOrdinalT > > &connMngr, MPI_Comm mpiComm)
Set the connection manager and MPI_Comm objects.
Teuchos::RCP< UniqueGlobalIndexer< LocalOrdinalT, GlobalOrdinalT > > buildNewIndexer(const Teuchos::RCP< ConnManager< LocalOrdinalT, GlobalOrdinalT > > &connManager, MPI_Comm mpiComm) const
void printFieldInformation(std::ostream &os) const
virtual void getOwnedIndices(std::vector< GlobalOrdinal > &indices) const
Get the set of indices owned by this processor.
virtual const std::vector< int > & getBlockFieldNumbers(const std::string &block) const
void addField(const std::string &str, const Teuchos::RCP< const FieldPattern > &pattern)
Add a field to the DOF manager.
bool getOrientationsRequired() const
int getNumFields() const
How many fields are handled by this manager.
virtual void buildGlobalUnknowns()
void addFieldsToFieldBlockManager(const std::vector< std::string > &activeFields, UniqueGlobalIndexer< LocalOrdinalT, GlobalOrdinalT > &fieldBlockManager) const
bool requireOrientations_
Teuchos::RCP< ConnManager< LocalOrdinalT, GlobalOrdinalT > > resetIndices()
Reset the indicies for this DOF manager.
virtual void getOwnedAndGhostedIndices(std::vector< GlobalOrdinal > &indices) const
Get the set of owned and ghosted indices for this processor.
std::map< std::string, std::map< int, std::vector< int > > > gidFieldOffsets_
virtual int getElementBlockGIDCount(const std::string &blockId) const
How any GIDs are associate with a particular element block.
Teuchos::RCP< Teuchos::MpiComm< int > > communicator_
bool getUseDOFManagerFEI() const
which DOF Manager is used internally?
virtual void getGhostedIndices(std::vector< GlobalOrdinal > &indices) const
Get the set of indices ghosted for this processor.
void setUseDOFManagerFEI(bool useFEI)
Use the FEI DOF manager internally, or the standard version.
virtual void getElementOrientation(LocalOrdinalT localElmtId, std::vector< double > &gidsOrientation) const
Get a vector containg the orientation of the GIDs relative to the neighbors.
std::map< std::string, std::vector< int > > blockIdToFieldNumbers_
block ID ==> field numbers
Teuchos::RCP< const FieldPattern > geomPattern_
std::map< std::string, int > fieldStrToNum_
field string ==> field number
Teuchos::RCP< const FieldPattern > getGeometricFieldPattern() const
virtual int getNumGhosted() const
Get the number of indices ghosted for this processor.
int getMaxSubFieldNumber() const
bool operator()(const Teuchos::Tuple< int, 3 > &a, const Teuchos::Tuple< int, 3 > &b) const
void getFieldOrder(std::vector< std::string > &) const
const std::string & getFieldString(int num) const
Get the string name associated with a field number.
std::vector< Teuchos::RCP< UniqueGlobalIndexer< LocalOrdinalT, GlobalOrdinalT > > > fieldBlockManagers_
virtual const std::vector< int > & getGIDFieldOffsets(const std::string &blockId, int fieldNum) const
Use the field pattern so that you can find a particular field in the GIDs array.
std::map< std::string, std::set< std::string > > blockIdToFieldStrings_
block ID ==> field strings
virtual Teuchos::RCP< Teuchos::Comm< int > > getComm() const
void registerFields(bool buildSubUGIs)
int getNumFieldBlocks() const
const std::vector< Teuchos::RCP< UniqueGlobalIndexer< LocalOrdinalT, GlobalOrdinalT > > > & getFieldDOFManagers() const
int getFieldNum(const std::string &str) const
Get the number used for access to this field.
void setFieldOrder(const std::vector< std::vector< std::string > > &fieldOrder)
virtual int getNumOwnedAndGhosted() const
Get the number of owned and ghosted indices for this processor.
std::map< int, std::string > fieldNumToStr_
field number ==> field string
std::map< std::pair< std::string, std::string >, Teuchos::RCP< const FieldPattern > > fieldStringToPattern_
(block ID x field string) ==> pattern
virtual ~BlockedDOFManager()
PHX::MDField< ScalarT, panzer::Cell, panzer::BASIS > field
A field to which we'll contribute, or in which we'll store, the result of computing this integral...
std::map< std::string, TupleToVectorPairMap > gidFieldOffsets_closure_
bool validFieldOrder(const std::vector< std::vector< std::string > > &fieldOrder_ut, const std::set< std::string > &fields) const
bool fieldsRegistered() const
virtual bool fieldInBlock(const std::string &field, const std::string &block) const
virtual int getNumOwned() const
Get the number of indices owned by this processor.
void getFieldOrder(std::vector< std::vector< std::string > > &fieldOrder) const
int getBlockGIDOffset(const std::string &elementBlock, int fieldBlock) const
virtual const std::vector< LocalOrdinal > & getElementBlock(const std::string &blockId) const
std::vector< std::vector< std::string > > fieldOrder_
Teuchos::RCP< ConnManager< LocalOrdinalT, GlobalOrdinalT > > getConnManager()
Teuchos::RCP< ConnManager< LocalOrdinalT, GlobalOrdinalT > > connMngr_
std::map< Teuchos::Tuple< int, 3 >, std::pair< std::vector< int >, std::vector< int > >, LessThan > TupleToVectorPairMap
virtual void ownedIndices(const std::vector< GlobalOrdinal > &indices, std::vector< bool > &isOwned) const
void getElementGIDs(LocalOrdinalT localElmtId, std::vector< GlobalOrdinal > &gids, const std::string &blockIdHint="") const
Get the global IDs for a particular element. This function overwrites the gids variable.