8#ifndef OPENFPM_DATA_SRC_NN_CELLLIST_PROCKEYS_HPP_
9#define OPENFPM_DATA_SRC_NN_CELLLIST_PROCKEYS_HPP_
13#include "hilbertKey.h"
20template<
unsigned int dim,
typename CellList>
53 for (
size_t i = 0; i < dim; i++)
55 point[i] = gk.
get(i) + obj.getPadding(i);
58 keys.add(obj.getGrid().LinIdPtr(
static_cast<size_t *
>(point)));
61 template<
typename S>
void linearize_hkeys(S & obj,
size_t m)
71template<
unsigned int dim,
typename CellList>
113 for (
size_t i = 0; i < dim; i++)
115 point[i] = gk.
get(i);
118 size_t hkey = getHKeyFromIntCoord(
m, dim, point, &err);
143 for(
size_t i = 0; i < obj.getKeys().size(); i++)
145 getIntCoordFromHKey(coord,
m, dim, obj.getKeys().get(i), &err);
147 for (
size_t j = 0 ; j < dim ; j++) {coord2[j] = coord[j] + obj.getPadding(j);}
149 keys_new.add(obj.getGrid().LinIdPtr(
static_cast<size_t *
>(coord2)));
160template<
unsigned int dim,
typename CellList>
199 for (
size_t i = 0; i < dim; i++)
201 point[i] = gk.
get(i);
204 size_t hkey = obj.getGrid().LinId(gk);
Class for an hilbert order processing of cell keys for CellList_gen implementation.
openfpm::vector< size_t > p_keys
vector for storing the particle keys
size_t m
Order of an hilbert curve.
openfpm::vector< size_t > keys
vector for storing the cell keys
void linearize_hkeys(S &obj, size_t m)
Get get the coordinates from hilbert key, linearize and add to the getKeys vector.
ParticleIt_CellP< CellList > Pit
Particle Iterator produced by this key generator.
void get_hkey(S &obj, grid_key_dx< dim > gk, size_t m)
Get an hilbert key from the coordinates and add to the getKeys vector.
const openfpm::vector< size_t > & getKeys() const
Return cellkeys vector.
Class for an hilbert order processing of cell keys for CellList_gen implementation.
const openfpm::vector< size_t > & getKeys() const
Return cellkeys vector.
openfpm::vector< size_t > p_keys
vector for storing the particle keys
void get_hkey(S &obj, grid_key_dx< dim > gk, size_t m)
Get an hilbert key from the coordinates and add to the getKeys vector.
ParticleIt_CellP< CellList > Pit
Particle Iterator produced by this key generator.
openfpm::vector< size_t > keys
vector for storing the cell keys
size_t m
Order of an hilbert curve.
void linearize_hkeys(S &obj, size_t m)
Get get the coordinates from hilbert key, linearize and add to the getKeys vector.
openfpm::vector< size_t > keys
stub object
void get_hkey(S &obj, grid_key_dx< dim > gk, 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.
ParticleIt_CellP< CellList > Pit
Particle Iterator produced by this key generator.
grid_key_dx is the key to access any element in the grid
__device__ __host__ index_type get(index_type i) const
Get the i index.
Implementation of 1-D std::vector like structure.