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) 32 template<
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()
157 template<
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 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
Symmetric iterator for the neighborhood of the cell structures.
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 Cell::Mem_type_type::loc_index * start_id
actual element id
const Cell::Mem_type_type::local_index_type * start_id
actual element id
Symmetric iterator for the neighborhood of the cell structures.
size_t p
index of the particle p
size_t cell_id
actual cell id = NNc[NNc_id]+cell stored for performance reason
__attribute__((always_inline)) inline const typename Cell
Get the value of the cell.
const NNc_array< dim, NNc_size > & NNc
NN cell id.
const long int cell
Center cell, or cell for witch we are searching the NN-cell.
const vector_pos_type & v
Position of the particle p.
size_t NNc_size
Size of the neighboring cells.
__attribute__((always_inline)) inline void selectValid()
__attribute__((always_inline)) inline void selectValid()
size_t NNc_id
Actual NNc_id;.
size_t NNc_id
Actual NNc_id;.
__attribute__((always_inline)) inline void selectValid()
Select non-empty cell.
const vector_pos_type & v
Position of the particle p.
__attribute__((always_inline)) inline CellNNIterator &operator++()
take the next element
size_t p
index of the particle p
const Cell::Mem_type_type::local_index_type * stop_id
stop id to read the end of the cell
Iterator for the neighborhood of the cell structures.
__attribute__((always_inline)) inline void selectValid()
Select non-empty cell.
__attribute__((always_inline)) inline bool isNext()
Check if there is the next element.