Mundy: Multibody Nonlocal Dynamics Version of the Day
Loading...
Searching...
No Matches
mundy::mesh::NgpLinkCOODataT< NgpMemSpace > Class Template Reference

#include <LinkCOOData.hpp>

Inheritance diagram for mundy::mesh::NgpLinkCOODataT< NgpMemSpace >:
[legend]

Public Member Functions

Constructors and destructor
 NgpLinkCOODataT ()=default
 Default constructor.
 NgpLinkCOODataT (const NgpLinkCOODataT &)=default
 Default copy or move constructors/operators.
 NgpLinkCOODataT (NgpLinkCOODataT &&)=default
NgpLinkCOODataToperator= (const NgpLinkCOODataT &)=default
NgpLinkCOODataToperator= (NgpLinkCOODataT &&)=default
 NgpLinkCOODataT (stk::mesh::BulkData &bulk_data, LinkMetaData &link_meta_data)
 Canonical constructor.
 NgpLinkCOODataT (LinkCOOData &host_other)
 Construct from a LinkCOOData. Does NOT perform a deep copy. Simply steals their pointers to the bulk data and meta data.
virtual ~NgpLinkCOODataT ()=default
 Destructor.
Getters
bool is_valid () const noexcept
 Get if the link data is valid.
const LinkMetaDatalink_meta_data () const
 Fetch the link meta data manager.
LinkMetaDatalink_meta_data ()
 Fetch the link meta data manager.
const stk::mesh::BulkDatabulk_data () const
 Fetch the bulk data manager we extend.
stk::mesh::BulkDatabulk_data ()
 Fetch the bulk data manager we extend.
stk::mesh::EntityRank link_rank () const noexcept
 Fetch the link rank.

Dynamic link to linked entity relationships

void declare_relation (const stk::mesh::FastMeshIndex &linker_index, const stk::mesh::EntityRank &linked_entity_rank, const stk::mesh::FastMeshIndex &linked_entity_index, unsigned link_ordinal) const
 Declare a relation between a linker and a linked entity.
void declare_relation (const stk::mesh::Entity &linker, const stk::mesh::Entity &linked_entity, unsigned link_ordinal) const
void destroy_relation (const stk::mesh::FastMeshIndex &linker_index, unsigned link_ordinal) const
 Delete a relation between a linker and a linked entity.
void destroy_relation (const stk::mesh::Entity &linker, unsigned link_ordinal) const
stk::mesh::Entity get_linked_entity (const stk::mesh::FastMeshIndex &linker_index, unsigned link_ordinal) const
 Get the linked entity for a given linker and link ordinal.
stk::mesh::Entity get_linked_entity (const stk::mesh::Entity &linker, unsigned link_ordinal) const
stk::mesh::FastMeshIndex get_linked_entity_index (const stk::mesh::FastMeshIndex &linker_index, unsigned link_ordinal) const
 Get the linked entity index for a given linker and link ordinal.
stk::mesh::FastMeshIndex get_linked_entity_index (const stk::mesh::Entity &linker, unsigned link_ordinal) const
stk::mesh::EntityId get_linked_entity_id (const stk::mesh::FastMeshIndex &linker_index, unsigned link_ordinal) const
 Get the linked entity id for a given linker and link ordinal.
stk::mesh::EntityId get_linked_entity_id (const stk::mesh::Entity &linker, unsigned link_ordinal) const
stk::mesh::EntityRank get_linked_entity_rank (const stk::mesh::FastMeshIndex &linker_index, unsigned link_ordinal) const
 Get the linked entity rank for a given linker and link ordinal.
stk::mesh::EntityRank get_linked_entity_rank (const stk::mesh::Entity &linker, unsigned link_ordinal) const
const stk::mesh::NgpMesh & ngp_mesh () const noexcept
 Fetch the ngp mesh.
stk::mesh::NgpMesh & ngp_mesh () noexcept
stk::mesh::Entity get_linked_entity_crs (const stk::mesh::FastMeshIndex &linker_index, unsigned link_ordinal) const
 Get the linked entity for a given linker and link ordinal (as last seen by the CSR connectivity).
