Compadre  1.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Types | Protected Attributes | List of all members
Compadre::NeighborLists< view_type > Class Template Reference

NeighborLists assists in accessing entries of compressed row neighborhood lists. More...

Detailed Description

template<typename view_type>
class Compadre::NeighborLists< view_type >

NeighborLists assists in accessing entries of compressed row neighborhood lists.

Definition at line 11 of file Compadre_NeighborLists.hpp.

#include <Compadre_NeighborLists.hpp>

Public Types

typedef view_type internal_view_type
 
typedef Kokkos::View
< global_index_type
*, typename
view_type::array_layout,
typename
view_type::memory_space,
typename
view_type::memory_traits > 
internal_row_offsets_view_type
 

Public Member Functions

Constructors

Ways to initialize a NeighborLists object

 NeighborLists ()
 Constructor for the purpose of classes who have NeighborLists as a member object. More...
 
 NeighborLists (view_type cr_neighbor_lists, view_type number_of_neighbors_list, internal_row_offsets_view_type neighbor_lists_row_offsets, bool compute_max=true)
 Constructor for when compressed row cr_neighbor_lists is preallocated/populated, number_of_neighbors_list and neighbor_lists_row_offsets have already been populated. More...
 
 NeighborLists (view_type cr_neighbor_lists, view_type number_of_neighbors_list)
 Constructor for when compressed row cr_neighbor_lists is preallocated/populated, and number_of_neighbors_list is already populated, and row offsets still need to be computed. More...
 
 NeighborLists (view_type number_of_neighbors_list)
 Constructor for when number_of_neighbors_list is already populated. Will allocate space for compressed row neighbor lists data, and will allocate then populate information for row offsets. More...
 
Public modifiers
KOKKOS_INLINE_FUNCTION void setNeighborDevice (int target_index, int neighbor_num, int new_value)
 Setter function for N(i,j) indexing where N(i,j) is the index of the jth neighbor of i. More...
 
void computeMaxNumNeighbors ()
 Calculate the maximum number of neighbors of all targets' neighborhoods (host) More...
 
void computeRowOffsets ()
 Calculate the row offsets for each target's neighborhood (host) More...
 
void copyDeviceDataToHost ()
 Sync the host from the device (copy device data to host) More...
 
view_type getNeighborLists ()
 Device view into neighbor lists data (use with caution) More...
 
Public accessors
KOKKOS_INLINE_FUNCTION int getNumberOfTargets () const
 Get number of total targets having neighborhoods (host/device). More...
 
int getNumberOfNeighborsHost (int target_index) const
 Get number of neighbors for a given target (host) More...
 
KOKKOS_INLINE_FUNCTION int getNumberOfNeighborsDevice (int target_index) const
 Get number of neighbors for a given target (device) More...
 
global_index_type getRowOffsetHost (int target_index) const
 Get offset into compressed row neighbor lists (host) More...
 
KOKKOS_INLINE_FUNCTION
global_index_type 
getRowOffsetDevice (int target_index) const
 Get offset into compressed row neighbor lists (device) More...
 
int getNeighborHost (int target_index, int neighbor_num) const
 Offers N(i,j) indexing where N(i,j) is the index of the jth neighbor of i (host) More...
 
KOKKOS_INLINE_FUNCTION int getNeighborDevice (int target_index, int neighbor_num) const
 Offers N(i,j) indexing where N(i,j) is the index of the jth neighbor of i (device) More...
 
KOKKOS_INLINE_FUNCTION int getMaxNumNeighbors () const
 Get the maximum number of neighbors of all targets' neighborhoods (host/device) More...
 
global_index_type getTotalNeighborsOverAllListsHost () const
 Get the sum of the number of neighbors of all targets' neighborhoods (host) More...
 
KOKKOS_INLINE_FUNCTION
global_index_type 
getTotalNeighborsOverAllListsDevice () const
 Get the sum of the number of neighbors of all targets' neighborhoods (device) More...
 

Protected Attributes

int _max_neighbor_list_row_storage_size
 
bool _needs_sync_to_host
 
int _number_of_targets
 
internal_row_offsets_view_type _row_offsets
 
