Cabana 0.8.0-dev
 
Loading...
Searching...
No Matches
Cabana::VerletList< MemorySpace, AlgorithmTag, LayoutTag, BuildTag > Class Template Reference

Neighbor list implementation based on binning particles on a 3d Cartesian grid with cells of the same size as the interaction distance. More...

#include <Cabana_VerletList.hpp>

Collaboration diagram for Cabana::VerletList< MemorySpace, AlgorithmTag, LayoutTag, BuildTag >:

Public Types

using memory_space = MemorySpace
 Kokkos memory space in which the neighbor list data resides.
 
using execution_space = typename memory_space::execution_space
 Kokkos default execution space for this memory space.
 

Public Member Functions

 VerletList ()
 Default constructor.
 
template<class PositionType>
 VerletList (PositionType x, const std::size_t begin, const std::size_t end, const typename PositionType::value_type neighborhood_radius, const typename PositionType::value_type cell_size_ratio, const typename PositionType::value_type grid_min[3], const typename PositionType::value_type grid_max[3], const std::size_t max_neigh=0, typename std::enable_if<(is_slice< PositionType >::value||Kokkos::is_view< PositionType >::value), int >::type *=0)
 VerletList constructor. Given a list of particle positions and a neighborhood radius calculate the neighbor list.
 
template<class PositionSlice, class RadiusSlice>
 VerletList (PositionSlice x, const std::size_t begin, const std::size_t end, const typename PositionSlice::value_type background_radius, RadiusSlice neighborhood_radius, const typename PositionSlice::value_type cell_size_ratio, const typename PositionSlice::value_type grid_min[3], const typename PositionSlice::value_type grid_max[3], const std::size_t max_neigh=0, typename std::enable_if<(is_slice< PositionSlice >::value), int >::type *=0)
 VerletList constructor. Given a list of particle positions and a neighborhood radius calculate the neighbor list.
 
template<class PositionType>
void build (PositionType x, const std::size_t begin, const std::size_t end, const typename PositionType::value_type neighborhood_radius, const typename PositionType::value_type cell_size_ratio, const typename PositionType::value_type grid_min[3], const typename PositionType::value_type grid_max[3], const std::size_t max_neigh=0, typename std::enable_if<(is_slice< PositionType >::value||Kokkos::is_view< PositionType >::value), int >::type *=0)
 Given a list of particle positions and a neighborhood radius calculate the neighbor list.
 
template<class PositionType, class ExecutionSpace>
void build (ExecutionSpace, PositionType x, const std::size_t begin, const std::size_t end, const typename PositionType::value_type neighborhood_radius, const typename PositionType::value_type cell_size_ratio, const typename PositionType::value_type grid_min[3], const typename PositionType::value_type grid_max[3], const std::size_t max_neigh=0, typename std::enable_if<(is_slice< PositionType >::value||Kokkos::is_view< PositionType >::value), int >::type *=0)
 Given a list of particle positions and a neighborhood radius calculate the neighbor list.
 
template<class PositionSlice, class RadiusSlice>
void build (PositionSlice x, const std::size_t begin, const std::size_t end, const typename PositionSlice::value_type background_radius, RadiusSlice neighborhood_radius, const typename PositionSlice::value_type cell_size_ratio, const typename PositionSlice::value_type grid_min[3], const typename PositionSlice::value_type grid_max[3], const std::size_t max_neigh=0)
 Given a list of particle positions and a neighborhood radius calculate the neighbor list.
 
template<class PositionSlice, class RadiusSlice, class ExecutionSpace>
void build (ExecutionSpace, PositionSlice x, const std::size_t begin, const std::size_t end, const typename PositionSlice::value_type background_radius, RadiusSlice neighborhood_radius, const typename PositionSlice::value_type cell_size_ratio, const typename PositionSlice::value_type grid_min[3], const typename PositionSlice::value_type grid_max[3], const std::size_t max_neigh=0)
 Given a list of particle positions and a neighborhood radius calculate the neighbor list.
 
KOKKOS_INLINE_FUNCTION void setNeighbor (const std::size_t particle_index, const std::size_t neighbor_index, const int new_index) const
 Modify a neighbor in the list; for example, mark it as a broken bond.
 

Public Attributes

VerletListData< memory_space, LayoutTag > _data
 Verlet list data.
 

Detailed Description