stk::mesh::Entity get_linked_entity_crs (const stk::mesh::Entity &linker, unsigned link_ordinal) const
bool get_link_crs_needs_updated (const stk::mesh::FastMeshIndex &linker_index) const
 Get if the CSR connectivity for a link needs to be updated.
bool get_link_crs_needs_updated (const stk::mesh::Entity &linker) const

Constructor & Destructor Documentation

◆ NgpLinkCOODataT() [1/5]

template<typename NgpMemSpace>
mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::NgpLinkCOODataT ( )
default

◆ NgpLinkCOODataT() [2/5]

template<typename NgpMemSpace>
mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::NgpLinkCOODataT ( const NgpLinkCOODataT< NgpMemSpace > & )
default

◆ NgpLinkCOODataT() [3/5]

template<typename NgpMemSpace>
mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::NgpLinkCOODataT ( NgpLinkCOODataT< NgpMemSpace > && )
default

◆ NgpLinkCOODataT() [4/5]

template<typename NgpMemSpace>
mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::NgpLinkCOODataT ( stk::mesh::BulkData & bulk_data,
LinkMetaData & link_meta_data )
inlineexplicit

◆ NgpLinkCOODataT() [5/5]

template<typename NgpMemSpace>
mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::NgpLinkCOODataT ( LinkCOOData & host_other)
inlineexplicit

◆ ~NgpLinkCOODataT()

template<typename NgpMemSpace>
virtual mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::~NgpLinkCOODataT ( )
virtualdefault

Member Function Documentation

◆ operator=() [1/2]

template<typename NgpMemSpace>
NgpLinkCOODataT & mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::operator= ( const NgpLinkCOODataT< NgpMemSpace > & )
default

◆ operator=() [2/2]

template<typename NgpMemSpace>
NgpLinkCOODataT & mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::operator= ( NgpLinkCOODataT< NgpMemSpace > && )
default

◆ is_valid()

template<typename NgpMemSpace>
bool mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::is_valid ( ) const
inlinenoexcept

◆ link_meta_data() [1/2]

template<typename NgpMemSpace>
const LinkMetaData & mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::link_meta_data ( ) const
inline

◆ link_meta_data() [2/2]

template<typename NgpMemSpace>
LinkMetaData & mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::link_meta_data ( )
inline

◆ bulk_data() [1/2]

template<typename NgpMemSpace>
const stk::mesh::BulkData & mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::bulk_data ( ) const
inline

◆ bulk_data() [2/2]

template<typename NgpMemSpace>
stk::mesh::BulkData & mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::bulk_data ( )
inline

◆ link_rank()

template<typename NgpMemSpace>
stk::mesh::EntityRank mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::link_rank ( ) const
inlinenoexcept

◆ declare_relation() [1/2]

template<typename NgpMemSpace>
void mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::declare_relation ( const stk::mesh::FastMeshIndex & linker_index,
const stk::mesh::EntityRank & linked_entity_rank,
const stk::mesh::FastMeshIndex & linked_entity_index,
unsigned link_ordinal ) const
inline

To explain ordinals:

If a linker has dimensionality 3 then it can have up to 3 linked entities. The first linked entity has ordinal 0, the second has ordinal 1, and so on.

Importantly, the relationship between links and its linked entities is static with fixed size. If you fetch the linked entities and have only declared the first two, then the third will be invalid. This is a slight deviation from STK, which would return a set of two valid entities and provide access to their ordinals.

How does a link attain a certain dimensionality?

A link's dimensionality is determined by the set of parts that it belongs to. When link parts are declared, they are assigned a dimensionality. If a link belongs to multiple link parts, then the maximum dimensionality of those parts is the link's dimensionality.

TODO(palmerb4): Bounds check the link ordinal.

Parameters
linker[in] The linker (must be valid and of the correct rank).
linked_entity[in] The linked entity (may be invalid).
link_ordinal[in] The ordinal of the linked entity.

◆ declare_relation() [2/2]

template<typename NgpMemSpace>
void mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::declare_relation ( const stk::mesh::Entity & linker,
const stk::mesh::Entity & linked_entity,
unsigned link_ordinal ) const
inline

◆ destroy_relation() [1/2]

