Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
panzer_stk::STKConnManager Class Reference

#include <Panzer_STKConnManager.hpp>

Inheritance diagram for panzer_stk::STKConnManager:
Inheritance graph
[legend]

Public Types

typedef
panzer::ConnManager::LocalOrdinal 
LocalOrdinal
 
typedef
panzer::ConnManager::GlobalOrdinal 
GlobalOrdinal
 
typedef Kokkos::DynRankView
< GlobalOrdinal, PHX::Device >
::HostMirror 
GlobalOrdinalView
 
typedef Kokkos::DynRankView
< LocalOrdinal, PHX::Device >
::HostMirror 
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)
 
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 panzer::GlobalOrdinal * getConnectivity (LocalOrdinal localElmtId)
 
virtual LocalOrdinal getConnectivitySize (LocalOrdinal localElmtId) const
 
const GlobalOrdinalView getConnectivityView ()
 
const LocalOrdinalView getConnectivitySizeView ()
 
const LocalOrdinalView getElementLidToConnView ()
 
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_InterfacegetSTKInterface () 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 ()
 

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. More...
 
void modifySubcellConnectivities (const panzer::FieldPattern &fp, stk::mesh::Entity element, unsigned subcellRank, unsigned subcellId, GlobalOrdinal newId, GlobalOrdinal offset)
 

Protected Attributes

Teuchos::RCP< const STK_InterfacestkMeshDB_
 
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_
 
std::map< std::string,
GlobalOrdinal
blockIdToIndex_
 
std::vector< LocalOrdinalelmtLidToConn_
 
std::vector< LocalOrdinalconnSize_
 
std::vector< GlobalOrdinalconnectivity_
 
std::size_t ownedElementCount_
 
std::vector< std::string > sidesetsToAssociate_
 
std::vector< bool > sidesetYieldedAssociations_
 
std::vector< std::vector
< LocalOrdinal > > 
elmtToAssociatedElmts_
 

Detailed Description

Definition at line 62 of file Panzer_STKConnManager.hpp.

Member Typedef Documentation

Definition at line 64 of file Panzer_STKConnManager.hpp.

Definition at line 65 of file Panzer_STKConnManager.hpp.

typedef Kokkos::DynRankView<GlobalOrdinal,PHX::Device>::HostMirror panzer_stk::STKConnManager::GlobalOrdinalView

Definition at line 66 of file Panzer_STKConnManager.hpp.

typedef Kokkos::DynRankView<LocalOrdinal, PHX::Device>::HostMirror panzer_stk::STKConnManager::LocalOrdinalView

Definition at line 67 of file Panzer_STKConnManager.hpp.

Constructor & Destructor Documentation

panzer_stk::STKConnManager::STKConnManager ( const Teuchos::RCP< const STK_Interface > &  stkMeshDB)

Definition at line 78 of file Panzer_STKConnManager.cpp.

virtual panzer_stk::STKConnManager::~STKConnManager ( )
inlinevirtual

Definition at line 71 of file Panzer_STKConnManager.hpp.

Member Function Documentation

void panzer_stk::STKConnManager::buildConnectivity ( const panzer::FieldPattern fp)
virtual

Tell the connection manager to build the connectivity assuming a particular field pattern.

Parameters
[in]fpField pattern to build connectivity for

Implements panzer::ConnManager.

Definition at line 254 of file Panzer_STKConnManager.cpp.

Teuchos::RCP< panzer::ConnManager > panzer_stk::STKConnManager::noConnectivityClone ( ) const
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 84 of file Panzer_STKConnManager.cpp.

virtual const panzer::GlobalOrdinal* panzer_stk::STKConnManager::getConnectivity ( LocalOrdinal  localElmtId) const
inlinevirtual

Get ID connectivity for a particular element

Parameters
[in]localElmtIdLocal element ID
Returns
Pointer to beginning of indices, with total size equal to getConnectivitySize(localElmtId)

Implements panzer::ConnManager.

Definition at line 93 of file Panzer_STKConnManager.hpp.

virtual panzer::GlobalOrdinal* panzer_stk::STKConnManager::getConnectivity ( LocalOrdinal  localElmtId)
inlinevirtual

Get ID connectivity for a particular element

Parameters
[in]localElmtIdLocal element ID
Returns
Pointer to beginning of indices, with total size equal to getConnectivitySize(localElmtId)

Definition at line 103 of file Panzer_STKConnManager.hpp.

virtual LocalOrdinal panzer_stk::STKConnManager::getConnectivitySize ( LocalOrdinal  localElmtId) const
inlinevirtual

How many mesh IDs are associated with this element?

