8#ifndef CELLLIST_CPU_KER_CUH_
9#define CELLLIST_CPU_KER_CUH_
11#include "Cuda_cell_list_util_func.hpp"
13template<
unsigned int dim,
typename T,
typename Mem_type,
typename transform>
16 typedef typename Mem_type::local_index_type cnt_type;
18 typedef typename Mem_type::local_index_type ids_type;
54 inline __device__
unsigned int getCell(
const Point<dim,T> & xp)
const
83 for (
size_t s = 1 ; s < dim ; s++)
105 for (
size_t s = 1 ; s < dim ; s++)
119 inline __device__
size_t ConvertToID(
const T (&x)[dim],
size_t s)
const
121 size_t id = openfpm::math::size_t_floor(
t.transform(x,s) /
box_unit.getHigh(s)) +
off[s];
134 size_t id = openfpm::math::size_t_floor(
t.transform(x,s) /
box_unit.getHigh(s)) +
off[s];
148 return Mem_type::getNelements(cell);
161 inline __device__
unsigned int get(
unsigned int cell,
unsigned int ele)
163 return Mem_type::get(cell,
ele);
This class represent an N-dimensional box.
openfpm::array< T, dim, cnt_type > spacing_c
Spacing.
__device__ grid_key_dx< dim > getCellGrid(const T(&pos)[dim]) const
Get the cell-ids.
__device__ unsigned int get(unsigned int cell, unsigned int ele)
Get an element in the cell.
__device__ size_t ConvertToID(const Point< dim, T > &x, size_t s, size_t sc=0) const
Convert the coordinates into id.
__device__ int getNelements(unsigned int cell) const
Return the number of elements in the cell.
Box< dim, T > box_unit
Unit box of the Cell list.
Point< dim, long int > cell_shift
cell_shift
__device__ grid_key_dx< dim > getCellGrid(const Point< dim, T > &pos) const
Get the cell-ids.
openfpm::array< ids_type, dim, cnt_type > off
cell padding
__device__ size_t ConvertToID(const T(&x)[dim], size_t s) const
Convert the coordinates into id.
openfpm::array< ids_type, dim, cnt_type > div_c
number of sub-divisions in each direction
const __device__ grid_sm< dim, void > & getGrid() const
Return the underlying grid information of the cell list.
grid_sm< dim, void > gr_cell
Grid structure of the Cell list.
transform t
transformation
This class implement the point shape in an N-dimensional space.
__device__ __host__ const T & get(unsigned int i) const
Get coordinate.
grid_key_dx is the key to access any element in the grid
__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.