OpenFPM_pdata  1.1.0
Project that contain the implementation of distributed structures
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Pages
CellListM< dim, T, sh_byte, CellBase > Class Template Reference

Class for Multi-Phase cell-list. More...

Detailed Description

template<unsigned int dim, typename T, unsigned int sh_byte, typename CellBase = CellList<dim,T,Mem_fast<>,shift<dim, T>>>
class CellListM< dim, T, sh_byte, CellBase >

Class for Multi-Phase cell-list.

This class implement a Multi-Phase cell list. In practice this Cell list can contain the particles from multiple vector distributed. By default this cell list is based on Cell list fast with shifting

* +-----------------------+
* |p |p |p |p |p |p |p |p |
* +-----------------------+
* |p |  |  |  |  |  |  |p |
* +-----------------------+
* |p |  |  |  |  |  |  |p |
* +-----------------------+
* |p |  |  |  |  |  |  |p |
* +-----------------------+
* |p |9 |  |  |  |  |  |p |
* +-----------------------+
* |p |p |p |p |p |p |p |p |
* +-----------------------+
* 
Template Parameters
dimdimensionality
Ttype of the space
sh_bytebit to dedicate to the phases informations
CellBaseBase cell list used for the implementation

Declaration of a Multi-Phase cell list and usage

Definition at line 53 of file CellListM.hpp.

#include <CellListM.hpp>

+ Inheritance diagram for CellListM< dim, T, sh_byte, CellBase >:

Public Types

typedef CellNNIteratorSymM
< dim, CellListM< dim, T,
sh_byte, CellBase >, sh_byte,
RUNTIME, NO_CHECK > 
SymNNIterator
 Type of the iterator for the neighborhood.
 

Public Member Functions

 CellListM ()
 Default Constructor.
 
 CellListM (const CellListM< dim, T, sh_byte, CellBase > &cell)
 Copy constructor. More...
 
 CellListM (CellListM< dim, T, sh_byte, CellBase > &&cell)
 Copy constructor. More...
 
 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. More...
 
 CellListM (Box< dim, T > &box, const size_t(&div)[dim], const size_t pad=1, size_t slot=STARTING_NSLOT)
 Cell list constructor. More...
 
 ~CellListM ()
 Destructor. More...
 
void addCell (size_t cell_id, size_t ele, size_t v_id)
 Add to the cell. More...
 
void add (const T(&pos)[dim], size_t ele, size_t v_id)
 Add an element in the cell list. More...
 
void add (const Point< dim, T > &pos, size_t ele, size_t v_id)
 Add an element in the cell list. More...
 
size_t getP (size_t cell, size_t ele)
 Get the element-id in the cell. More...
 
size_t getV (size_t cell, size_t ele)
 Get the element vector in the cell. More...
 
void swap (CellListM< dim, T, sh_byte, CellBase > &cl)
 Swap the memory. More...
 
CellIterator< CellListM< dim,
T, sh_byte, CellBase > > 
getIterator (size_t cell)
 Get the Cell iterator. More...
 
template<unsigned int impl = NO_CHECK>
CellNNIteratorM< dim,
CellListM< dim, T, sh_byte,
CellBase >, sh_byte, FULL,
impl > 
getNNIterator (size_t cell)
 Get the Neighborhood iterator. More...
 
template<unsigned int impl>
CellNNIteratorSymM< dim,
CellListM< dim, T, sh_byte,
CellBase >, sh_byte, SYM, impl > 
getNNIteratorSym (size_t cell, size_t pp, size_t p, const openfpm::vector< Point< dim, typename CellBase::stype >> &pos, const openfpm::vector< pos_v< dim, typename CellBase::stype >> &v)
 Get the Neighborhood iterator. More...
 
CellListM< dim, T, sh_byte,
CellBase > & 
operator= (CellListM< dim, T, sh_byte, CellBase > &&clm)
 operator= More...
 
CellListM< dim, T, sh_byte,
CellBase > & 
operator= (const CellListM< dim, T, sh_byte, CellBase > &clm)
 operator= More...
 

Static Public Member Functions

static size_t getP (size_t ele)
 Convert an element in particle id. More...
 
static size_t getV (size_t ele)
 Convert an element in phase id. More...
 

Private Types

typedef boost::high_bit_mask_t
< sh_byte > 
mask_high
 Mask to get the high bits of a number.
 
typedef boost::low_bits_mask_t
< sizeof(size_t)*8-sh_byte > 
mask_low
 Mask to get the low bits of a number.
 

