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)
33template<
unsigned int dim,
typename Cell,
int NNc_size,
unsigned int impl>
39 const typename Cell::Mem_type_type::local_index_type *
start_id;
42 const typename Cell::Mem_type_type::local_index_type *
stop_id;
69 if (
NNc_id >= NNc_size)
return;
131 __attribute__((always_inline))
inline const typename Cell::Mem_type_type::local_index_type & get()
141 __attribute__((always_inline))
inline const typename Cell::Mem_type_type::local_index_type & get()
const
164template<
unsigned int dim,
typename Cell,
typename vector_pos_type,
int NNc_size,
unsigned int impl>
171 const vector_pos_type &
v;
178 if (this->NNc[this->NNc_id] == 0)
180 while (this->start_id < this->
stop_id)
182 size_t q = this->cl.get_lin(this->start_id);
183 for (
long int i = dim-1 ; i >= 0 ; i--)
185 if (
v.template get<0>(
p)[i] <
v.template get<0>(q)[i])
187 else if (
v.template get<0>(
p)[i] >
v.template get<0>(q)[i])
253template<
unsigned int dim,
typename Cell,
typename vector_pos_type ,
int NNc_size,
unsigned int impl>
270 if (this->NNc[this->NNc_id] == 0)
272 while (this->start_id < this->
stop_id)
274 size_t q = this->cl.get_lin(this->start_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])
311 const vector_pos_type &
v_p1,
312 const vector_pos_type &
v_p2)
402 __attribute__((always_inline))
inline const typename Cell::value_type & get()
const
408#include "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 iterator for the neighborhood of the cell structures.
__attribute__((always_inline)) inline CellNNIteratorSymMP(size_t cell
Cell NN iterator.
__attribute__((always_inline)) inline CellNNIteratorSymMP< dim
take the next element
__attribute__((always_inline)) inline void selectValid()
size_t p
index of the particle p
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.
const vector_pos_type & v
Position of the particle p.
size_t p
index of the particle p
__attribute__((always_inline)) inline CellNNIteratorSym< dim
take the next element
__attribute__((always_inline)) inline void selectValid()
Iterator for the neighborhood of the cell structures.
__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
__attribute__((always_inline)) inline bool isNext()
Check if there is the next element.
size_t cell_id
actual cell id = NNc[NNc_id]+cell stored for performance reason
size_t NNc_id
Actual NNc_id;.
__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.
__attribute__((always_inline)) inline CellNNIterator &operator++()
take the next element
const NNc_array< dim, NNc_size > & NNc
NN cell id.
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.