OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
CellNNIteratorSymM< dim, Cell, sh_byte, RUNTIME, impl > Class Template Reference

Symmetric iterator for the neighborhood of the cell structures. More...

Detailed Description

template<unsigned int dim, typename Cell, unsigned int sh_byte, unsigned int impl>
class CellNNIteratorSymM< dim, Cell, sh_byte, RUNTIME, impl >

Symmetric iterator for the neighborhood of the cell structures.

In general you never create it directly but you get it from the CellList structures

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

Note
if we query the neighborhood of p and q is the neighborhood of p when we will query the neighborhood of q p is not present. This is useful to implement formula like \( \sum_{q = neighborhood(p) and p <= q} \)
Template Parameters
dimdimensionality of the space where the cell live
Cellcell type on which the iterator is working
NNc_sizeneighborhood size
implimplementation specific options NO_CHECK do not do check on access, SAFE do check on access

Definition at line 85 of file CellNNIteratorRuntimeM.hpp.

#include <CellNNIteratorRuntimeM.hpp>

+ Inheritance diagram for CellNNIteratorSymM< dim, Cell, sh_byte, RUNTIME, impl >:

Public Member Functions

 CellNNIteratorSymM (size_t cell, size_t pp, size_t p, const long int *NNc, size_t NNc_size, Cell &cl, const typename Cell::internal_vector_pos_type &pos, const openfpm::vector< pos_v< typename Cell::internal_vector_pos_type > > &ps)
 Cell NN iterator.
 
size_t getP ()
 Get the value of the cell.
 
size_t getV ()
 Get the value of the cell.
 
CellNNIteratorSymM< dim, Cell, sh_byte, RUNTIME, impl > & operator++ ()
 take the next element
 