view_type _cr_neighbor_lists
 
view_type _number_of_neighbors_list
 
internal_row_offsets_view_type::HostMirror _host_row_offsets
 
view_type::HostMirror _host_cr_neighbor_lists
 
view_type::HostMirror _host_number_of_neighbors_list
 

Member Typedef Documentation

template<typename view_type>
typedef Kokkos::View<global_index_type*, typename view_type::array_layout, typename view_type::memory_space, typename view_type::memory_traits> Compadre::NeighborLists< view_type >::internal_row_offsets_view_type

Definition at line 16 of file Compadre_NeighborLists.hpp.

template<typename view_type>
typedef view_type Compadre::NeighborLists< view_type >::internal_view_type

Definition at line 14 of file Compadre_NeighborLists.hpp.

Constructor & Destructor Documentation

template<typename view_type>
Compadre::NeighborLists< view_type >::NeighborLists ( )
inline

Constructor for the purpose of classes who have NeighborLists as a member object.

Definition at line 42 of file Compadre_NeighborLists.hpp.

template<typename view_type>
Compadre::NeighborLists< view_type >::NeighborLists ( view_type  cr_neighbor_lists,
view_type  number_of_neighbors_list,
internal_row_offsets_view_type  neighbor_lists_row_offsets,
bool  compute_max = true 
)
inline

Constructor for when compressed row cr_neighbor_lists is preallocated/populated, number_of_neighbors_list and neighbor_lists_row_offsets have already been populated.

Definition at line 51 of file Compadre_NeighborLists.hpp.

template<typename view_type>
Compadre::NeighborLists< view_type >::NeighborLists ( view_type  cr_neighbor_lists,
view_type  number_of_neighbors_list 
)
inline

Constructor for when compressed row cr_neighbor_lists is preallocated/populated, and number_of_neighbors_list is already populated, and row offsets still need to be computed.

Definition at line 86 of file Compadre_NeighborLists.hpp.

template<typename view_type>
Compadre::NeighborLists< view_type >::NeighborLists ( view_type  number_of_neighbors_list)
inline

Constructor for when number_of_neighbors_list is already populated. Will allocate space for compressed row neighbor lists data, and will allocate then populate information for row offsets.

Definition at line 119 of file Compadre_NeighborLists.hpp.

Member Function Documentation

template<typename view_type>
void Compadre::NeighborLists< view_type >::computeMaxNumNeighbors ( )
inline

Calculate the maximum number of neighbors of all targets' neighborhoods (host)

Definition at line 160 of file Compadre_NeighborLists.hpp.

template<typename view_type>
void Compadre::NeighborLists< view_type >::computeRowOffsets ( )
inline

Calculate the row offsets for each target's neighborhood (host)

Definition at line 172 of file Compadre_NeighborLists.hpp.

template<typename view_type>
void Compadre::NeighborLists< view_type >::copyDeviceDataToHost ( )
inline

Sync the host from the device (copy device data to host)

Definition at line 186 of file Compadre_NeighborLists.hpp.

template<typename view_type>
KOKKOS_INLINE_FUNCTION int Compadre::NeighborLists< view_type >::getMaxNumNeighbors ( ) const
inline

Get the maximum number of neighbors of all targets' neighborhoods (host/device)

Definition at line 246 of file Compadre_NeighborLists.hpp.

template<typename view_type>
KOKKOS_INLINE_FUNCTION int Compadre::NeighborLists< view_type >::getNeighborDevice ( int  target_index,
int  neighbor_num 
) const
inline

Offers N(i,j) indexing where N(i,j) is the index of the jth neighbor of i (device)

Definition at line 240 of file Compadre_NeighborLists.hpp.

template<typename view_type>
int Compadre::NeighborLists< view_type >::getNeighborHost ( int  target_index,
int  neighbor_num 
) const
inline

Offers N(i,j) indexing where N(i,j) is the index of the jth neighbor of i (host)

Definition at line 230 of file Compadre_NeighborLists.hpp.

template<typename view_type>
view_type Compadre::NeighborLists< view_type >::getNeighborLists ( )
inline

Device view into neighbor lists data (use with caution)

