8 #ifndef CELLLIST_CPU_KER_CUH_
9 #define CELLLIST_CPU_KER_CUH_
11 #include "Cuda_cell_list_util_func.hpp"
13 template<
unsigned int dim,
typename T,
typename Mem_type,
typename transform_type>
16 typedef typename Mem_type::local_index_type ids_type;
59 inline __device__
unsigned int getCell(
const Point<dim,T> & xp)
const
88 for (
size_t s = 1 ; s < dim ; s++)
110 for (
size_t s = 1 ; s < dim ; s++)
124 inline __device__
size_t ConvertToID(
const T (&x)[dim],
size_t s)
const
153 return Mem_type::getNelements(cell);
166 inline __device__
unsigned int get(
unsigned int cell,
unsigned int ele)
168 return Mem_type::get(cell,
ele);
This class represent an N-dimensional box.
Box< dim, T > cellListSpaceBox
Unit box of the Cell list.
__device__ size_t ConvertToID(const Point< dim, T > &x, size_t s, size_t sc=0) const
Convert the coordinates into id.
__device__ size_t ConvertToID(const T(&x)[dim], size_t s) const
Convert the coordinates into id.
const __device__ grid_sm< dim, void > & getGrid() const
Return the underlying grid information of the cell list.
openfpm::array< T, dim > spacing_c
Spacing.
__device__ int getNelements(unsigned int cell) const
Return the number of elements in the cell.
__device__ unsigned int get(unsigned int cell, unsigned int ele)
Get an element in the cell.
transform_type pointTransform
transformation
__device__ grid_key_dx< dim > getCellGrid(const T(&pos)[dim]) const
Get the cell-ids.
__device__ grid_key_dx< dim > getCellGrid(const Point< dim, T > &pos) const
Get the cell-ids.
grid_sm< dim, void > cellListGrid
Grid structure of the Cell list.
openfpm::array< ids_type, dim > off
cell padding
Point< dim, long int > cellShift
cellShift
openfpm::array< ids_type, dim > div_c
number of sub-divisions in each direction
__device__ __host__ const T & get(unsigned int i) const
Get coordinate.
__device__ __host__ void set_d(index_type i, index_type id)
Set the i index.
__device__ __host__ size_t size() const
Return the size of the grid.