Constructor & Destructor Documentation

template<unsigned int dim, typename T, unsigned int sh_byte, typename CellBase = CellList<dim,T,Mem_fast<>,shift<dim, T>>>
CellListM< dim, T, sh_byte, CellBase >::CellListM ( const CellListM< dim, T, sh_byte, CellBase > &  cell)
inline

Copy constructor.

Parameters
cellCell to copy

Definition at line 75 of file CellListM.hpp.

template<unsigned int dim, typename T, unsigned int sh_byte, typename CellBase = CellList<dim,T,Mem_fast<>,shift<dim, T>>>
CellListM< dim, T, sh_byte, CellBase >::CellListM ( CellListM< dim, T, sh_byte, CellBase > &&  cell)
inline

Copy constructor.

Parameters
cellCell to copy

Definition at line 85 of file CellListM.hpp.

template<unsigned int dim, typename T, unsigned int sh_byte, typename CellBase = CellList<dim,T,Mem_fast<>,shift<dim, T>>>
CellListM< dim, T, sh_byte, CellBase >::CellListM ( Box< dim, T > &  box,
const size_t(&)  div[dim],
Matrix< dim, T >  mat,
const size_t  pad = 1,
size_t  slot = STARTING_NSLOT 
)
inline

Cell list constructor.

Parameters
boxDomain where this cell list is living
divgrid size on each dimension
matMatrix transformation
padCell padding
slotmaximum number of slot

Definition at line 100 of file CellListM.hpp.

template<unsigned int dim, typename T, unsigned int sh_byte, typename CellBase = CellList<dim,T,Mem_fast<>,shift<dim, T>>>
CellListM< dim, T, sh_byte, CellBase >::CellListM ( Box< dim, T > &  box,
const size_t(&)  div[dim],
const size_t  pad = 1,
size_t  slot = STARTING_NSLOT 
)
inline

Cell list constructor.

Parameters
boxDomain where this cell list is living
divgrid size on each dimension
padCell padding
slotmaximum number of slot

Definition at line 112 of file CellListM.hpp.

template<unsigned int dim, typename T, unsigned int sh_byte, typename CellBase = CellList<dim,T,Mem_fast<>,shift<dim, T>>>
CellListM< dim, T, sh_byte, CellBase >::~CellListM ( )
inline

Destructor.

Definition at line 121 of file CellListM.hpp.

Member Function Documentation

template<unsigned int dim, typename T, unsigned int sh_byte, typename CellBase = CellList<dim,T,Mem_fast<>,shift<dim, T>>>
void CellListM< dim, T, sh_byte, CellBase >::add ( const T(&)  pos[dim],
size_t  ele,
size_t  v_id 
)
inline

Add an element in the cell list.

Parameters
posarray that contain the coordinate
eleelement to store
v_idphase id

Definition at line 145 of file CellListM.hpp.

template<unsigned int dim, typename T, unsigned int sh_byte, typename CellBase = CellList<dim,T,Mem_fast<>,shift<dim, T>>>
void CellListM< dim, T, sh_byte, CellBase >::add ( const Point< dim, T > &  pos,
size_t  ele,
size_t  v_id 
)
inline

Add an element in the cell list.

Parameters
posarray that contain the coordinate
eleelement to store
v_idphase id

Definition at line 164 of file CellListM.hpp.

template<unsigned int dim, typename T, unsigned int sh_byte, typename CellBase = CellList<dim,T,Mem_fast<>,shift<dim, T>>>
void CellListM< dim, T, sh_byte, CellBase >::addCell ( size_t  cell_id,
size_t  ele,
size_t  v_id 
)
inline

Add to the cell.

Parameters
cell_idCell id where to add
eleelement to add
v_idphase id

Definition at line 131 of file CellListM.hpp.

template<unsigned int dim, typename T, unsigned int sh_byte, typename CellBase = CellList<dim,T,Mem_fast<>,shift<dim, T>>>
CellIterator<CellListM<dim,T,sh_byte,CellBase> > CellListM< dim, T, sh_byte, CellBase >::getIterator ( size_t  cell)
inline

Get the Cell iterator.

Parameters
cell
Returns
the iterator to the elements inside cell

Definition at line 247 of file CellListM.hpp.

template<unsigned int dim, typename T, unsigned int sh_byte, typename CellBase = CellList<dim,T,Mem_fast<>,shift<dim, T>>>
template<unsigned int impl = NO_CHECK>
CellNNIteratorM<dim,CellListM<dim,T,sh_byte,CellBase>,sh_byte,FULL,impl> CellListM< dim, T, sh_byte, CellBase >::getNNIterator ( size_t  cell)
inline

