Neighbor list implementation based on binning particles on a 3d Cartesian grid with cells of the same size as the interaction distance.
More...
|
| 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.
|
|
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
-
MemorySpace | The Kokkos memory space for storing the neighbor list. |
AlgorithmTag | Tag indicating whether to build a full or half neighbor list. |
LayoutTag | Tag indicating whether to use a CSR or 2D data layout. |
BuildTag | Tag 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.
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
-
x | The particle positions |
begin | The beginning particle index to compute neighbors for. |
end | The end particle index to compute neighbors for. |
neighborhood_radius | The radius of the neighborhood. Particles within this radius are considered neighbors. This is effectively the grid cell size in each dimension. |
cell_size_ratio | The 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_min | The minimum value of the grid containing the particles in each dimension. |
grid_max | The maximum value of the grid containing the particles in each dimension. |
max_neigh | Optional 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.
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
-
x | The slice containing the particle positions |
begin | The beginning particle index to compute neighbors for. |
end | The end particle index to compute neighbors for. |
background_radius | The radius of the neighborhood used for the background grid cells in each dimension. |
neighborhood_radius | The radius of the neighborhood per particle. Particles within this radius are considered neighbors. |
cell_size_ratio | The 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_min | The minimum value of the grid containing the particles in each dimension. |
grid_max | The maximum value of the grid containing the particles in each dimension. |
max_neigh | Optional 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.