template<class MemorySpace, class AlgorithmTag, class LayoutTag, class BuildTag = TeamVectorOpTag>
class Cabana::VerletList< MemorySpace, AlgorithmTag, LayoutTag, BuildTag >

Neighbor list implementation based on binning particles on a 3d Cartesian grid with cells of the same size as the interaction distance.

Template Parameters
MemorySpaceThe Kokkos memory space for storing the neighbor list.
AlgorithmTagTag indicating whether to build a full or half neighbor list.
LayoutTagTag indicating whether to use a CSR or 2D data layout.
BuildTagTag indicating whether to use hierarchical team or team vector parallelism when building neighbor lists.

Neighbor list implementation most appropriate for somewhat regularly distributed particles due to the use of a Cartesian grid.

Constructor & Destructor Documentation

◆ VerletList() [1/2]

template<class MemorySpace, class AlgorithmTag, class LayoutTag, class BuildTag = TeamVectorOpTag>
template<class PositionType>
Cabana::VerletList< MemorySpace, AlgorithmTag, LayoutTag, BuildTag >::VerletList ( PositionType x,
const std::size_t begin,
const std::size_t end,
const typename PositionType::value_type neighborhood_radius,
const typename PositionType::value_type cell_size_ratio,
const typename PositionType::value_type grid_min[3],
const typename PositionType::value_type grid_max[3],
const std::size_t max_neigh = 0,
typename std::enable_if<(is_slice< PositionType >::value||Kokkos::is_view< PositionType >::value), int >::type * = 0 )
inline

VerletList constructor. Given a list of particle positions and a neighborhood radius calculate the neighbor list.

Parameters
xThe particle positions
beginThe beginning particle index to compute neighbors for.
endThe end particle index to compute neighbors for.
neighborhood_radiusThe radius of the neighborhood. Particles within this radius are considered neighbors. This is effectively the grid cell size in each dimension.
cell_size_ratioThe ratio of the cell size in the Cartesian grid to the neighborhood radius. For example, if the cell size ratio is 0.5 then the cells will be half the size of the neighborhood radius in each dimension.
grid_minThe minimum value of the grid containing the particles in each dimension.
grid_maxThe maximum value of the grid containing the particles in each dimension.
max_neighOptional maximum number of neighbors per particle to pre-allocate the neighbor list. Potentially avoids recounting with 2D layout only.

Particles outside of the neighborhood radius will not be considered neighbors. Only compute the neighbors of those that are within the given range. All particles are candidates for being a neighbor, regardless of whether or not they are in the range.

◆ VerletList() [2/2]

template<class MemorySpace, class AlgorithmTag, class LayoutTag, class BuildTag = TeamVectorOpTag>
template<class PositionSlice, class RadiusSlice>
Cabana::VerletList< MemorySpace, AlgorithmTag, LayoutTag, BuildTag >::VerletList ( PositionSlice x,
const std::size_t begin,
const std::size_t end,
const typename PositionSlice::value_type background_radius,
RadiusSlice neighborhood_radius,
const typename PositionSlice::value_type cell_size_ratio,
const typename PositionSlice::value_type grid_min[3],
const typename PositionSlice::value_type grid_max[3],
const std::size_t max_neigh = 0,
typename std::enable_if<(is_slice< PositionSlice >::value), int >::type * = 0 )
inline

VerletList constructor. Given a list of particle positions and a neighborhood radius calculate the neighbor list.

Parameters
xThe slice containing the particle positions
beginThe beginning particle index to compute neighbors for.
endThe end particle index to compute neighbors for.
background_radiusThe radius of the neighborhood used for the background grid cells in each dimension.
neighborhood_radiusThe radius of the neighborhood per particle. Particles within this radius are considered neighbors.
cell_size_ratioThe ratio of the cell size in the Cartesian grid to the neighborhood radius. For example, if the cell size ratio is 0.5 then the cells will be half the size of the neighborhood radius in each dimension.
grid_minThe minimum value of the grid containing the particles in each dimension.
grid_maxThe maximum value of the grid containing the particles in each dimension.
max_neighOptional maximum number of neighbors per particle to pre-allocate the neighbor list. Potentially avoids recounting with 2D layout only.

Particles outside of the neighborhood radius will not be considered neighbors. Only compute the neighbors of those that are within the given range. All particles are candidates for being a neighbor, regardless of whether or not they are in the range.


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