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)
32template<
unsigned int dim,
typename Cell,
unsigned int impl>
38 const typename Cell::Mem_type_type::loc_index *
start_id;
41 const typename Cell::Mem_type_type::loc_index *
stop_id;
71 if (
NNc_id >= NNc_size)
return;
134 __attribute__((always_inline))
inline const typename Cell::Mem_type_type::loc_index & get()
157template<
unsigned int dim,
typename Cell,
typename vector_pos_type,
unsigned int impl>
164 const vector_pos_type &
v;
171 if (this->NNc[this->NNc_id] == 0)
173 while (this->start_id < this->
stop_id)
175 size_t q = this->cl.get_lin(this->start_id);
176 for (
long int i = dim-1 ; i >= 0 ; i--)
178 if (
v.template get<0>(
p)[i] <
v.template get<0>(q)[i])
180 else if (
v.template get<0>(
p)[i] >
v.template get<0>(q)[i])
210 const long int * NNc,
213 const vector_pos_type &
v)
216 if (this->NNc_id >= this->NNc_size)
const vector_pos_type & v
Position of the particle p.
__attribute__((always_inline)) inline CellNNIteratorSym< dim
take the next element
__attribute__((always_inline)) inline void selectValid()
__attribute__((always_inline)) inline CellNNIteratorSym(size_t cell
Cell NN iterator.
size_t p
index of the particle p
Symmetric iterator for the neighborhood of the cell structures.
const vector_pos_type & v
Position of the particle p.
size_t p
index of the particle p
__attribute__((always_inline)) inline CellNNIterator &operator++()
take the next element
const long int * NNc
NN cell id.
__attribute__((always_inline)) inline void selectValid()
Select non-empty cell.
size_t cell_id
actual cell id = NNc[NNc_id]+cell stored for performance reason
size_t NNc_id
Actual NNc_id;.
const long int cell
Center cell, or cell for witch we are searching the NN-cell.
const Cell::Mem_type_type::loc_index * stop_id
stop id to read the end of the cell
__attribute__((always_inline)) inline CellNNIterator(size_t cell
Cell NN iterator.
__attribute__((always_inline)) inline const typename Cell
Get the value of the cell.
size_t NNc_size
Size of the neighboring cells.
const Cell::Mem_type_type::loc_index * start_id
actual element id
__attribute__((always_inline)) inline bool isNext()
Check if there is the next element.
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
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.
const Cell::Mem_type_type::local_index_type * stop_id
stop id to read the end of the cell