43 #ifndef __Panzer_DOFManager_hpp__
44 #define __Panzer_DOFManager_hpp__
49 #include "PanzerDofMgr_config.hpp"
57 #include "Phalanx_KokkosDeviceTypes.hpp"
61 #include "Tpetra_Map.hpp"
62 #include "Tpetra_MultiVector.hpp"
67 template <
typename LocalOrdinalT,
typename GlobalOrdinalT>
68 class DOFManager :
public UniqueGlobalIndexer<LocalOrdinalT, GlobalOrdinalT> {
70 typedef GlobalOrdinalT
GO;
71 typedef LocalOrdinalT
LO;
122 int addField(
const std::string & blockID,
const std::string & str,
164 std::vector<GlobalOrdinalT>& indices)
const;
174 std::vector<GlobalOrdinalT>& indices)
const;
184 std::vector<GlobalOrdinalT>& indices)
const;
216 const std::vector<int> &
getGIDFieldOffsets(
const std::string & blockID,
int fieldNum)
const;
221 const Kokkos::View<const int*,PHX::Device>
getGIDFieldOffsetsKokkos(
const std::string & blockID,
int fieldNum)
const;
224 void getElementGIDs(
LO localElementID, std::vector<GO> & gids,
const std::string & blockIdHint=
"")
const;
241 {
connMngr_->getElementBlockIds(elementBlockIds); }
261 const std::pair<std::vector<int>,std::vector<int> > &
266 {
return connMngr_->getElementBlock(blockId); }
268 void ownedIndices(
const std::vector<GlobalOrdinalT> & indices,std::vector<bool> & isOwned)
const;
270 void setFieldOrder(
const std::vector<std::string> & fieldOrder );
272 void getFieldOrder(std::vector<std::string> & fieldOrder)
const;
274 bool validFieldOrder(
const std::vector<std::string> & proposed_fieldOrder);
373 return connMngr_->getElementBlock(eBlock);
375 return connMngr_->getNeighborElementBlock(eBlock);
397 std::pair<Teuchos::RCP<Tpetra::MultiVector<GO,LO,GO,panzer::TpetraNodeType> >,
400 Tpetra::MultiVector<GO,LO,GO,panzer::TpetraNodeType> & overlap_mv)
const;
403 std::vector<std::vector< GO > > & elementGIDs,
404 const Tpetra::Map<LO,GO,panzer::TpetraNodeType> & overlapmap,
405 const Tpetra::MultiVector<GO,LO,GO,panzer::TpetraNodeType> & overlap_mv)
const;
426 std::vector<Teuchos::RCP<panzer::FieldAggPattern> >
fa_fps_;
int getNumOwned() const
Get the number of indices owned by this processor.
void buildLocalIdsFromOwnedAndGhostedElements()
std::vector< GO > ghosted_
std::vector< std::string > fieldStringOrder_
virtual int getElementBlockGIDCount(const std::string &blockId) const
How any GIDs are associate with a particular element block.
ElementBlockAccess(bool owned, const Teuchos::RCP< const ConnManager< LO, GO > > &connMngr)
void getFieldOrder(std::vector< std::string > &fieldOrder) const
Teuchos::RCP< const panzer::FieldPattern > ga_fp_
const std::vector< int > & getBlockFieldNumbers(const std::string &blockId) const
virtual int getElementBlockGIDCount(const std::size_t &blockIndex) const
How any GIDs are associate with a particular element block.
const std::vector< int > & getGIDFieldOffsets(const std::string &blockID, int fieldNum) const
Teuchos::RCP< const FieldPattern > getGeometricFieldPattern() const
std::vector< Teuchos::RCP< panzer::FieldAggPattern > > fa_fps_
void setConnManager(const Teuchos::RCP< ConnManager< LO, GO > > &connMngr, MPI_Comm mpiComm)
Adds a Connection Manager that will be associated with this DOFManager.
void printFieldInformation(std::ostream &os) const
Teuchos::RCP< ConnManager< LO, GO > > connMngr_
bool requireOrientations_
const Kokkos::View< const int *, PHX::Device > getGIDFieldOffsetsKokkos(const std::string &blockID, int fieldNum) const
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, int > blockNameToID_
const std::vector< LocalOrdinalT > & getElementBlock(const std::string &blockId) const
Get the owned element block.
FieldType
The type of discretization to use for a field pattern.
std::vector< FieldType > fieldTypes_
virtual Teuchos::RCP< const ConnManagerBase< LocalOrdinalT > > getConnManagerBase() const
Returns the connection manager currently being used.
std::size_t getNumberElementGIDArrays() const
int getNumGhosted() const
Get the number of indices ghosted for this processor.
void ownedIndices(const std::vector< GlobalOrdinalT > &indices, std::vector< bool > &isOwned) const
Teuchos::RCP< ConnManager< LocalOrdinalT, GlobalOrdinalT > > resetIndices()
Reset the indices for this DOF manager.
int getNumOwnedAndGhosted() const
Get the number of owned and ghosted indices for this processor.
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...
void getElementGIDs(LO localElementID, std::vector< GO > &gids, const std::string &blockIdHint="") const
get associated GIDs for a given local element
int addField(const std::string &str, const Teuchos::RCP< const FieldPattern > &pattern, const panzer::FieldType &type=panzer::FieldType::CG)
Add a field to the DOF manager.
void getGhostedIndices(std::vector< GlobalOrdinalT > &indices) const
Get the set of indices ghosted for this processor.
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
void setFieldOrder(const std::vector< std::string > &fieldOrder)
bool getOrientationsRequired() const
std::vector< std::vector< int > > blockToAssociatedFP_
Teuchos::RCP< const ConnManager< LO, GO > > connMngr_
void useNeighbors(bool flag)
void buildUnknownsOrientation()
void buildGlobalUnknowns()
builds the global unknowns array
bool validFieldOrder(const std::vector< std::string > &proposed_fieldOrder)
std::vector< int > fieldAIDOrder_
std::map< std::string, int > fieldNameToAID_
Teuchos::RCP< const Tpetra::Map< LO, GO, panzer::TpetraNodeType > > buildOverlapMapFromElements(const ElementBlockAccess &access) const
std::vector< std::vector< GO > > elementGIDs_
void getOwnedAndGhostedIndices(std::vector< GlobalOrdinalT > &indices) const
Get the set of owned and ghosted indices for this processor.
Teuchos::RCP< Teuchos::Comm< int > > communicator_
void setOrientationsRequired(bool ro)
std::vector< int > elementBlockGIDCount_
const std::string & getFieldString(int num) const
Reverse lookup of the field string from a field number.
std::vector< Teuchos::RCP< const FieldPattern > > fieldPatterns_
Teuchos::RCP< Tpetra::MultiVector< GO, LO, GO, panzer::TpetraNodeType > > buildTaggedMultiVector(const ElementBlockAccess &access)
Teuchos::RCP< const Tpetra::Map< LO, GO, panzer::TpetraNodeType > > runLocalRCMReordering(const Teuchos::RCP< const Tpetra::Map< LocalOrdinalT, GlobalOrdinalT, panzer::TpetraNodeType > > &)
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...
bool fieldInBlock(const std::string &field, const std::string &block) const
void getElementBlockIds(std::vector< std::string > &elementBlockIds) const
void getOwnedIndices(std::vector< GlobalOrdinalT > &indices) const
Get the set of indices owned by this processor.
Teuchos::RCP< ConnManager< LO, GO > > getConnManager() const
int getNumFields() const
gets the number of fields
std::size_t blockIdToIndex(const std::string &blockId) 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...
int getFieldNum(const std::string &string) const
Get the number used for access to this field.
std::vector< std::vector< signed char > > orientation_
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
std::vector< std::string > blockOrder_
const std::vector< LO > & getElementBlock(const std::string &eBlock) const
Teuchos::RCP< Teuchos::Comm< int > > getComm() const
void enableTieBreak(bool enable)