|
Panzer Version of the Day
|
A panzer::ConnManager implementation backed by an STK mesh, mapping local element IDs to global mesh-entity (node/edge/face/cell) IDs according to a given field pattern. More...
#include <Panzer_STKConnManager.hpp>

Classes | |
| struct | CacheKeyCompare |
| Matches a cache entry on mesh, field pattern and sideset association list. More... | |
Public Types | |
| typedef panzer::ConnManager::LocalOrdinal | LocalOrdinal |
| typedef panzer::ConnManager::GlobalOrdinal | GlobalOrdinal |
| typedef Kokkos::DynRankView< GlobalOrdinal, PHX::Device >::host_mirror_type::const_type | GlobalOrdinalView |
| typedef Kokkos::DynRankView< LocalOrdinal, PHX::Device >::host_mirror_type::const_type | LocalOrdinalView |
| Public Types inherited from panzer::ConnManager | |
| using | GlobalOrdinal = panzer::GlobalOrdinal |
| using | LocalOrdinal = int |
Public Member Functions | |
| STKConnManager (const Teuchos::RCP< const STK_Interface > &stkMeshDB) | |
| Construct from the STK mesh to build connectivity from. buildConnectivity() must be called before connectivity queries are valid. | |
| STKConnManager (const panzer_stk::STKConnManager &cm) | |
| Copy constructor. | |
| virtual | ~STKConnManager () |
| virtual void | buildConnectivity (const panzer::FieldPattern &fp) |
| virtual Teuchos::RCP< panzer::ConnManager > | noConnectivityClone () const |
| virtual const panzer::GlobalOrdinal * | getConnectivity (LocalOrdinal localElmtId) const |
| virtual LocalOrdinal | getConnectivitySize (LocalOrdinal localElmtId) const |
| const GlobalOrdinalView | getConnectivityView () const |
| Returns a read-only view of the flat connectivity array (all elements' global IDs, concatenated). | |
| const LocalOrdinalView | getConnectivitySizeView () const |
| Returns a read-only view of the per-element connectivity size array. | |
| const LocalOrdinalView | getElementLidToConnView () const |
| Returns a read-only view of the per-element offset into the flat connectivity array returned by getConnectivityView(). | |
| virtual std::string | getBlockId (LocalOrdinal localElmtId) const |
| virtual std::size_t | numElementBlocks () const |
| virtual void | getElementBlockIds (std::vector< std::string > &elementBlockIds) const |
| virtual void | getElementBlockTopologies (std::vector< shards::CellTopology > &elementBlockTopologies) const |
| virtual const std::vector< LocalOrdinal > & | getElementBlock (const std::string &blockId) const |
| virtual const std::vector< LocalOrdinal > & | getNeighborElementBlock (const std::string &blockId) const |
| virtual void | getDofCoords (const std::string &blockId, const panzer::Intrepid2FieldPattern &coordProvider, std::vector< std::size_t > &localCellIds, Kokkos::DynRankView< double, PHX::Device > &points) const |
| Teuchos::RCP< const STK_Interface > | getSTKInterface () const |
| std::size_t | getOwnedElementCount () const |
| void | associateElementsInSideset (const std::string sideset_id) |
| std::vector< std::string > | checkAssociateElementsInSidesets (const Teuchos::Comm< int > &comm) const |
| virtual const std::vector< LocalOrdinal > & | getAssociatedNeighbors (const LocalOrdinal &el) const |
| virtual bool | hasAssociatedNeighbors () const |
| Public Member Functions inherited from panzer::ConnManager | |
| virtual | ~ConnManager () |
Static Public Member Functions | |
| static void | cacheConnectivity () |
| Enables the caching of connectivity data. | |
| static void | clearCachedConnectivityData () |
| If you enable caching with cacheConnectivity(), this must be called prior to exiting the code. | |
| static void | clearCachedConnectivityData (const Teuchos::RCP< const STK_Interface > &mesh) |
| Removes all cached connectivity data built on the given mesh. | |
| static int | getCachedReuseCount () |
| This is purely for unit testing. Returns the number of times that buildConnectivity() was called, but a cached version was found to use instead. | |
Protected Types | |
| using | CachedEntry = std::pair<Teuchos::RCP<const panzer::FieldPattern>,Teuchos::RCP<panzer_stk::STKConnManager>> |
Protected Member Functions | |
| void | applyPeriodicBCs (const panzer::FieldPattern &fp, GlobalOrdinal nodeOffset, GlobalOrdinal edgeOffset, GlobalOrdinal faceOffset, GlobalOrdinal cellOffset) |
| void | applyInterfaceConditions () |
| void | buildLocalElementMapping () |
| void | clearLocalElementMapping () |
| void | buildOffsetsAndIdCounts (const panzer::FieldPattern &fp, LocalOrdinal &nodeIdCnt, LocalOrdinal &edgeIdCnt, LocalOrdinal &faceIdCnt, LocalOrdinal &cellIdCnt, GlobalOrdinal &nodeOffset, GlobalOrdinal &edgeOffset, GlobalOrdinal &faceOffset, GlobalOrdinal &cellOffset) const |
| 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 vector. | |
| void | modifySubcellConnectivities (const panzer::FieldPattern &fp, stk::mesh::Entity element, unsigned subcellRank, unsigned subcellId, GlobalOrdinal newId, GlobalOrdinal offset) |
Protected Attributes | |
| Teuchos::RCP< const STK_Interface > | stkMeshDB_ |
| Teuchos::RCP< std::vector< stk::mesh::Entity > > | elements_ |
| std::map< std::string, Teuchos::RCP< std::vector< LocalOrdinal > > > | elementBlocks_ |
| std::map< std::string, Teuchos::RCP< std::vector< LocalOrdinal > > > | neighborElementBlocks_ |
| Teuchos::RCP< std::vector< LocalOrdinal > > | elmtLidToConnPtr_ |
| Teuchos::RCP< std::vector< LocalOrdinal > > | connSizePtr_ |
| Teuchos::RCP< std::vector< GlobalOrdinal > > | connectivityPtr_ |
| std::size_t | ownedElementCount_ |
| std::vector< std::string > | sidesetsToAssociate_ |
| std::vector< bool > | sidesetYieldedAssociations_ |
| Teuchos::RCP< std::vector< std::vector< LocalOrdinal > > > | elmtToAssociatedElmtsPtr_ |
Static Protected Attributes | |
| static bool | cache_connectivity_ {false} |
| static std::vector< CachedEntry > | cached_conn_managers_ {} |
| static int | cached_reuse_count_ {0} |
A panzer::ConnManager implementation backed by an STK mesh, mapping local element IDs to global mesh-entity (node/edge/face/cell) IDs according to a given field pattern.
Connectivity caching
When caching is enabled with cacheConnectivity(), the connectivity built by buildConnectivity() is saved and reused by later calls on any STKConnManager. A cached result is reused only when all of the following match: the STK_Interface object (compared by address), the field pattern, and the list of sidesets passed to associateElementsInSideset() (in the same order).
Definition at line 55 of file Panzer_STKConnManager.hpp.
Definition at line 57 of file Panzer_STKConnManager.hpp.
Definition at line 58 of file Panzer_STKConnManager.hpp.
| typedef Kokkos::DynRankView<GlobalOrdinal,PHX::Device>::host_mirror_type::const_type panzer_stk::STKConnManager::GlobalOrdinalView |
Definition at line 59 of file Panzer_STKConnManager.hpp.
| typedef Kokkos::DynRankView<LocalOrdinal,PHX::Device>::host_mirror_type::const_type panzer_stk::STKConnManager::LocalOrdinalView |
Definition at line 60 of file Panzer_STKConnManager.hpp.
|
protected |
Definition at line 297 of file Panzer_STKConnManager.hpp.
| panzer_stk::STKConnManager::STKConnManager | ( | const Teuchos::RCP< const STK_Interface > & | stkMeshDB | ) |
Construct from the STK mesh to build connectivity from. buildConnectivity() must be called before connectivity queries are valid.
Definition at line 63 of file Panzer_STKConnManager.cpp.
| panzer_stk::STKConnManager::STKConnManager | ( | const panzer_stk::STKConnManager & | cm | ) |
Copy constructor.
Definition at line 73 of file Panzer_STKConnManager.cpp.
|
inlinevirtual |
Definition at line 68 of file Panzer_STKConnManager.hpp.
|
virtual |
Tell the connection manager to build the connectivity assuming a particular field pattern.
| [in] | fp | Field pattern to build connectivity for |
Implements panzer::ConnManager.
Definition at line 261 of file Panzer_STKConnManager.cpp.
|
virtual |
Build a clone of this connection manager, without any assumptions about the required connectivity (e.g. buildConnectivity has never been called).
Implements panzer::ConnManager.
Definition at line 89 of file Panzer_STKConnManager.cpp.
|
inlinevirtual |
Get ID connectivity for a particular element
| [in] | localElmtId | Local element ID |
getConnectivitySize(localElmtId) Implements panzer::ConnManager.
Definition at line 90 of file Panzer_STKConnManager.hpp.
|
inlinevirtual |
How many mesh IDs are associated with this element?
| [in] | localElmtId | Local element ID |
Implements panzer::ConnManager.
Definition at line 99 of file Panzer_STKConnManager.hpp.
|
inline |
Returns a read-only view of the flat connectivity array (all elements' global IDs, concatenated).
Definition at line 103 of file Panzer_STKConnManager.hpp.
|
inline |
Returns a read-only view of the per-element connectivity size array.
Definition at line 107 of file Panzer_STKConnManager.hpp.
|
inline |
Returns a read-only view of the per-element offset into the flat connectivity array returned by getConnectivityView().
Definition at line 111 of file Panzer_STKConnManager.hpp.
|
virtual |
Get the block ID for a particular element.
| [in] | localElmtId | Local element ID |
Implements panzer::ConnManager.
Definition at line 362 of file Panzer_STKConnManager.cpp.
|
inlinevirtual |
How many element blocks in this mesh?
Implements panzer::ConnManager.
Definition at line 122 of file Panzer_STKConnManager.hpp.
|
inlinevirtual |
Get block IDs from STK mesh object
Implements panzer::ConnManager.
Definition at line 127 of file Panzer_STKConnManager.hpp.
|
inlinevirtual |
What are the cellTopologies linked to element blocks in this connection manager?
Implements panzer::ConnManager.
Definition at line 132 of file Panzer_STKConnManager.hpp.
|
inlinevirtual |
Get the local element IDs for a paricular element block. These are only the owned element ids.
| [in] | blockIndex | Block Index |
Implements panzer::ConnManager.
Definition at line 148 of file Panzer_STKConnManager.hpp.
|
inlinevirtual |
Get the local element IDs for a paricular element block. These element ids are not owned, and the element will live on another processor.
| [in] | blockIndex | Block Index |
Implements panzer::ConnManager.
Definition at line 159 of file Panzer_STKConnManager.hpp.
|
virtual |
Get the coordinates (with local cell ids) for a specified element block and field pattern.
| [in] | blockId | Block containing the cells |
| [in] | coordProvider | Field pattern that builds the coordinates |
| [out] | localCellIds | Local cell Ids (indices) |
| [out] | Resizable | field container that contains the coordinates of the points on exit. |
Get the coordinates for a specified element block and field pattern.
Definition at line 422 of file Panzer_STKConnManager.cpp.
|
inline |
Get STK interface that this connection manager is built on.
Definition at line 177 of file Panzer_STKConnManager.hpp.
|
inline |
How many elements are owned by this processor. Further, the ordering of the local ids is suct that the first getOwnedElementCount() elements are owned by this processor. This is true only because of the local element ids generated by the STK_Interface object.
Definition at line 187 of file Panzer_STKConnManager.hpp.
| void panzer_stk::STKConnManager::associateElementsInSideset | ( | const std::string | sideset_id | ) |
Before calling buildConnectivity, provide sideset IDs from which to extract associated elements.
Definition at line 444 of file Panzer_STKConnManager.cpp.
| std::vector< std::string > panzer_stk::STKConnManager::checkAssociateElementsInSidesets | ( | const Teuchos::Comm< int > & | comm | ) | const |
After calling buildConnectivity, optionally check which sidesets yielded no element associations in this communicator. This is a parallel operation. In many applications, the outcome indicating correctness is that the returned vector is empty.
Definition at line 487 of file Panzer_STKConnManager.cpp.
|
virtual |
Get elements, if any, associated with el, excluding el itself.
Implements panzer::ConnManager.
Definition at line 501 of file Panzer_STKConnManager.cpp.
|
virtual |
Return whether getAssociatedNeighbors will return true for at least one input. Default implementation returns false.
Implements panzer::ConnManager.
Definition at line 439 of file Panzer_STKConnManager.cpp.
|
inlinestatic |
Enables the caching of connectivity data.
Cached data keeps its meshes alive until it is cleared. Be sure to call clearCachedConnectivityData() before exiting your program, and see the class documentation for when cached data must be cleared.
Definition at line 218 of file Panzer_STKConnManager.hpp.
|
inlinestatic |
If you enable caching with cacheConnectivity(), this must be called prior to exiting the code.
Definition at line 222 of file Panzer_STKConnManager.hpp.
|
static |
Removes all cached connectivity data built on the given mesh.
This releases the cache's references to that mesh. Call it whenever the mesh is modified or is no longer needed.
Definition at line 38 of file Panzer_STKConnManager.cpp.
|
inlinestatic |
This is purely for unit testing. Returns the number of times that buildConnectivity() was called, but a cached version was found to use instead.
Definition at line 236 of file Panzer_STKConnManager.hpp.
|
protected |
Apply periodic boundary conditions associated with the mesh object.
Definition at line 370 of file Panzer_STKConnManager.cpp.
|
protected |
Definition at line 458 of file Panzer_STKConnManager.cpp.
|
protected |
Definition at line 108 of file Panzer_STKConnManager.cpp.
|
protected |
Definition at line 94 of file Panzer_STKConnManager.cpp.
|
protected |
Definition at line 168 of file Panzer_STKConnManager.cpp.
|
protected |
Loops over relations of a given rank for a specified element and adds a unique ID to the connectivity vector.
| [in] | element | Mesh element |
| [in] | subcellRank | Rank of the subcell entities to identify |
| [in] | idCnt | Number of IDs on the requested subcell type |
| [in] | offset | Offset for requested subcell type |
| [in,optional] | maxIds If positive, maximum number of IDs to connect to this element. If 0 (default), add all IDs. |
idCnt and offset. Definition at line 210 of file Panzer_STKConnManager.cpp.
|
protected |
Definition at line 247 of file Panzer_STKConnManager.cpp.
|
protected |
Definition at line 276 of file Panzer_STKConnManager.hpp.
|
protected |
Definition at line 278 of file Panzer_STKConnManager.hpp.
|
protected |
Definition at line 281 of file Panzer_STKConnManager.hpp.
|
protected |
Definition at line 282 of file Panzer_STKConnManager.hpp.
|
protected |
Definition at line 287 of file Panzer_STKConnManager.hpp.
|
protected |
Definition at line 288 of file Panzer_STKConnManager.hpp.
|
protected |
Definition at line 289 of file Panzer_STKConnManager.hpp.
|
protected |
Definition at line 291 of file Panzer_STKConnManager.hpp.
|
protected |
Definition at line 293 of file Panzer_STKConnManager.hpp.
|
protected |
Definition at line 294 of file Panzer_STKConnManager.hpp.
|
protected |
Definition at line 295 of file Panzer_STKConnManager.hpp.
|
staticprotected |
Definition at line 316 of file Panzer_STKConnManager.hpp.
|
staticprotected |
Definition at line 317 of file Panzer_STKConnManager.hpp.
|
staticprotected |
Definition at line 318 of file Panzer_STKConnManager.hpp.