Parameters
[in]localElmtIdLocal element ID
Returns
Number of mesh IDs that are associated with this element.

Implements panzer::ConnManager.

Definition at line 112 of file Panzer_STKConnManager.hpp.

const GlobalOrdinalView panzer_stk::STKConnManager::getConnectivityView ( )
inline

Definition at line 115 of file Panzer_STKConnManager.hpp.

const LocalOrdinalView panzer_stk::STKConnManager::getConnectivitySizeView ( )
inline

Definition at line 118 of file Panzer_STKConnManager.hpp.

const LocalOrdinalView panzer_stk::STKConnManager::getElementLidToConnView ( )
inline

Definition at line 121 of file Panzer_STKConnManager.hpp.

std::string panzer_stk::STKConnManager::getBlockId ( STKConnManager::LocalOrdinal  localElmtId) const
virtual

Get the block ID for a particular element.

Parameters
[in]localElmtIdLocal element ID

Implements panzer::ConnManager.

Definition at line 323 of file Panzer_STKConnManager.cpp.

virtual std::size_t panzer_stk::STKConnManager::numElementBlocks ( ) const
inlinevirtual

How many element blocks in this mesh?

Implements panzer::ConnManager.

Definition at line 132 of file Panzer_STKConnManager.hpp.

virtual void panzer_stk::STKConnManager::getElementBlockIds ( std::vector< std::string > &  elementBlockIds) const
inlinevirtual

Get block IDs from STK mesh object

Implements panzer::ConnManager.

Definition at line 137 of file Panzer_STKConnManager.hpp.

virtual void panzer_stk::STKConnManager::getElementBlockTopologies ( std::vector< shards::CellTopology > &  elementBlockTopologies) const
inlinevirtual

What are the cellTopologies linked to element blocks in this connection manager?

Implements panzer::ConnManager.

Definition at line 141 of file Panzer_STKConnManager.hpp.

virtual const std::vector<LocalOrdinal>& panzer_stk::STKConnManager::getElementBlock ( const std::string &  blockId) const
inlinevirtual

Get the local element IDs for a paricular element block. These are only the owned element ids.

Parameters
[in]blockIndexBlock Index
Returns
Vector of local element IDs.

Implements panzer::ConnManager.

Definition at line 156 of file Panzer_STKConnManager.hpp.

virtual const std::vector<LocalOrdinal>& panzer_stk::STKConnManager::getNeighborElementBlock ( const std::string &  blockId) const
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.

Parameters
[in]blockIndexBlock Index
Returns
Vector of local element IDs.

Implements panzer::ConnManager.

Definition at line 167 of file Panzer_STKConnManager.hpp.

void panzer_stk::STKConnManager::getDofCoords ( const std::string &  blockId,
const panzer::Intrepid2FieldPattern coordProvider,
std::vector< std::size_t > &  localCellIds,
Kokkos::DynRankView< double, PHX::Device > &  points 
) const
virtual

Get the coordinates (with local cell ids) for a specified element block and field pattern.

Parameters
[in]blockIdBlock containing the cells
[in]coordProviderField pattern that builds the coordinates
[out]localCellIdsLocal cell Ids (indices)
[out]Resizablefield container that contains the coordinates of the points on exit.

Get the coordinates for a specified element block and field pattern.

Definition at line 386 of file Panzer_STKConnManager.cpp.

Teuchos::RCP<const STK_Interface> panzer_stk::STKConnManager::getSTKInterface ( ) const
inline

Get STK interface that this connection manager is built on.

Definition at line 185 of file Panzer_STKConnManager.hpp.

std::size_t panzer_stk::STKConnManager::getOwnedElementCount ( ) const
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 195 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 408 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 451 of file Panzer_STKConnManager.cpp.

const std::vector< STKConnManager::LocalOrdinal > & panzer_stk::STKConnManager::getAssociatedNeighbors ( const LocalOrdinal el) const
virtual

Get elements, if any, associated with el, excluding el itself.

Implements panzer::ConnManager.

Definition at line 464 of file Panzer_STKConnManager.cpp.

bool panzer_stk::STKConnManager::hasAssociatedNeighbors ( ) const
virtual

Return whether getAssociatedNeighbors will return true for at least one input. Default implementation returns false.

Implements panzer::ConnManager.

Definition at line 403 of file Panzer_STKConnManager.cpp.

void panzer_stk::STKConnManager::applyPeriodicBCs ( const panzer::FieldPattern fp,
GlobalOrdinal  nodeOffset,
GlobalOrdinal  edgeOffset,
GlobalOrdinal  faceOffset,
GlobalOrdinal  cellOffset 
)
protected

Apply periodic boundary conditions associated with the mesh object.