Get the Neighborhood iterator.

It iterate across all the element of the selected cell and the near cells

  * * *
  * x *
  * * *
  • x is the selected cell
  • * are the near cell
Parameters
cellcell id
Returns
an iterator over the particle of the selected cell

Definition at line 272 of file CellListM.hpp.

template<unsigned int dim, typename T, unsigned int sh_byte, typename CellBase = CellList<dim,T,Mem_fast<>,shift<dim, T>>>
template<unsigned int impl>
CellNNIteratorSymM<dim,CellListM<dim,T,sh_byte,CellBase>,sh_byte,SYM,impl> CellListM< dim, T, sh_byte, CellBase >::getNNIteratorSym ( size_t  cell,
size_t  pp,
size_t  p,
const openfpm::vector< Point< dim, typename CellBase::stype >> &  pos,
const openfpm::vector< pos_v< dim, typename CellBase::stype >> &  v 
)
inline

Get the Neighborhood iterator.

It iterate across all the element of the selected cell and the near cells

* * *
  x *
  • x is the selected cell
  • * are the near cell
Parameters
cellcell id
Returns
Cell-list structure

Definition at line 300 of file CellListM.hpp.

template<unsigned int dim, typename T, unsigned int sh_byte, typename CellBase = CellList<dim,T,Mem_fast<>,shift<dim, T>>>
static size_t CellListM< dim, T, sh_byte, CellBase >::getP ( size_t  ele)
inlinestatic

Convert an element in particle id.

Parameters
eleelement id
Returns
The element value

Definition at line 183 of file CellListM.hpp.

template<unsigned int dim, typename T, unsigned int sh_byte, typename CellBase = CellList<dim,T,Mem_fast<>,shift<dim, T>>>
size_t CellListM< dim, T, sh_byte, CellBase >::getP ( size_t  cell,
size_t  ele 
)
inline

Get the element-id in the cell.

Template Parameters
iproperty to get
Parameters
cellcell id
eleelement id
Returns
The element value

Definition at line 210 of file CellListM.hpp.

template<unsigned int dim, typename T, unsigned int sh_byte, typename CellBase = CellList<dim,T,Mem_fast<>,shift<dim, T>>>
static size_t CellListM< dim, T, sh_byte, CellBase >::getV ( size_t  ele)
inlinestatic

Convert an element in phase id.

Parameters
eleelement id
Returns
The element value

Definition at line 195 of file CellListM.hpp.

template<unsigned int dim, typename T, unsigned int sh_byte, typename CellBase = CellList<dim,T,Mem_fast<>,shift<dim, T>>>
size_t CellListM< dim, T, sh_byte, CellBase >::getV ( size_t  cell,
size_t  ele 
)
inline

Get the element vector in the cell.

Template Parameters
iproperty to get
Parameters
cellcell id
eleelement id
Returns
The element value

Definition at line 225 of file CellListM.hpp.

template<unsigned int dim, typename T, unsigned int sh_byte, typename CellBase = CellList<dim,T,Mem_fast<>,shift<dim, T>>>
CellListM<dim,T,sh_byte,CellBase>& CellListM< dim, T, sh_byte, CellBase >::operator= ( CellListM< dim, T, sh_byte, CellBase > &&  clm)
inline

operator=

Parameters
clmCell list to copy
Returns
Cell-list structure

Definition at line 319 of file CellListM.hpp.

template<unsigned int dim, typename T, unsigned int sh_byte, typename CellBase = CellList<dim,T,Mem_fast<>,shift<dim, T>>>
CellListM<dim,T,sh_byte,CellBase>& CellListM< dim, T, sh_byte, CellBase >::operator= ( const CellListM< dim, T, sh_byte, CellBase > &  clm)
inline

operator=

Parameters
clmCell list to copy
Returns
Cell-list structure

Definition at line 333 of file CellListM.hpp.

template<unsigned int dim, typename T, unsigned int sh_byte, typename CellBase = CellList<dim,T,Mem_fast<>,shift<dim, T>>>
void CellListM< dim, T, sh_byte, CellBase >::swap ( CellListM< dim, T, sh_byte, CellBase > &  cl)
inline

Swap the memory.

Parameters
clCell list with witch you swap the memory

Definition at line 235 of file CellListM.hpp.


The documentation for this class was generated from the following file: