OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
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 51 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.
 
 CellListM (CellListM< dim, T, sh_byte, CellBase > &&cell)
 Copy constructor.
 
 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 (Box< dim, T > &box, const size_t(&div)[dim], const size_t pad=1, size_t slot=STARTING_NSLOT)
 Cell list constructor.
 
 ~CellListM ()
 Destructor.
 
void addCell (size_t cell_id, size_t ele, size_t v_id)
 Add to the cell.
 
void add (const T(&pos)[dim], size_t ele, size_t v_id)
 Add an element in the cell list.
 
void add (const Point< dim, T > &pos, size_t ele, size_t v_id)
 Add an element in the cell list.
 
size_t getP (size_t cell, size_t ele)
 Get the element-id in the cell.
 
size_t getV (size_t cell, size_t ele)
 Get the element vector in the cell.
 
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.
 
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.
 
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 typename CellBase::internal_vector_pos_type &pos, const openfpm::vector< pos_v< typename CellBase::internal_vector_pos_type > > &v)
 Get the Neighborhood iterator.
 
CellListM< dim, T, sh_byte, CellBase > & operator= (CellListM< dim, T, sh_byte, CellBase > &&clm)
 operator=
 
CellListM< dim, T, sh_byte, CellBase > & operator= (const CellListM< dim, T, sh_byte, CellBase > &clm)
 operator=
 

Static Public Member Functions

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

Private Types

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

Member Typedef Documentation

◆ mask_high

template<unsigned int dim, typename T , unsigned int sh_byte, typename CellBase = CellList<dim,T,Mem_fast<>,shift<dim, T>>>
typedef boost::high_bit_mask_t<sh_byte> CellListM< dim, T, sh_byte, CellBase >::mask_high
private

Mask to get the high bits of a number.

Definition at line 54 of file CellListM.hpp.

◆ mask_low

template<unsigned int dim, typename T , unsigned int sh_byte, typename CellBase = CellList<dim,T,Mem_fast<>,shift<dim, T>>>
typedef boost::low_bits_mask_t<sizeof(size_t)*8-sh_byte> CellListM< dim, T, sh_byte, CellBase >::mask_low
private

Mask to get the low bits of a number.

Definition at line 57 of file CellListM.hpp.

◆ SymNNIterator

template<unsigned int dim, typename T , unsigned int sh_byte, typename CellBase = CellList<dim,T,Mem_fast<>,shift<dim, T>>>
typedef CellNNIteratorSymM<dim,CellListM<dim,T,sh_byte,CellBase>,sh_byte,RUNTIME,NO_CHECK> CellListM< dim, T, sh_byte, CellBase >::SymNNIterator

Type of the iterator for the neighborhood.

Definition at line 62 of file CellListM.hpp.

Constructor & Destructor Documentation

◆ CellListM() [1/5]

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

Default Constructor.

Definition at line 65 of file CellListM.hpp.

◆ CellListM() [2/5]

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 73 of file CellListM.hpp.

◆ CellListM() [3/5]

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 83 of file CellListM.hpp.

◆ CellListM() [4/5]

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 98 of file CellListM.hpp.

◆ CellListM() [5/5]

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 110 of file CellListM.hpp.

◆ ~CellListM()

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 119 of file CellListM.hpp.

Member Function Documentation

◆ add() [1/2]

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 162 of file CellListM.hpp.

◆ add() [2/2]

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 143 of file CellListM.hpp.

◆ addCell()

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 129 of file CellListM.hpp.

◆ getIterator()

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 245 of file CellListM.hpp.

◆ getNNIterator()

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 270 of file CellListM.hpp.

◆ getNNIteratorSym()

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 typename CellBase::internal_vector_pos_type &  pos,
const openfpm::vector< pos_v< typename CellBase::internal_vector_pos_type > > &  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 298 of file CellListM.hpp.

◆ getP() [1/2]

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 208 of file CellListM.hpp.

◆ getP() [2/2]

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 181 of file CellListM.hpp.

◆ getV() [1/2]

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 223 of file CellListM.hpp.

◆ getV() [2/2]

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 193 of file CellListM.hpp.

◆ operator=() [1/2]

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 317 of file CellListM.hpp.

◆ operator=() [2/2]

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 331 of file CellListM.hpp.

◆ swap()

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 233 of file CellListM.hpp.


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