43 #ifndef __Panzer_DOFManager_hpp__ 44 #define __Panzer_DOFManager_hpp__ 49 #include "PanzerDofMgr_config.hpp" 57 #include "Phalanx_KokkosDeviceTypes.hpp" 59 #include "Teuchos_RCP.hpp" 61 #include "Tpetra_Map.hpp" 62 #include "Tpetra_MultiVector.hpp" 77 DOFManager(
const Teuchos::RCP<ConnManager> & connMngr, MPI_Comm mpiComm);
80 void setConnManager(
const Teuchos::RCP<ConnManager> & connMngr, MPI_Comm mpiComm);
98 int addField(
const std::string & str,
const Teuchos::RCP<const FieldPattern> & pattern,
115 int addField(
const std::string & blockID,
const std::string & str,
116 const Teuchos::RCP<const FieldPattern> & pattern,
132 Teuchos::RCP<const FieldPattern>
getFieldPattern(
const std::string & name)
const;
147 Teuchos::RCP<const FieldPattern>
getFieldPattern(
const std::string & blockId,
const std::string & fieldName)
const;
155 void getOwnedIndices(std::vector<panzer::GlobalOrdinal>& indices)
const;
174 void getElementGIDsAsInt(panzer::LocalOrdinal localElementID, std::vector<int> & gids,
const std::string & blockIdHint=
"")
const;
209 const std::vector<int> &
getGIDFieldOffsets(
const std::string & blockID,
int fieldNum)
const;
214 const Kokkos::View<const int*,PHX::Device>
getGIDFieldOffsetsKokkos(
const std::string & blockID,
int fieldNum)
const;
217 void getElementGIDs(panzer::LocalOrdinal localElementID, std::vector<panzer::GlobalOrdinal> & gids,
const std::string & blockIdHint=
"")
const;
227 Teuchos::RCP<Teuchos::Comm<int> >
getComm()
const 234 {
connMngr_->getElementBlockIds(elementBlockIds); }
254 const std::pair<std::vector<int>,std::vector<int> > &
258 const std::vector<panzer::LocalOrdinal> &
getElementBlock(
const std::string & blockId)
const 259 {
return connMngr_->getElementBlock(blockId); }
261 void ownedIndices(
const std::vector<panzer::GlobalOrdinal> & indices,std::vector<bool> & isOwned)
const;
263 void setFieldOrder(
const std::vector<std::string> & fieldOrder );
265 void getFieldOrder(std::vector<std::string> & fieldOrder)
const;
267 bool validFieldOrder(
const std::vector<std::string> & proposed_fieldOrder);
280 void getElementOrientation(panzer::LocalOrdinal localElmtId,std::vector<double> & gidsOrientation)
const;
343 Teuchos::RCP<const Tpetra::Map<panzer::LocalOrdinal,panzer::GlobalOrdinal,panzer::TpetraNodeType> >
344 runLocalRCMReordering(
const Teuchos::RCP<
const Tpetra::Map<panzer::LocalOrdinal,panzer::GlobalOrdinal,panzer::TpetraNodeType> > &);
363 const std::vector<panzer::LocalOrdinal> &
getElementBlock(
const std::string & eBlock)
const 366 return connMngr_->getElementBlock(eBlock);
368 return connMngr_->getNeighborElementBlock(eBlock);
376 Teuchos::RCP<const Tpetra::Map<panzer::LocalOrdinal,panzer::GlobalOrdinal,panzer::TpetraNodeType> >
382 Teuchos::RCP<Tpetra::MultiVector<panzer::GlobalOrdinal,panzer::LocalOrdinal,panzer::GlobalOrdinal,panzer::TpetraNodeType> >
390 std::pair<Teuchos::RCP<Tpetra::MultiVector<panzer::GlobalOrdinal,panzer::LocalOrdinal,panzer::GlobalOrdinal,panzer::TpetraNodeType> >,
391 Teuchos::RCP<Tpetra::MultiVector<panzer::GlobalOrdinal,panzer::LocalOrdinal,panzer::GlobalOrdinal,panzer::TpetraNodeType> > >
392 buildGlobalUnknowns_GUN(
const Tpetra::MultiVector<panzer::GlobalOrdinal,panzer::LocalOrdinal,panzer::GlobalOrdinal,panzer::TpetraNodeType> & tagged_overlap_mv,
393 Tpetra::MultiVector<panzer::GlobalOrdinal,panzer::LocalOrdinal,panzer::GlobalOrdinal,panzer::TpetraNodeType> & overlap_mv)
const;
396 std::vector<std::vector< panzer::GlobalOrdinal > > & elementGIDs,
397 const Tpetra::Map<panzer::LocalOrdinal,panzer::GlobalOrdinal,panzer::TpetraNodeType> & overlapmap,
398 const Tpetra::MultiVector<panzer::GlobalOrdinal,panzer::LocalOrdinal,panzer::GlobalOrdinal,panzer::TpetraNodeType> & overlap_mv)
const;
418 Teuchos::RCP<const panzer::FieldPattern>
ga_fp_;
419 std::vector<Teuchos::RCP<panzer::FieldAggPattern> >
fa_fps_;
421 std::vector<panzer::GlobalOrdinal>
owned_;
std::vector< std::vector< int > > blockToAssociatedFP_
Teuchos::RCP< const FieldPattern > getGeometricFieldPattern() const
virtual int getElementBlockGIDCount(const std::size_t &blockIndex) const
How any GIDs are associate with a particular element block.
void setFieldOrder(const std::vector< std::string > &fieldOrder)
std::vector< Teuchos::RCP< panzer::FieldAggPattern > > fa_fps_
void ownedIndices(const std::vector< panzer::GlobalOrdinal > &indices, std::vector< bool > &isOwned) const
Teuchos::RCP< const ConnManager > getConnManager() const
Returns the connection manager currently being used.
void getFieldOrder(std::vector< std::string > &fieldOrder) const
void buildUnknownsOrientation()
bool getOrientationsRequired() const
std::vector< std::vector< panzer::GlobalOrdinal > > elementGIDs_
const std::vector< panzer::LocalOrdinal > & getElementBlock(const std::string &blockId) const
Get the owned element block.
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 getGhostedIndicesAsInt(std::vector< int > &indices) const
Get the set of indices ghosted for this processor.
std::size_t getNumberElementGIDArrays() const
void enableTieBreak(bool enable)
Teuchos::RCP< Tpetra::MultiVector< panzer::GlobalOrdinal, panzer::LocalOrdinal, panzer::GlobalOrdinal, panzer::TpetraNodeType > > buildTaggedMultiVector(const ElementBlockAccess &access)
const std::vector< panzer::LocalOrdinal > & getElementBlock(const std::string &eBlock) const
void getOwnedAndGhostedIndicesAsInt(std::vector< int > &indices) const
Get the set of owned and ghosted indices for this processor.
void useNeighbors(bool flag)
FieldType
The type of discretization to use for a field pattern.
ElementBlockAccess(bool owned, const Teuchos::RCP< const ConnManager > &connMngr)
Teuchos::RCP< ConnManager > resetIndices()
Reset the indices for this DOF manager.
void buildGlobalUnknowns()
builds the global unknowns array
Teuchos::RCP< const panzer::FieldPattern > ga_fp_
void getElementBlockIds(std::vector< std::string > &elementBlockIds) const
std::size_t blockIdToIndex(const std::string &blockId) const
void setOrientationsRequired(bool ro)
std::vector< int > fieldAIDOrder_
void setConnManager(const Teuchos::RCP< ConnManager > &connMngr, MPI_Comm mpiComm)
Adds a Connection Manager that will be associated with this DOFManager.
std::map< std::string, int > fieldNameToAID_
void getElementGIDs(panzer::LocalOrdinal localElementID, std::vector< panzer::GlobalOrdinal > &gids, const std::string &blockIdHint="") const
get associated GIDs for a given local element
void getOwnedAndGhostedIndices(std::vector< panzer::GlobalOrdinal > &indices) const
Get the set of owned and ghosted indices for this processor.
void getOwnedIndicesAsInt(std::vector< int > &indices) const
Get the set of indices owned by this processor.
std::vector< int > elementBlockGIDCount_
bool buildConnectivityRun_
Teuchos::RCP< Teuchos::Comm< int > > communicator_
std::vector< Teuchos::RCP< const FieldPattern > > fieldPatterns_
void getElementOrientation(panzer::LocalOrdinal localElmtId, std::vector< double > &gidsOrientation) const
Get a vector containg the orientation of the GIDs relative to the neighbors.
Teuchos::RCP< const Tpetra::Map< panzer::LocalOrdinal, panzer::GlobalOrdinal, panzer::TpetraNodeType > > runLocalRCMReordering(const Teuchos::RCP< const Tpetra::Map< panzer::LocalOrdinal, panzer::GlobalOrdinal, panzer::TpetraNodeType > > &)
void getGhostedIndices(std::vector< panzer::GlobalOrdinal > &indices) const
Get the set of indices ghosted for this processor.
Teuchos::RCP< const Tpetra::Map< panzer::LocalOrdinal, panzer::GlobalOrdinal, panzer::TpetraNodeType > > buildOverlapMapFromElements(const ElementBlockAccess &access) const
std::vector< panzer::GlobalOrdinal > owned_
std::vector< std::string > blockOrder_
std::vector< panzer::GlobalOrdinal > ghosted_
Teuchos::RCP< ConnManager > connMngr_
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...
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...
void buildLocalIdsFromOwnedAndGhostedElements()
virtual int getElementBlockGIDCount(const std::string &blockId) const
How any GIDs are associate with a particular element block.
Teuchos::RCP< Teuchos::Comm< int > > getComm() const
int getFieldNum(const std::string &string) const
Get the number used for access to this field.
std::vector< std::string > fieldStringOrder_
std::pair< Teuchos::RCP< Tpetra::MultiVector< panzer::GlobalOrdinal, panzer::LocalOrdinal, panzer::GlobalOrdinal, panzer::TpetraNodeType > >, Teuchos::RCP< Tpetra::MultiVector< panzer::GlobalOrdinal, panzer::LocalOrdinal, panzer::GlobalOrdinal, panzer::TpetraNodeType > > > buildGlobalUnknowns_GUN(const Tpetra::MultiVector< panzer::GlobalOrdinal, panzer::LocalOrdinal, panzer::GlobalOrdinal, panzer::TpetraNodeType > &tagged_overlap_mv, Tpetra::MultiVector< panzer::GlobalOrdinal, panzer::LocalOrdinal, panzer::GlobalOrdinal, panzer::TpetraNodeType > &overlap_mv) const
Teuchos::RCP< const ConnManager > connMngr_
void getOwnedIndices(std::vector< panzer::GlobalOrdinal > &indices) const
Get the set of indices owned by this processor.
int getNumGhosted() const
Get the number of indices ghosted for this processor.
void printFieldInformation(std::ostream &os) const
const std::vector< int > & getGIDFieldOffsets(const std::string &blockID, int fieldNum) const
bool validFieldOrder(const std::vector< std::string > &proposed_fieldOrder)
std::vector< std::vector< signed char > > orientation_
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.
int getNumOwnedAndGhosted() const
Get the number of owned and ghosted indices for this processor.
bool requireOrientations_
int getNumFields() const
gets the number of fields
void getElementGIDsAsInt(panzer::LocalOrdinal localElementID, std::vector< int > &gids, const std::string &blockIdHint="") const
Get the global IDs for a particular element. This function overwrites the gids variable.
const std::string & getFieldString(int num) const
Reverse lookup of the field string from a field number.
int getNumOwned() const
Get the number of indices owned by this processor.
const std::vector< int > & getBlockFieldNumbers(const std::string &blockId) const
const Kokkos::View< const int *, PHX::Device > getGIDFieldOffsetsKokkos(const std::string &blockID, int fieldNum) const
bool fieldInBlock(const std::string &field, const std::string &block) const
void fillGIDsFromOverlappedMV(const ElementBlockAccess &access, std::vector< std::vector< panzer::GlobalOrdinal > > &elementGIDs, const Tpetra::Map< panzer::LocalOrdinal, panzer::GlobalOrdinal, panzer::TpetraNodeType > &overlapmap, const Tpetra::MultiVector< panzer::GlobalOrdinal, panzer::LocalOrdinal, panzer::GlobalOrdinal, panzer::TpetraNodeType > &overlap_mv) const
std::vector< FieldType > fieldTypes_
std::map< std::string, int > blockNameToID_