8 #ifndef OPENFPM_DATA_SRC_NN_CELLLIST_CELLNNITERATORRUNTIME_HPP_
9 #define OPENFPM_DATA_SRC_NN_CELLLIST_CELLNNITERATORRUNTIME_HPP_
11 #include "util/mathutil.hpp"
13 #define FULL openfpm::math::pow(3,dim)
14 #define SYM openfpm::math::pow(3,dim)/2 + 1
15 #define CRS openfpm::math::pow(2,dim)
35 template<
unsigned int dim,
typename Cell,
unsigned int impl>
41 const typename Cell::Mem_type_type::loc_index *
start_id;
44 const typename Cell::Mem_type_type::loc_index *
stop_id;
74 if (
NNc_id >= NNc_size)
return;
137 inline const typename Cell::Mem_type_type::loc_index &
get()
160 template<
unsigned int dim,
typename Cell,
unsigned int impl>
176 while (this->start_id < this->
stop_id)
179 for (
long int i = dim-1 ; i >= 0 ; i--)
181 if (
v.template get<0>(
p)[i] <
v.template get<0>(q)[i])
183 else if (
v.template get<0>(
p)[i] >
v.template get<0>(q)[i])
213 const long int *
NNc,
219 if (this->
NNc_id >= this->NNc_size)
CellNNIteratorSym(size_t cell, size_t p, const long int *NNc, size_t NNc_size, Cell &cl, const openfpm::vector< Point< dim, typename Cell::stype >> &v)
Cell NN iterator.
const long int cell
Center cell, or cell for witch we are searching the NN-cell.
size_t cell_id
actual cell id = NNc[NNc_id]+cell stored for performance reason
const long int * NNc
NN cell id.
const Cell::Mem_type_type::loc_index * stop_id
stop id to read the end of the cell
const openfpm::vector< Point< dim, typename Cell::stype > > & v
Position of the particle p.
bool isNext()
Check if there is the next element.
void selectValid()
Select non-empty cell.
const Cell::Mem_type_type::loc_index * stop_id
stop id to read the end of the cell
This class implement the point shape in an N-dimensional space.
CellNNIteratorSym< dim, Cell, RUNTIME, impl > & operator++()
take the next element
const Cell::Mem_type_type::loc_index * start_id
actual element id
Symmetric iterator for the neighborhood of the cell structures.
CellNNIterator(size_t cell, const long int *NNc, size_t NNc_size, Cell &cl)
Cell NN iterator.
size_t p
index of the particle p
const NNc_array< dim, NNc_size > & NNc
NN cell id.
size_t cell_id
actual cell id = NNc[NNc_id]+cell stored for performance reason
const openfpm::vector< Point< dim, typename Cell::stype > > & v
Position of the particle p.
const long int cell
Center cell, or cell for witch we are searching the NN-cell.
size_t NNc_size
Size of the neighboring cells.
size_t NNc_id
Actual NNc_id;.
size_t NNc_id
Actual NNc_id;.
Symmetric iterator for the neighborhood of the cell structures.
const Cell::Mem_type_type::loc_index * start_id
actual element id
CellNNIterator & operator++()
take the next element
void selectValid()
Select non-empty cell.
Implementation of 1-D std::vector like structure.
size_t p
index of the particle p
Iterator for the neighborhood of the cell structures.