11#ifndef __Panzer_STKConnManager_hpp__
12#define __Panzer_STKConnManager_hpp__
17#include "Teuchos_RCP.hpp"
20#include "Kokkos_DynRankView.hpp"
38 typedef typename Kokkos::DynRankView<GlobalOrdinal,PHX::Device>::host_mirror_type
GlobalOrdinalView;
39 typedef typename Kokkos::DynRankView<LocalOrdinal, PHX::Device>::host_mirror_type
LocalOrdinalView;
42 STKConnManager(
const Teuchos::RCP<const STK_Interface> & stkMeshDB);
117 {
return stkMeshDB_->getElementBlockNames(elementBlockIds); }
122 std::vector<std::string> elementBlockIds;
124 elementBlockTopologies.reserve(elementBlockIds.size());
126 for (
unsigned i=0; i<elementBlockIds.size(); ++i) {
127 elementBlockTopologies.push_back(*(
stkMeshDB_->getCellTopology(elementBlockIds[i])));
137 virtual const std::vector<LocalOrdinal> &
getElementBlock(
const std::string & blockId)
const
161 std::vector<std::size_t> & localCellIds,
162 Kokkos::DynRankView<double,PHX::Device> & points)
const;
208 PANZER_FUNC_TIME_MONITOR(
"panzer::ConnectivityManager::clearCachedConnectivityData()");
255 Teuchos::RCP<std::vector<stk::mesh::Entity> >
elements_;
272 using CachedEntry = std::pair<Teuchos::RCP<const panzer::FieldPattern>,Teuchos::RCP<panzer_stk::STKConnManager>>;
274 Teuchos::RCP<const panzer::FieldPattern>
fp_;
277 {
return fp_->equals(*entry_to_compare.first); }
Pure virtual base class for supplying mesh connectivity information to the DOF Manager.
panzer::GlobalOrdinal GlobalOrdinal
A panzer::ConnManager implementation backed by an STK mesh, mapping local element IDs to global mesh-...
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()
Returns a view of the per-element offset into the flat connectivity array returned by getConnectivity...
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()
Returns a view of the per-element connectivity size array.
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()
Returns a view of the flat connectivity array (all elements' global IDs, concatenated).
Teuchos::RCP< const panzer::FieldPattern > fp_
FieldPatternCompare(const Teuchos::RCP< const panzer::FieldPattern > &fp)
bool operator()(CachedEntry &entry_to_compare) const