Note
This function requires global All-2-All communication IFF periodic boundary conditions are required.

Definition at line 331 of file Panzer_STKConnManager.cpp.

void panzer_stk::STKConnManager::applyInterfaceConditions ( )
protected

Definition at line 422 of file Panzer_STKConnManager.cpp.

void panzer_stk::STKConnManager::buildLocalElementMapping ( )
protected

Definition at line 99 of file Panzer_STKConnManager.cpp.

void panzer_stk::STKConnManager::clearLocalElementMapping ( )
protected

Definition at line 89 of file Panzer_STKConnManager.cpp.

void panzer_stk::STKConnManager::buildOffsetsAndIdCounts ( const panzer::FieldPattern fp,
LocalOrdinal nodeIdCnt,
LocalOrdinal edgeIdCnt,
LocalOrdinal faceIdCnt,
LocalOrdinal cellIdCnt,
GlobalOrdinal nodeOffset,
GlobalOrdinal edgeOffset,
GlobalOrdinal faceOffset,
GlobalOrdinal cellOffset 
) const
protected

Definition at line 162 of file Panzer_STKConnManager.cpp.

STKConnManager::LocalOrdinal panzer_stk::STKConnManager::addSubcellConnectivities ( stk::mesh::Entity  element,
unsigned  subcellRank,
LocalOrdinal  idCnt,
GlobalOrdinal  offset,
const unsigned  maxIds = 0 
)
protected

Loops over relations of a given rank for a specified element and adds a unique ID to the connectivity vector.

Parameters
[in]elementMesh element
[in]subcellRankRank of the subcell entities to identify
[in]idCntNumber of IDs on the requested subcell type
[in]offsetOffset for requested subcell type
in,optional]maxIds If positive, maximum number of IDs to connect to this element. If 0 (default), add all IDs.
Precondition
Should call buildOffsetsAndIdCounts() to obtain idCnt and offset.
Note
The connectivity manager needs only the lowest order nodal information. Hence, maxIds should be set appropriately if the STK mesh is second order or higher.

Definition at line 204 of file Panzer_STKConnManager.cpp.

void panzer_stk::STKConnManager::modifySubcellConnectivities ( const panzer::FieldPattern fp,
stk::mesh::Entity  element,
unsigned  subcellRank,
unsigned  subcellId,
GlobalOrdinal  newId,
GlobalOrdinal  offset 
)
protected

Definition at line 240 of file Panzer_STKConnManager.cpp.

Member Data Documentation

Teuchos::RCP<const STK_Interface> panzer_stk::STKConnManager::stkMeshDB_
protected

Definition at line 257 of file Panzer_STKConnManager.hpp.

Teuchos::RCP<std::vector<stk::mesh::Entity> > panzer_stk::STKConnManager::elements_
protected

Definition at line 259 of file Panzer_STKConnManager.hpp.

std::map<std::string,Teuchos::RCP<std::vector<LocalOrdinal> > > panzer_stk::STKConnManager::elementBlocks_
protected

Definition at line 262 of file Panzer_STKConnManager.hpp.

std::map<std::string,Teuchos::RCP<std::vector<LocalOrdinal> > > panzer_stk::STKConnManager::neighborElementBlocks_
protected

Definition at line 263 of file Panzer_STKConnManager.hpp.

std::map<std::string,GlobalOrdinal> panzer_stk::STKConnManager::blockIdToIndex_
protected

Definition at line 264 of file Panzer_STKConnManager.hpp.

std::vector<LocalOrdinal> panzer_stk::STKConnManager::elmtLidToConn_
protected

Definition at line 266 of file Panzer_STKConnManager.hpp.

std::vector<LocalOrdinal> panzer_stk::STKConnManager::connSize_
protected

Definition at line 267 of file Panzer_STKConnManager.hpp.

std::vector<GlobalOrdinal> panzer_stk::STKConnManager::connectivity_
protected

Definition at line 268 of file Panzer_STKConnManager.hpp.

std::size_t panzer_stk::STKConnManager::ownedElementCount_
protected

Definition at line 270 of file Panzer_STKConnManager.hpp.

std::vector<std::string> panzer_stk::STKConnManager::sidesetsToAssociate_
protected

Definition at line 272 of file Panzer_STKConnManager.hpp.

std::vector<bool> panzer_stk::STKConnManager::sidesetYieldedAssociations_
protected

Definition at line 273 of file Panzer_STKConnManager.hpp.

std::vector<std::vector<LocalOrdinal> > panzer_stk::STKConnManager::elmtToAssociatedElmts_
protected

Definition at line 274 of file Panzer_STKConnManager.hpp.


The documentation for this class was generated from the following files: