8#ifndef CELLDECOMPOSER_GPU_KER_HPP_
9#define CELLDECOMPOSER_GPU_KER_HPP_
11#include "util/cuda_launch.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"
17template <
unsigned int dim,
typename T,
typename cnt_type,
typename ids_type,
typename transform>
69 for (
size_t i = 0 ; i < dim ; i++)
77 __device__ __host__
void getGridSize(
size_t (& sz)[dim])
const
79 for (
size_t i = 0 ; i < dim ; i++)
85 template<
typename ids_type2>
89 for (mem_id i = 1 ; i < dim ; i++)
122 __device__ __host__
inline const transform & get_t()
const
127 __device__ __host__
inline grid_key_dx<dim> getCellGrid(
const T (& pos)[dim])
const
130 key.
set_d(0,ConvertToID(pos,0));
132 for (
size_t s = 1 ; s < dim ; s++)
134 key.
set_d(s,ConvertToID(pos,s));
143 key.
set_d(0,ConvertToID(pos,0));
145 for (
size_t s = 1 ; s < dim ; s++)
147 key.
set_d(s,ConvertToID(pos,s));
153 __device__ __host__
inline size_t ConvertToID(
const T (&x)[dim] ,
size_t s)
const
155 size_t id = openfpm::math::size_t_floor(
t.transform(x,s) /
box_unit.getHigh(s)) +
off[s];
160 __device__ __host__
inline size_t ConvertToID(
const Point<dim,T> & x ,
size_t s,
size_t sc = 0)
const
162 size_t id = openfpm::math::size_t_floor(
t.transform(x,s) /
box_unit.getHigh(s)) +
off[s];
openfpm::array< T, dim, cnt_type > spacing_c
Spacing.
grid_sm< dim, void > gr_cell
Grid structure of the Cell list.
Point< dim, long int > cell_shift
cell_shift
transform t
transformation
openfpm::array< ids_type, dim, cnt_type > div_c
number of sub-divisions in each direction
SpaceBox< dim, T > box_unit
Unit box of the Cell list.
openfpm::array< ids_type, dim, cnt_type > off
cell offset
This class implement the point shape in an N-dimensional space.
__device__ __host__ const T & get(unsigned int i) const
Get coordinate.
This class represent an N-dimensional box.
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.