8 #ifndef OPENFPM_DATA_SRC_NN_CELLLIST_CELLNNITERATORM_HPP_ 9 #define OPENFPM_DATA_SRC_NN_CELLLIST_CELLNNITERATORM_HPP_ 12 #include "util/mathutil.hpp" 13 #include <boost/integer/integer_mask.hpp> 14 #include "CellList_util.hpp" 15 #include "CellNNIterator.hpp" 30 template<
unsigned int dim,
typename Cell,
unsigned int sh_
byte,
int NNc_size,
unsigned int impl>
33 typedef boost::low_bits_mask_t<
sizeof(size_t)*8-sh_byte> mask_low;
42 const typename Cell::internal_vector_pos_type &
pos;
54 while (this->start_id < this->
stop_id)
57 for (
long int i = dim-1 ; i >= 0 ; i--)
59 if (
pos.template get<0>(
p)[i] <
ps.get(q >> (
sizeof(
size_t)*8-sh_byte)).pos.template get<0>(q & mask_low::sig_bits_fast)[i])
61 else if (
pos.template get<0>(
p)[i] >
ps.get(q >> (
sizeof(
size_t)*8-sh_byte)).pos.template get<0>(q & mask_low::sig_bits_fast)[i])
64 if (q >> (
sizeof(
size_t)*8-sh_byte) !=
pp)
return;
65 if ((q & mask_low::sig_bits_fast) >=
p)
return;
94 const typename Cell::internal_vector_pos_type &
pos,
149 template<
unsigned int dim,
typename Cell,
unsigned int sh_
byte,
int NNc_size,
unsigned int impl>
class CellNNIteratorM :
public CellNNIterator<dim,Cell,NNc_size,impl>
151 typedef boost::low_bits_mask_t<
sizeof(size_t)*8-sh_byte> mask_low;
200 typedef boost::low_bits_mask_t<
sizeof(size_t)*8-sh_byte> mask_low;
235 #include "CellNNIteratorRuntimeM.hpp" const long int cell
Center cell, or cell for witch we are searching the NN-cell.
Iterator for the neighborhood of the cell structures.
const Cell::internal_vector_pos_type & pos
Position of the particles p.
size_t getV()
Get the value of the cell.
Iterator for the neighborhood of the cell structures.
size_t getV()
Get the value of the cell.
it iterate through the elements of a cell
size_t getP()
Get the value of the cell.
CellNNIteratorSymM(size_t cell, size_t pp, size_t p, const NNc_array< dim, NNc_size > &NNc, Cell &cl, const typename Cell::internal_vector_pos_type &pos, const typename openfpm::vector< pos_v< typename Cell::internal_vector_pos_type >> &ps)
Cell NN iterator.
Structure that contain a reference to a vector of particles.
const Cell::Mem_type_type::local_index_type * start_id
actual element id
size_t p
index of the particle p
const openfpm::vector< pos_v< typename Cell::internal_vector_pos_type > > & ps
Position of the particle p.
size_t pp
phase of particle p
const NNc_array< dim, NNc_size > & NNc
NN cell id.
size_t getP()
Get the value of the cell.
CellIteratorM(const size_t cell, Cell &cl)
Cell iterator.
CellNNIteratorM(size_t cell, const NNc_array< dim, NNc_size > &NNc, Cell &cl)
Cell NN iterator.
it iterate through the elements of a cell
size_t NNc_id
Actual NNc_id;.
const long int cell
selected cell
size_t getP()
Get the value of the cell.
CellNNIteratorSymM< dim, Cell, sh_byte, NNc_size, impl > & operator++()
take the next element
size_t getV()
Get the value of the cell.
Implementation of 1-D std::vector like structure.
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.