- Public Member Functions inherited from CellNNIterator< dim, Cell, RUNTIME, impl >
 __attribute__ ((always_inline)) inline CellNNIterator(size_t cell
 Cell NN iterator.
 
const long int size_t Cell NNc_size (NNc_size)
 
const long int size_t Cell cell (cell)
 
const long int size_t Cell cell_id (NNc[NNc_id]+cell)
 
const long int size_t Cell cl (cl)
 
const long int size_t Cell NNc (NNc)
 
 __attribute__ ((always_inline)) inline bool isNext()
 Check if there is the next element.
 
 __attribute__ ((always_inline)) inline CellNNIterator &operator++()
 take the next element
 
 __attribute__ ((always_inline)) inline const typename Cell
 Get the value of the cell.
 

Private Types

typedef boost::low_bits_mask_t< sizeof(size_t) *8-sh_bytemask_low
 

Private Member Functions

void selectValid ()
 

Private Attributes

size_t pp
 phase of the particle p
 
size_t p
 index of the particle p
 
const Cell::internal_vector_pos_type & pos
 
const openfpm::vector< pos_v< typename Cell::internal_vector_pos_type > > & ps
 Position of the particles in the phases.
 

Additional Inherited Members

- Data Fields inherited from CellNNIterator< dim, Cell, RUNTIME, impl >
const long int size_t NNc_size
 
const long int size_t Cell & cl:NNc_id(0)
 
- Protected Member Functions inherited from CellNNIterator< dim, Cell, RUNTIME, impl >
 __attribute__ ((always_inline)) inline void selectValid()
 Select non-empty cell.
 
- Protected Attributes inherited from CellNNIterator< dim, Cell, RUNTIME, impl >
const Cell::Mem_type_type::loc_index * start_id
 actual element id
 
const Cell::Mem_type_type::loc_index * stop_id
 stop id to read the end of the cell
 
size_t NNc_id
 Actual NNc_id;.
 
size_t NNc_size
 Size of the neighboring cells.
 
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
 
Cell & cl
 Cell list.
 
const long int * NNc
 NN cell id.
 

Member Typedef Documentation

◆ mask_low

template<unsigned int dim, typename Cell , unsigned int sh_byte, unsigned int impl>
typedef boost::low_bits_mask_t<sizeof(size_t)*8-sh_byte> CellNNIteratorSymM< dim, Cell, sh_byte, RUNTIME, impl >::mask_low
private

Definition at line 87 of file CellNNIteratorRuntimeM.hpp.

Constructor & Destructor Documentation

◆ CellNNIteratorSymM()

template<unsigned int dim, typename Cell , unsigned int sh_byte, unsigned int impl>
CellNNIteratorSymM< dim, Cell, sh_byte, RUNTIME, impl >::CellNNIteratorSymM ( size_t  cell,
size_t  pp,
size_t  p,
const long int *  NNc,
size_t  NNc_size,
Cell &  cl,
const typename Cell::internal_vector_pos_type &  pos,
const openfpm::vector< pos_v< typename Cell::internal_vector_pos_type > > &  ps 
)
inline

Cell NN iterator.

Parameters
cellCell id
NNcCell neighborhood indexes (relative)
clCell structure

Definition at line 142 of file CellNNIteratorRuntimeM.hpp.

Member Function Documentation

◆ getP()

template<unsigned int dim, typename Cell , unsigned int sh_byte, unsigned int impl>
size_t CellNNIteratorSymM< dim, Cell, sh_byte, RUNTIME, impl >::getP ( )
inline

Get the value of the cell.

Returns
the next element object

Definition at line 159 of file CellNNIteratorRuntimeM.hpp.

◆ getV()

template<unsigned int dim, typename Cell , unsigned int sh_byte, unsigned int impl>
size_t CellNNIteratorSymM< dim, Cell, sh_byte, RUNTIME, impl >::getV ( )
inline

Get the value of the cell.

Returns
the next element object

Definition at line 169 of file CellNNIteratorRuntimeM.hpp.

◆ operator++()

template<unsigned int dim, typename Cell , unsigned int sh_byte, unsigned int impl>
CellNNIteratorSymM< dim, Cell, sh_byte, RUNTIME, impl > & CellNNIteratorSymM< dim, Cell, sh_byte, RUNTIME, impl >::operator++ ( )
inline

take the next element

Returns
itself

Definition at line 179 of file CellNNIteratorRuntimeM.hpp.

◆ selectValid()

template<unsigned int dim, typename Cell , unsigned int sh_byte, unsigned int impl>
void CellNNIteratorSymM< dim, Cell, sh_byte, RUNTIME, impl >::selectValid ( )
inlineprivate

Select the next valid element

Definition at line 103 of file CellNNIteratorRuntimeM.hpp.

Field Documentation

◆ p

template<unsigned int dim, typename Cell , unsigned int sh_byte, unsigned int impl>
size_t CellNNIteratorSymM< dim, Cell, sh_byte, RUNTIME, impl >::p
private

index of the particle p

Definition at line 93 of file CellNNIteratorRuntimeM.hpp.

◆ pos

template<unsigned int dim, typename Cell , unsigned int sh_byte, unsigned int impl>
const Cell::internal_vector_pos_type& CellNNIteratorSymM< dim, Cell, sh_byte, RUNTIME, impl >::pos
private

Definition at line 95 of file CellNNIteratorRuntimeM.hpp.

◆ pp

template<unsigned int dim, typename Cell , unsigned int sh_byte, unsigned int impl>
size_t CellNNIteratorSymM< dim, Cell, sh_byte, RUNTIME, impl >::pp
private

phase of the particle p

Definition at line 90 of file CellNNIteratorRuntimeM.hpp.

◆ ps

template<unsigned int dim, typename Cell , unsigned int sh_byte, unsigned int impl>
const openfpm::vector<pos_v<typename Cell::internal_vector_pos_type> >& CellNNIteratorSymM< dim, Cell, sh_byte, RUNTIME, impl >::ps
private

Position of the particles in the phases.

Definition at line 98 of file CellNNIteratorRuntimeM.hpp.


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