11#ifndef __Panzer_STKConnManager_hpp__
12#define __Panzer_STKConnManager_hpp__
17#include "Teuchos_RCP.hpp"
20#include "Kokkos_DynRankView.hpp"
59 typedef typename Kokkos::DynRankView<GlobalOrdinal,PHX::Device>::host_mirror_type::const_type
GlobalOrdinalView;
60 typedef typename Kokkos::DynRankView<LocalOrdinal, PHX::Device>::host_mirror_type::const_type
LocalOrdinalView;
63 STKConnManager(
const Teuchos::RCP<const STK_Interface> & stkMeshDB);
91 {
return &(*connectivityPtr_)[(*elmtLidToConnPtr_)[localElmtId]]; }
128 {
return stkMeshDB_->getElementBlockNames(elementBlockIds); }
133 std::vector<std::string> elementBlockIds;
135 elementBlockTopologies.reserve(elementBlockIds.size());
137 for (
unsigned i=0; i<elementBlockIds.size(); ++i) {
138 elementBlockTopologies.push_back(*(
stkMeshDB_->getCellTopology(elementBlockIds[i])));
148 virtual const std::vector<LocalOrdinal> &
getElementBlock(
const std::string & blockId)
const
172 std::vector<std::size_t> & localCellIds,
173 Kokkos::DynRankView<double,PHX::Device> & points)
const;
224 PANZER_FUNC_TIME_MONITOR(
"panzer::ConnectivityManager::clearCachedConnectivityData()");
278 Teuchos::RCP<std::vector<stk::mesh::Entity> >
elements_;
297 using CachedEntry = std::pair<Teuchos::RCP<const panzer::FieldPattern>,Teuchos::RCP<panzer_stk::STKConnManager>>;
305 const std::vector<std::string>& sidesets)
312 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-...
Teuchos::RCP< std::vector< LocalOrdinal > > elmtLidToConnPtr_
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()
const LocalOrdinalView getElementLidToConnView() const
Returns a read-only view of the per-element offset into the flat connectivity array returned by getCo...
static int cached_reuse_count_
virtual Teuchos::RCP< panzer::ConnManager > noConnectivityClone() const
Teuchos::RCP< std::vector< GlobalOrdinal > > connectivityPtr_
virtual const panzer::GlobalOrdinal * getConnectivity(LocalOrdinal localElmtId) const
std::map< std::string, Teuchos::RCP< std::vector< LocalOrdinal > > > neighborElementBlocks_
panzer::ConnManager::LocalOrdinal LocalOrdinal
Teuchos::RCP< std::vector< LocalOrdinal > > connSizePtr_
Kokkos::DynRankView< LocalOrdinal, PHX::Device >::host_mirror_type::const_type LocalOrdinalView
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,...
static void cacheConnectivity()
Enables the caching of connectivity data.
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_
STKConnManager(const Teuchos::RCP< const STK_Interface > &stkMeshDB)
Construct from the STK mesh to build connectivity from. buildConnectivity() must be called before con...
panzer::ConnManager::GlobalOrdinal GlobalOrdinal
virtual void buildConnectivity(const panzer::FieldPattern &fp)
void buildLocalElementMapping()
std::vector< bool > sidesetYieldedAssociations_
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
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
const LocalOrdinalView getConnectivitySizeView() const
Returns a read-only view of the per-element connectivity size array.
const GlobalOrdinalView getConnectivityView() const
Returns a read-only view of the flat connectivity array (all elements' global IDs,...
void clearLocalElementMapping()
virtual const std::vector< LocalOrdinal > & getElementBlock(const std::string &blockId) const
Teuchos::RCP< const STK_Interface > stkMeshDB_
std::pair< Teuchos::RCP< const panzer::FieldPattern >, Teuchos::RCP< panzer_stk::STKConnManager > > CachedEntry
Kokkos::DynRankView< GlobalOrdinal, PHX::Device >::host_mirror_type::const_type GlobalOrdinalView
virtual std::string getBlockId(LocalOrdinal localElmtId) const
Teuchos::RCP< std::vector< std::vector< LocalOrdinal > > > elmtToAssociatedElmtsPtr_
void associateElementsInSideset(const std::string sideset_id)
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)
virtual std::size_t numElementBlocks() const
const STK_Interface * mesh_
bool operator()(const CachedEntry &entry_to_compare) const
const std::vector< std::string > & sidesets_
CacheKeyCompare(const panzer::FieldPattern &fp, const STK_Interface *mesh, const std::vector< std::string > &sidesets)
const panzer::FieldPattern & fp_