11#ifndef __Panzer_STKConnManager_hpp__
12#define __Panzer_STKConnManager_hpp__
17#include "Teuchos_RCP.hpp"
20#include "Kokkos_DynRankView.hpp"
34 typedef typename Kokkos::DynRankView<GlobalOrdinal,PHX::Device>::host_mirror_type
GlobalOrdinalView;
35 typedef typename Kokkos::DynRankView<LocalOrdinal, PHX::Device>::host_mirror_type
LocalOrdinalView;
37 STKConnManager(
const Teuchos::RCP<const STK_Interface> & stkMeshDB);
108 {
return stkMeshDB_->getElementBlockNames(elementBlockIds); }
113 std::vector<std::string> elementBlockIds;
115 elementBlockTopologies.reserve(elementBlockIds.size());
117 for (
unsigned i=0; i<elementBlockIds.size(); ++i) {
118 elementBlockTopologies.push_back(*(
stkMeshDB_->getCellTopology(elementBlockIds[i])));
128 virtual const std::vector<LocalOrdinal> &
getElementBlock(
const std::string & blockId)
const
152 std::vector<std::size_t> & localCellIds,
153 Kokkos::DynRankView<double,PHX::Device> & points)
const;
243 Teuchos::RCP<std::vector<stk::mesh::Entity> >
elements_;
260 using CachedEntry = std::pair<Teuchos::RCP<const panzer::FieldPattern>,Teuchos::RCP<panzer_stk::STKConnManager>>;
262 Teuchos::RCP<const panzer::FieldPattern>
fp_;
265 {
return fp_->equals(*entry_to_compare.first); }
Pure virtual base class for supplying mesh connectivity information to the DOF Manager.
panzer::GlobalOrdinal GlobalOrdinal
std::vector< std::string > checkAssociateElementsInSidesets(const Teuchos::Comm< int > &comm) const
void applyPeriodicBCs(const panzer::FieldPattern &fp, GlobalOrdinal nodeOffset, GlobalOrdinal edgeOffset, GlobalOrdinal faceOffset, GlobalOrdinal cellOffset)
Teuchos::RCP< std::vector< stk::mesh::Entity > > elements_
void applyInterfaceConditions()
static int cached_reuse_count_
const LocalOrdinalView getElementLidToConnView()
virtual Teuchos::RCP< panzer::ConnManager > noConnectivityClone() const
Kokkos::DynRankView< GlobalOrdinal, PHX::Device >::host_mirror_type GlobalOrdinalView
virtual const panzer::GlobalOrdinal * getConnectivity(LocalOrdinal localElmtId) const
std::map< std::string, Teuchos::RCP< std::vector< LocalOrdinal > > > neighborElementBlocks_
panzer::ConnManager::LocalOrdinal LocalOrdinal
virtual void getDofCoords(const std::string &blockId, const panzer::Intrepid2FieldPattern &coordProvider, std::vector< std::size_t > &localCellIds, Kokkos::DynRankView< double, PHX::Device > &points) const
static int getCachedReuseCount()
This is purely for unit testing. Returns the number of times that buildConnectivity() was called,...
std::vector< std::vector< LocalOrdinal > > elmtToAssociatedElmts_
std::vector< LocalOrdinal > connSize_
static void cacheConnectivity()
Enables the caching of connectivity data. Be sure to call clearCachedConnectivityData() before exitin...
void buildOffsetsAndIdCounts(const panzer::FieldPattern &fp, LocalOrdinal &nodeIdCnt, LocalOrdinal &edgeIdCnt, LocalOrdinal &faceIdCnt, LocalOrdinal &cellIdCnt, GlobalOrdinal &nodeOffset, GlobalOrdinal &edgeOffset, GlobalOrdinal &faceOffset, GlobalOrdinal &cellOffset) const
std::size_t ownedElementCount_
panzer::ConnManager::GlobalOrdinal GlobalOrdinal
virtual panzer::GlobalOrdinal * getConnectivity(LocalOrdinal localElmtId)
virtual void buildConnectivity(const panzer::FieldPattern &fp)
void buildLocalElementMapping()
std::vector< bool > sidesetYieldedAssociations_
const LocalOrdinalView getConnectivitySizeView()
virtual ~STKConnManager()
static std::vector< CachedEntry > cached_conn_managers_
virtual bool hasAssociatedNeighbors() const
static bool cache_connectivity_
LocalOrdinal addSubcellConnectivities(stk::mesh::Entity element, unsigned subcellRank, LocalOrdinal idCnt, GlobalOrdinal offset, const unsigned maxIds=0)
Loops over relations of a given rank for a specified element and adds a unique ID to the connectivity...
virtual void getElementBlockIds(std::vector< std::string > &elementBlockIds) const
virtual LocalOrdinal getConnectivitySize(LocalOrdinal localElmtId) const
Kokkos::DynRankView< LocalOrdinal, PHX::Device >::host_mirror_type LocalOrdinalView
std::vector< std::string > sidesetsToAssociate_
virtual void getElementBlockTopologies(std::vector< shards::CellTopology > &elementBlockTopologies) const
virtual const std::vector< LocalOrdinal > & getAssociatedNeighbors(const LocalOrdinal &el) const
std::map< std::string, Teuchos::RCP< std::vector< LocalOrdinal > > > elementBlocks_
std::size_t getOwnedElementCount() const
virtual const std::vector< LocalOrdinal > & getNeighborElementBlock(const std::string &blockId) const
Teuchos::RCP< const STK_Interface > getSTKInterface() const
std::map< std::string, GlobalOrdinal > blockIdToIndex_
void clearLocalElementMapping()
virtual const std::vector< LocalOrdinal > & getElementBlock(const std::string &blockId) const
Teuchos::RCP< const STK_Interface > stkMeshDB_
virtual std::string getBlockId(LocalOrdinal localElmtId) const
std::vector< LocalOrdinal > elmtLidToConn_
void associateElementsInSideset(const std::string sideset_id)
std::pair< Teuchos::RCP< const panzer::FieldPattern >, Teuchos::RCP< panzer_stk::STKConnManager > > CachedEntry
static void clearCachedConnectivityData()
If you enable caching with cacheConnectivity(), this must be called prior to exiting the code.
void modifySubcellConnectivities(const panzer::FieldPattern &fp, stk::mesh::Entity element, unsigned subcellRank, unsigned subcellId, GlobalOrdinal newId, GlobalOrdinal offset)
std::vector< GlobalOrdinal > connectivity_
virtual std::size_t numElementBlocks() const
const GlobalOrdinalView getConnectivityView()
Teuchos::RCP< const panzer::FieldPattern > fp_
FieldPatternCompare(const Teuchos::RCP< const panzer::FieldPattern > &fp)
bool operator()(CachedEntry &entry_to_compare) const