8 #ifndef OPENFPM_DATA_SRC_NN_CELLLIST_PROCKEYS_HPP_
9 #define OPENFPM_DATA_SRC_NN_CELLLIST_PROCKEYS_HPP_
13 #include "hilbertKey.h"
20 template<
unsigned int dim>
49 for (
size_t i = 0; i < dim; i++)
51 point[i] = gridKey.
get(i) + cellList.getPadding(i);
54 keys.add(cellList.getGrid().LinIdPtr(
static_cast<size_t *
>(point)));
57 template<
typename CellList_type>
void linearize_hkeys(CellList_type & cellList,
size_t m)
67 template<
unsigned int dim>
102 for (
size_t i = 0; i < dim; i++)
104 point[i] = gridKey.
get(i);
107 size_t hkey = getHKeyFromIntCoord(
m, dim, point, &err);
119 template<
typename CellList_type>
inline void linearize_hkeys(CellList_type & cellList,
size_t m)
132 for(
size_t i = 0; i <
keys.
size(); i++)
134 getIntCoordFromHKey(coord,
m, dim,
keys.get(i), &err);
136 for (
size_t j = 0 ; j < dim ; j++) {coord2[j] = coord[j] + cellList.getPadding(j);}
138 keys_new.add(cellList.getGrid().LinIdPtr(
static_cast<size_t *
>(coord2)));
149 template<
unsigned int dim>
181 for (
size_t i = 0; i < dim; i++)
183 point[i] = gridKey.
get(i);
186 size_t hkey = cellList.getGrid().LinId(gridKey);
198 template<
typename CellList_type>
inline void linearize_hkeys(CellList_type & cellList,
size_t m)
Class for an hilbert order processing of cell keys for CellList implementation.
void get_hkey(CellList_type &cellList, grid_key_dx< dim > gridKey, size_t m)
Get an hilbert key from the coordinates and add to the getKeys vector.
void linearize_hkeys(CellList_type &cellList, size_t m)
Get get the coordinates from hilbert key, linearize and add to the getKeys vector.
openfpm::vector< size_t > keys
vector for storing the cell keys
size_t m
Order of an hilbert curve.
const openfpm::vector< size_t > & getKeys() const
Return cellkeys vector.
Class for an hilbert order processing of cell keys for CellList implementation.
void get_hkey(CellList_type &cellList, grid_key_dx< dim > gridKey, size_t m)
Get an hilbert key from the coordinates and add to the getKeys vector.
void linearize_hkeys(CellList_type &cellList, size_t m)
Get get the coordinates from hilbert key, linearize and add to the getKeys vector.
const openfpm::vector< size_t > & getKeys() const
Return cellkeys vector.
openfpm::vector< size_t > keys
vector for storing the cell keys
size_t m
Order of an hilbert curve.
void get_hkey(CellList_type &cellList, grid_key_dx< dim > gridKey, size_t m)
Get a linear (1D-like) key from the coordinates and add to the getKeys vector.
const openfpm::vector< size_t > & getKeys() const
Return cellkeys vector.
openfpm::vector< size_t > keys
stub object
__device__ __host__ index_type get(index_type i) const
Get the i index.