template<typename NgpMemSpace>
void mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::destroy_relation ( const stk::mesh::FastMeshIndex & linker_index,
unsigned link_ordinal ) const
inline
Parameters
linker[in] The linker (must be valid and of the correct rank).
link_ordinal[in] The ordinal of the linked entity.

◆ destroy_relation() [2/2]

template<typename NgpMemSpace>
void mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::destroy_relation ( const stk::mesh::Entity & linker,
unsigned link_ordinal ) const
inline

◆ get_linked_entity() [1/2]

template<typename NgpMemSpace>
stk::mesh::Entity mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::get_linked_entity ( const stk::mesh::FastMeshIndex & linker_index,
unsigned link_ordinal ) const
inline
Parameters
linker[in] The linker (must be valid and of the correct rank).
link_ordinal[in] The ordinal of the linked entity.

◆ get_linked_entity() [2/2]

template<typename NgpMemSpace>
stk::mesh::Entity mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::get_linked_entity ( const stk::mesh::Entity & linker,
unsigned link_ordinal ) const
inline

◆ get_linked_entity_index() [1/2]

template<typename NgpMemSpace>
stk::mesh::FastMeshIndex mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::get_linked_entity_index ( const stk::mesh::FastMeshIndex & linker_index,
unsigned link_ordinal ) const
inline
Parameters
linker[in] The linker (must be valid and of the correct rank).
link_ordinal[in] The ordinal of the linked entity.

◆ get_linked_entity_index() [2/2]

template<typename NgpMemSpace>
stk::mesh::FastMeshIndex mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::get_linked_entity_index ( const stk::mesh::Entity & linker,
unsigned link_ordinal ) const
inline

◆ get_linked_entity_id() [1/2]

template<typename NgpMemSpace>
stk::mesh::EntityId mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::get_linked_entity_id ( const stk::mesh::FastMeshIndex & linker_index,
unsigned link_ordinal ) const
inline
Parameters
linker[in] The linker (must be valid and of the correct rank).
link_ordinal[in] The ordinal of the linked entity.

◆ get_linked_entity_id() [2/2]

template<typename NgpMemSpace>
stk::mesh::EntityId mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::get_linked_entity_id ( const stk::mesh::Entity & linker,
unsigned link_ordinal ) const
inline

◆ get_linked_entity_rank() [1/2]

template<typename NgpMemSpace>
stk::mesh::EntityRank mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::get_linked_entity_rank ( const stk::mesh::FastMeshIndex & linker_index,
unsigned link_ordinal ) const
inline
Parameters
linker[in] The linker (must be valid and of the correct rank).
link_ordinal[in] The ordinal of the linked entity.

◆ get_linked_entity_rank() [2/2]

template<typename NgpMemSpace>
stk::mesh::EntityRank mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::get_linked_entity_rank ( const stk::mesh::Entity & linker,
unsigned link_ordinal ) const
inline

◆ ngp_mesh() [1/2]

template<typename NgpMemSpace>
const stk::mesh::NgpMesh & mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::ngp_mesh ( ) const
inlineprotectednoexcept

◆ ngp_mesh() [2/2]

template<typename NgpMemSpace>
stk::mesh::NgpMesh & mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::ngp_mesh ( )
inlineprotectednoexcept

◆ get_linked_entity_crs() [1/2]

template<typename NgpMemSpace>
stk::mesh::Entity mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::get_linked_entity_crs ( const stk::mesh::FastMeshIndex & linker_index,
unsigned link_ordinal ) const
inlineprotected
Parameters
linker[in] The linker (must be valid and of the correct rank).
link_ordinal[in] The ordinal of the linked entity.

◆ get_linked_entity_crs() [2/2]

template<typename NgpMemSpace>
stk::mesh::Entity mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::get_linked_entity_crs ( const stk::mesh::Entity & linker,
unsigned link_ordinal ) const
inlineprotected

◆ get_link_crs_needs_updated() [1/2]

template<typename NgpMemSpace>
bool mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::get_link_crs_needs_updated ( const stk::mesh::FastMeshIndex & linker_index) const
inlineprotected

◆ get_link_crs_needs_updated() [2/2]

template<typename NgpMemSpace>
bool mundy::mesh::NgpLinkCOODataT< NgpMemSpace >::get_link_crs_needs_updated ( const stk::mesh::Entity & linker) const
inlineprotected