43 #ifndef __Panzer_BlockedDOFManager_hpp__
44 #define __Panzer_BlockedDOFManager_hpp__
53 #include "PanzerDofMgr_config.hpp"
65 #include <unordered_set>
69 template <
typename LocalOrdinalT,
typename GlobalOrdinalT>
70 class BlockedDOFManager :
public UniqueGlobalIndexer<LocalOrdinalT,std::pair<int,GlobalOrdinalT> > {
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;
309 void setFieldOrder(
const std::vector<std::vector<std::string> > & fieldOrder);
318 void getFieldOrder(std::vector<std::vector<std::string> > & fieldOrder)
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;
int getFieldNum(const std::string &str) const
Get the number used for access to this field.
bool operator()(const Teuchos::Tuple< int, 3 > &a, const Teuchos::Tuple< int, 3 > &b) const
virtual bool fieldInBlock(const std::string &field, const std::string &block) const
bool getOrientationsRequired() const
std::pair< int, GlobalOrdinalT > GlobalOrdinal
Teuchos::RCP< const ConnManager< LocalOrdinalT, GlobalOrdinalT > > getConnManager() const
LocalOrdinalT LocalOrdinal
std::map< std::pair< std::string, int >, int > blockGIDOffset_
(element block,field block) ==> gid offset
std::unordered_set< GlobalOrdinal, panzer::pair_hash > ownedGIDHashTable_
virtual int getNumGhosted() const
Get the number of indices ghosted for this processor.
int getMaxSubFieldNumber() const
void enableTieBreak(bool useTieBreak)
const std::string & getFieldString(int num) const
Get the string name associated with a field number.
void setOrientationsRequired(bool ro)
std::map< int, int > fieldNumToFieldBlk_
field number ==> field block
Teuchos::RCP< const FieldPattern > getGeometricFieldPattern() const
bool validFieldOrder(const std::vector< std::vector< std::string > > &fieldOrder_ut, const std::set< std::string > &fields) const
std::map< int, std::string >::const_iterator const_field_iterator
void getFieldOrder(std::vector< std::string > &) const
void setConnManager(const Teuchos::RCP< ConnManager< LocalOrdinalT, GlobalOrdinalT > > &connMngr, MPI_Comm mpiComm)
Set the connection manager and MPI_Comm objects.
virtual const std::vector< LocalOrdinal > & getElementBlock(const std::string &blockId) const
virtual const std::vector< int > & getBlockFieldNumbers(const std::string &block) const
bool getUseDOFManagerFEI() const
which DOF Manager is used internally?
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.
void addField(const std::string &str, const Teuchos::RCP< const FieldPattern > &pattern)
Add a field to the DOF manager.
virtual int getNumOwned() const
Get the number of indices owned by this processor.
virtual void buildGlobalUnknowns()
bool requireOrientations_
Teuchos::RCP< ConnManager< LocalOrdinalT, GlobalOrdinalT > > resetIndices()
Reset the indicies for this DOF manager.
virtual void getGhostedIndices(std::vector< GlobalOrdinal > &indices) const
Get the set of indices ghosted for this processor.
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::map< int, std::vector< int > > > gidFieldOffsets_
Teuchos::RCP< Teuchos::MpiComm< int > > communicator_
int getNumFields() const
How many fields are handled by this manager.
virtual Teuchos::RCP< const ConnManagerBase< LocalOrdinalT > > getConnManagerBase() const
Returns the connection manager currently being used.
virtual int getElementBlockGIDCount(const std::string &blockId) const
How any GIDs are associate with a particular element block.
void setUseDOFManagerFEI(bool useFEI)
Use the FEI DOF manager internally, or the standard version.
virtual void getOwnedAndGhostedIndices(std::vector< GlobalOrdinal > &indices) const
Get the set of owned and ghosted indices for this processor.
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
void printFieldInformation(std::ostream &os) const
virtual void getOwnedIndices(std::vector< GlobalOrdinal > &indices) const
Get the set of indices owned by this processor.
std::vector< Teuchos::RCP< UniqueGlobalIndexer< LocalOrdinalT, GlobalOrdinalT > > > fieldBlockManagers_
std::map< std::string, std::set< std::string > > blockIdToFieldStrings_
block ID ==> field strings
void registerFields(bool buildSubUGIs)
Teuchos::RCP< UniqueGlobalIndexer< LocalOrdinalT, GlobalOrdinalT > > buildNewIndexer(const Teuchos::RCP< ConnManager< LocalOrdinalT, GlobalOrdinalT > > &connManager, MPI_Comm mpiComm) const
virtual void getElementBlockIds(std::vector< std::string > &elementBlockIds) const
const std::vector< std::pair< int, LocalOrdinal > > &pid_and_lid const
const std::vector< Teuchos::RCP< UniqueGlobalIndexer< LocalOrdinalT, GlobalOrdinalT > > > & getFieldDOFManagers() const
virtual int getNumOwnedAndGhosted() const
Get the number of owned and ghosted indices for this processor.
virtual void ownedIndices(const std::vector< GlobalOrdinal > &indices, std::vector< bool > &isOwned) const
int getFieldBlock(int fieldNum) const
void setFieldOrder(const std::vector< std::vector< std::string > > &fieldOrder)
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...
virtual Teuchos::RCP< Teuchos::Comm< int > > getComm() const
bool fieldsRegistered() const
std::map< std::string, TupleToVectorPairMap > gidFieldOffsets_closure_
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.
#define TEUCHOS_ASSERT(assertion_test)
int getBlockGIDOffset(const std::string &elementBlock, int fieldBlock) const
std::vector< std::vector< std::string > > fieldOrder_
Teuchos::RCP< ConnManager< LocalOrdinalT, GlobalOrdinalT > > getConnManager()
Teuchos::RCP< ConnManager< LocalOrdinalT, GlobalOrdinalT > > connMngr_
void getFieldOrder(std::vector< std::vector< std::string > > &fieldOrder) const
std::map< Teuchos::Tuple< int, 3 >, std::pair< std::vector< int >, std::vector< int > >, LessThan > TupleToVectorPairMap
int getNumFieldBlocks() const
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...
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 addFieldsToFieldBlockManager(const std::vector< std::string > &activeFields, UniqueGlobalIndexer< LocalOrdinalT, GlobalOrdinalT > &fieldBlockManager) const