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)
32 template<
unsigned int dim,
typename Cell,
int NNc_size>
38 const typename Cell::Mem_type_type::local_index_type *
start_id;
41 const typename Cell::Mem_type_type::local_index_type *
stop_id;
68 if (
NNc_id >= NNc_size)
return;
130 __attribute__((always_inline))
inline const typename Cell::Mem_type_type::local_index_type & get()
140 __attribute__((always_inline))
inline const typename Cell::Mem_type_type::local_index_type & get()
const
162 template<
unsigned int dim,
typename Cell,
typename vector_pos_type,
int NNc_size>
169 const vector_pos_type &
v;
172 const typename Cell::Mem_type_type::local_index_type *
start_id;
175 const typename Cell::Mem_type_type::local_index_type *
stop_id;
202 for (
long int i = dim-1 ; i >= 0 ; i--)
204 if (
v.template get<0>(
p)[i] <
v.template get<0>(q)[i])
206 else if (
v.template get<0>(
p)[i] >
v.template get<0>(q)[i])
229 if (++
NNc_id >= NNc_size)
return;
250 __attribute__((always_inline))
inline const typename Cell::Mem_type_type::local_index_type & get()
260 __attribute__((always_inline))
inline const typename Cell::Mem_type_type::local_index_type & get()
const
278 const vector_pos_type &
v)
337 template<
unsigned int dim,
typename Cell,
typename vector_pos_type,
int NNc_size>
344 const vector_pos_type &
v;
351 if (this->NNc[this->NNc_id] == 0)
353 while (this->start_id < this->
stop_id)
355 size_t q = this->cl.get_lin(this->start_id);
356 for (
long int i = dim-1 ; i >= 0 ; i--)
358 if (
v.template get<0>(
p)[i] <
v.template get<0>(q)[i])
360 else if (
v.template get<0>(
p)[i] >
v.template get<0>(q)[i])
425 template<
unsigned int dim,
typename Cell,
typename vector_pos_type ,
int NNc_size>
442 if (this->NNc[this->NNc_id] == 0)
444 while (this->start_id < this->
stop_id)
446 size_t q = this->cl.get_lin(this->start_id);
447 for (
long int i = dim-1 ; i >= 0 ; i--)
449 if (
v_p1.template get<0>(
p)[i] <
v_p2.template get<0>(q)[i])
451 else if (
v_p1.template get<0>(
p)[i] >
v_p2.template get<0>(q)[i])
483 const vector_pos_type &
v_p1,
484 const vector_pos_type &
v_p2)
574 __attribute__((always_inline))
inline const typename Cell::value_type & get()
const
580 #include "NN/CellList/CellNNIteratorRuntime.hpp"
it iterate through the elements of a cell
__attribute__((always_inline)) inline bool isNext()
Check if there is the next element.
__attribute__((always_inline)) inline CellIterator(const size_t cell
Cell iterator.
__attribute__((always_inline)) inline CellIterator &operator++()
take the next neoghborhood particle
const long int cell
selected cell
__attribute__((always_inline)) inline typename Cell
Get the value of the cell.
size_t ele_id
actual element id inside the cell
Symmetric local iterator for the neighborhood of the cell structures.
const Cell::Mem_type_type::local_index_type * start_id
actual element id
size_t cell_id
actual cell id = NNc[NNc_id]+cell stored for performance reason
__attribute__((always_inline)) inline void selectValid()
size_t p
index of the particle p
__attribute__((always_inline)) inline void IterateOwnCell()
__attribute__((always_inline)) inline const typename Cell
Get the value of the cell.
const Cell::Mem_type_type::local_index_type * stop_id
stop id to read the end of the cell
const vector_pos_type & v
Position of the particle p.
__attribute__((always_inline)) inline bool isNext()
Check if there is the next element.
size_t NNc_id
Actual NNc_id;.
const long int cell
Center cell, or cell for witch we are searching the NN-cell.
const NNc_array< dim, NNc_size > & NNc
NN cell id.
__attribute__((always_inline)) inline CellNNIteratorSymLocal< dim
take the next element
Symmetric iterator for the neighborhood of the cell structures.
size_t p
index of the particle p
__attribute__((always_inline)) inline CellNNIteratorSymMP< dim
take the next element
__attribute__((always_inline)) inline void selectValid()
__attribute__((always_inline)) inline CellNNIteratorSymMP(size_t cell
Cell NN iterator.
const vector_pos_type & v_p1
Phase vector for particle p.
const vector_pos_type & v_p2
Phase vector for particle q.
Symmetric iterator for the neighborhood of the cell structures.
__attribute__((always_inline)) inline CellNNIteratorSym(size_t cell
Cell NN iterator.
size_t p
index of the particle p
__attribute__((always_inline)) inline CellNNIteratorSym< dim
take the next element
const vector_pos_type & v
Position of the particle p.
__attribute__((always_inline)) inline void selectValid()
Iterator for the neighborhood of the cell structures.
const NNc_array< dim, NNc_size > & NNc
NN cell id.
__attribute__((always_inline)) inline CellNNIterator &operator++()
take the next element
const Cell::Mem_type_type::local_index_type * stop_id
stop id to read the end of the cell
__attribute__((always_inline)) inline void selectValid()
Select non-empty cell.
size_t NNc_id
Actual NNc_id;.
__attribute__((always_inline)) inline const typename Cell
Get the value of the cell.
const Cell::Mem_type_type::local_index_type * start_id
actual element id
size_t cell_id
actual cell id = NNc[NNc_id]+cell stored for performance reason
__attribute__((always_inline)) inline bool isNext()
Check if there is the next element.
__attribute__((always_inline)) inline CellNNIterator(size_t cell
Cell NN iterator.
const long int cell
Center cell, or cell for witch we are searching the NN-cell.