Definition at line 193 of file Compadre_NeighborLists.hpp.

template<typename view_type>
KOKKOS_INLINE_FUNCTION int Compadre::NeighborLists< view_type >::getNumberOfNeighborsDevice ( int  target_index) const
inline

Get number of neighbors for a given target (device)

Definition at line 214 of file Compadre_NeighborLists.hpp.

template<typename view_type>
int Compadre::NeighborLists< view_type >::getNumberOfNeighborsHost ( int  target_index) const
inline

Get number of neighbors for a given target (host)

Definition at line 208 of file Compadre_NeighborLists.hpp.

template<typename view_type>
KOKKOS_INLINE_FUNCTION int Compadre::NeighborLists< view_type >::getNumberOfTargets ( ) const
inline

Get number of total targets having neighborhoods (host/device).

Definition at line 203 of file Compadre_NeighborLists.hpp.

template<typename view_type>
KOKKOS_INLINE_FUNCTION global_index_type Compadre::NeighborLists< view_type >::getRowOffsetDevice ( int  target_index) const
inline

Get offset into compressed row neighbor lists (device)

Definition at line 225 of file Compadre_NeighborLists.hpp.

template<typename view_type>
global_index_type Compadre::NeighborLists< view_type >::getRowOffsetHost ( int  target_index) const
inline

Get offset into compressed row neighbor lists (host)

Definition at line 219 of file Compadre_NeighborLists.hpp.

template<typename view_type>
KOKKOS_INLINE_FUNCTION global_index_type Compadre::NeighborLists< view_type >::getTotalNeighborsOverAllListsDevice ( ) const
inline

Get the sum of the number of neighbors of all targets' neighborhoods (device)

Definition at line 258 of file Compadre_NeighborLists.hpp.

template<typename view_type>
global_index_type Compadre::NeighborLists< view_type >::getTotalNeighborsOverAllListsHost ( ) const
inline

Get the sum of the number of neighbors of all targets' neighborhoods (host)

Definition at line 252 of file Compadre_NeighborLists.hpp.

template<typename view_type>
KOKKOS_INLINE_FUNCTION void Compadre::NeighborLists< view_type >::setNeighborDevice ( int  target_index,
int  neighbor_num,
int  new_value 
)
inline

Setter function for N(i,j) indexing where N(i,j) is the index of the jth neighbor of i.

Definition at line 153 of file Compadre_NeighborLists.hpp.

Member Data Documentation

template<typename view_type>
view_type Compadre::NeighborLists< view_type >::_cr_neighbor_lists
protected

Definition at line 26 of file Compadre_NeighborLists.hpp.

template<typename view_type>
view_type::HostMirror Compadre::NeighborLists< view_type >::_host_cr_neighbor_lists
protected

Definition at line 30 of file Compadre_NeighborLists.hpp.

template<typename view_type>
view_type::HostMirror Compadre::NeighborLists< view_type >::_host_number_of_neighbors_list
protected

Definition at line 31 of file Compadre_NeighborLists.hpp.

template<typename view_type>
internal_row_offsets_view_type::HostMirror Compadre::NeighborLists< view_type >::_host_row_offsets
protected

Definition at line 29 of file Compadre_NeighborLists.hpp.

template<typename view_type>
int Compadre::NeighborLists< view_type >::_max_neighbor_list_row_storage_size
protected

Definition at line 21 of file Compadre_NeighborLists.hpp.

template<typename view_type>
bool Compadre::NeighborLists< view_type >::_needs_sync_to_host
protected

Definition at line 22 of file Compadre_NeighborLists.hpp.

template<typename view_type>
view_type Compadre::NeighborLists< view_type >::_number_of_neighbors_list
protected

Definition at line 27 of file Compadre_NeighborLists.hpp.

template<typename view_type>
int Compadre::NeighborLists< view_type >::_number_of_targets
protected

Definition at line 23 of file Compadre_NeighborLists.hpp.

template<typename view_type>
internal_row_offsets_view_type Compadre::NeighborLists< view_type >::_row_offsets
protected

Definition at line 25 of file Compadre_NeighborLists.hpp.


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