8 #ifndef CELLNNITERATOR_FULL_HPP_
9 #define CELLNNITERATOR_FULL_HPP_
11 #include "util/mathutil.hpp"
12 #include "NN/CellList/NNc_array.hpp"
14 #define FULL openfpm::math::pow(3,dim)
15 #define SYM openfpm::math::pow(3,dim)/2 + 1
16 #define CRS openfpm::math::pow(2,dim)
35 template<
unsigned int dim,
typename Cell,
int NNc_size,
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;
71 if (
NNc_id >= NNc_size)
return;
133 inline const typename Cell::Mem_type_type::loc_index &
get()
143 inline const typename Cell::Mem_type_type::loc_index &
get()
const
181 while (this->start_id < this->
stop_id)
184 for (
long int i = dim-1 ; i >= 0 ; i--)
186 if (
v.template get<0>(
p)[i] <
v.template get<0>(q)[i])
188 else if (
v.template get<0>(
p)[i] >
v.template get<0>(q)[i])
272 while (this->start_id < this->
stop_id)
275 for (
long int i = dim-1 ; i >= 0 ; i--)
277 if (
v_p1.template get<0>(
p)[i] <
v_p2.template get<0>(q)[i])
279 else if (
v_p1.template get<0>(
p)[i] >
v_p2.template get<0>(q)[i])
361 :cl(cl),
ele_id(0),cell(cell)
392 inline typename Cell::value_type &
get()
402 inline const typename Cell::value_type &
get()
const
408 #include "CellNNIteratorRuntime.hpp"
const long int cell
Center cell, or cell for witch we are searching the NN-cell.
CellNNIteratorSymMP(size_t cell, size_t p, const NNc_array< dim, NNc_size > &NNc, Cell &cl, const openfpm::vector< Point< dim, typename Cell::stype >> &v_p1, const openfpm::vector< Point< dim, typename Cell::stype >> &v_p2)
Cell NN iterator.
CellNNIteratorSymMP< dim, Cell, NNc_size, impl > & operator++()
take the next element
const Cell::Mem_type_type::loc_index * stop_id
stop id to read the end of the cell
CellNNIterator & operator++()
take the next element
bool isNext()
Check if there is the next element.
const openfpm::vector< Point< dim, typename Cell::stype > > & v_p1
Phase vector for particle p.
size_t ele_id
actual element id inside the cell
This class implement the point shape in an N-dimensional space.
CellIterator(const size_t cell, Cell &cl)
Cell iterator.
Symmetric iterator for the neighborhood of the cell structures.
Symmetric iterator for the neighborhood of the cell structures.
size_t p
index of the particle p
CellIterator & operator++()
take the next neoghborhood particle
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.
it iterate through the elements of a cell
size_t NNc_id
Actual NNc_id;.
bool isNext()
Check if there is the next element.
size_t p
index of the particle p
CellNNIteratorSym< dim, Cell, NNc_size, impl > & operator++()
take the next element
const Cell::Mem_type_type::loc_index * start_id
actual element id
const long int cell
selected cell
CellNNIterator(size_t cell, const NNc_array< dim, NNc_size > &NNc, Cell &cl)
Cell NN iterator.
void selectValid()
Select non-empty cell.
Implementation of 1-D std::vector like structure.
Iterator for the neighborhood of the cell structures.
const openfpm::vector< Point< dim, typename Cell::stype > > & v_p2
Phase vector for particle q.
CellNNIteratorSym(size_t cell, size_t p, const NNc_array< dim, NNc_size > &NNc, Cell &cl, const openfpm::vector< Point< dim, typename Cell::stype >> &v)
Cell NN iterator.