8 #ifndef CELLDECOMPOSER_GPU_KER_HPP_
9 #define CELLDECOMPOSER_GPU_KER_HPP_
11 #include "util/cuda_util.hpp"
12 #include "util/multi_array_openfpm/array_openfpm.hpp"
13 #include "Grid/grid_sm.hpp"
14 #include "NN/CellList/cuda/Cuda_cell_list_util_func.hpp"
15 #include "NN/CellList/CellDecomposer.hpp"
17 template <
unsigned int dim,
typename T,
typename ids_type,
typename transform_type>
77 for (
size_t i = 0 ; i < dim ; i++)
83 __device__ __host__
void getGridSize(
size_t (& sz)[dim])
const
85 for (
size_t i = 0 ; i < dim ; i++)
89 template<
typename ids_type2>
93 for (mem_id i = 1 ; i < dim ; i++)
124 __device__ __host__
inline const transform_type & get_t()
const
129 __device__ __host__
inline grid_key_dx<dim> getCellGrid(
const T (& pos)[dim])
const
132 key.
set_d(0,ConvertToID(pos,0));
134 for (
size_t s = 1 ; s < dim ; s++)
135 key.
set_d(s,ConvertToID(pos,s));
143 key.
set_d(0,ConvertToID(pos,0));
145 for (
size_t s = 1 ; s < dim ; s++)
146 key.
set_d(s,ConvertToID(pos,s));
151 __device__ __host__
inline size_t ConvertToID(
const T (&x)[dim] ,
size_t s)
const
158 __device__ __host__
inline size_t ConvertToID(
const Point<dim,T> & x ,
size_t s,
size_t sc = 0)
const
This class represent an N-dimensional box.
Box< dim, T > cellListSpaceBox
Unit box of the Cell list.
openfpm::array< ids_type, dim > cellPadDim
cell offset
openfpm::array< T, dim > unitCellP2
Spacing.
transform_type pointTransform
transformation
openfpm::array< ids_type, dim > numCellDiv
number of sub-divisions in each direction
Point< dim, long int > cellShift
cellShift
grid_sm< dim, void > cellListGrid
Grid structure of the Cell list.
__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__ index_type get(index_type i) const
Get the i index.
__device__ __host__ size_t size() const
Return the size of the grid.