8 #ifndef OPENFPM_DATA_SRC_NN_CELLLIST_CELLLISTM_HPP_
9 #define OPENFPM_DATA_SRC_NN_CELLLIST_CELLLISTM_HPP_
11 #include "NN/CellList/CellList.hpp"
12 #include "NN/CellList/multiphase/CellNNIteratorM.hpp"
50 template<
unsigned int dim,
typename T,
unsigned int sh_
byte,
typename CellBase=CellList<dim,T,Mem_fast<>,shift<dim, T>> >
57 typedef boost::low_bits_mask_t<
sizeof(size_t)*8-sh_byte>
mask_low;
99 :CellBase(box,div,mat,pad,slot)
111 :CellBase(box,div,pad,slot)
131 size_t ele_k =
ele | (v_id << (
sizeof(size_t)*8-sh_byte));
133 CellBase::addCell(cell_id,ele_k);
143 inline void add(
const T (& pos)[dim],
size_t ele,
size_t v_id)
147 size_t cell_id = this->getCell(pos);
148 size_t ele_k =
ele | (v_id << (
sizeof(size_t)*8-sh_byte));
152 CellBase::addCell(cell_id,ele_k);
166 size_t cell_id = this->getCell(pos);
167 size_t ele_k =
ele | (v_id << (
sizeof(size_t)*8-sh_byte));
171 CellBase::addCell(cell_id,ele_k);
183 return ele & mask_low::sig_bits_fast;
195 return ele >> (
sizeof(size_t)*8-sh_byte);
210 return CellBase::get(cell,
ele) & mask_low::sig_bits_fast;
225 return (CellBase::get(cell,
ele)) >> (
sizeof(size_t)*8-sh_byte);
235 CellBase::swap(*
this);
247 return CellBase::getIterator(cell);
272 CellNNIteratorM<dim,CellListM<dim,T,sh_byte,CellBase>,sh_byte,FULL> cln(cell,
CellListM<dim,T,sh_byte,CellBase>::NNc_full,*
this);
301 const typename CellBase::internal_vector_pos_type & pos,
304 CellNNIteratorSymM<dim,CellListM<dim,T,sh_byte,CellBase>,sh_byte,SYM> cln(cell,pp,p,
CellListM<dim,T,sh_byte,CellBase>::NNc_sym,*
this,pos,v);
333 static_cast<CellBase *
>(
this)->
operator=(*
static_cast<const CellBase *
>(&clm));
This class represent an N-dimensional box.
it iterate through the elements of a cell
Class for Multi-Phase cell-list.
void swap(CellListM< dim, T, sh_byte, CellBase > &cl)
Swap the memory.
CellIterator< CellListM< dim, T, sh_byte, CellBase > > getIterator(size_t cell)
Get the Cell iterator.
CellListM()
Default Constructor.
CellListM(Box< dim, T > &box, const size_t(&div)[dim], const size_t pad=1, size_t slot=STARTING_NSLOT)
Cell list constructor.
void add(const Point< dim, T > &pos, size_t ele, size_t v_id)
Add an element in the cell list.
CellListM< dim, T, sh_byte, CellBase > & operator=(const CellListM< dim, T, sh_byte, CellBase > &clm)
operator=
CellListM(Box< dim, T > &box, const size_t(&div)[dim], Matrix< dim, T > mat, const size_t pad=1, size_t slot=STARTING_NSLOT)
Cell list constructor.
CellListM(CellListM< dim, T, sh_byte, CellBase > &&cell)
Copy constructor.
static size_t getP(size_t ele)
Convert an element in particle id.
void add(const T(&pos)[dim], size_t ele, size_t v_id)
Add an element in the cell list.
static size_t getV(size_t ele)
Convert an element in phase id.
CellNNIteratorSymM< dim, CellListM< dim, T, sh_byte, CellBase >, sh_byte, RUNTIME > SymNNIterator
Type of the iterator for the neighborhood.
void addCell(size_t cell_id, size_t ele, size_t v_id)
Add to the cell.
boost::low_bits_mask_t< sizeof(size_t) *8-sh_byte > mask_low
Mask to get the low bits of a number.
CellListM(const CellListM< dim, T, sh_byte, CellBase > &cell)
Copy constructor.
size_t getP(size_t cell, size_t ele)
Get the element-id in the cell.
CellListM< dim, T, sh_byte, CellBase > & operator=(CellListM< dim, T, sh_byte, CellBase > &&clm)
operator=
CellNNIteratorSymM< dim, CellListM< dim, T, sh_byte, CellBase >, sh_byte, SYM > getNNIteratorBoxSym(size_t cell, size_t pp, size_t p, const typename CellBase::internal_vector_pos_type &pos, const openfpm::vector< pos_v< typename CellBase::internal_vector_pos_type >> &v)
Get the Neighborhood iterator.
size_t getV(size_t cell, size_t ele)
Get the element vector in the cell.
boost::high_bit_mask_t< sh_byte > mask_high
Mask to get the high bits of a number.
CellNNIteratorM< dim, CellListM< dim, T, sh_byte, CellBase >, sh_byte, FULL > getNNIteratorBox(size_t cell)
Get the Neighborhood iterator.
Iterator for the neighborhood of the cell structures.
Iterator for the neighborhood of the cell structures.
This class implement an NxN (dense) matrix.
This class implement the point shape in an N-dimensional space.
Implementation of 1-D std::vector like structure.
Structure that contain a reference to a vector of particles.