OpenFPM_pdata  1.1.0
Project that contain the implementation of distributed structures
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Pages
CellNNIterator< dim, Cell, NNc_size, impl > Class Template Reference

Iterator for the neighborhood of the cell structures. More...

Detailed Description

template<unsigned int dim, typename Cell, int NNc_size, unsigned int impl>
class CellNNIterator< dim, Cell, NNc_size, impl >

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
to calculate quantities that involve a total reduction (like energies) use the CellIteratorSymRed
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 36 of file CellNNIterator.hpp.

#include <CellNNIterator.hpp>

+ Inheritance diagram for CellNNIterator< dim, Cell, NNc_size, impl >:

Public Member Functions

 CellNNIterator (size_t cell, const NNc_array< dim, NNc_size > &NNc, Cell &cl)
 Cell NN iterator. More...
 
bool isNext ()
 Check if there is the next element. More...
 
CellNNIteratoroperator++ ()
 take the next element More...
 
const
Cell::Mem_type_type::loc_index & 
get ()
 Get the value of the cell. More...
 
const
Cell::Mem_type_type::loc_index & 
get () const
 Get the value of the cell. More...
 

Protected Member Functions

void selectValid ()
 Select non-empty cell. More...
 

Protected Attributes

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;.
 
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 NNc_array< dim, NNc_size > & NNc
 NN cell id.
 

Constructor & Destructor Documentation

template<unsigned int dim, typename Cell , int NNc_size, unsigned int impl>
CellNNIterator< dim, Cell, NNc_size, impl >::CellNNIterator ( size_t  cell,
const NNc_array< dim, NNc_size > &  NNc,
Cell &  cl 
)
inline

Cell NN iterator.

Parameters
cellCell id
NNcCell neighborhood indexes (relative)
clCell structure

Definition at line 94 of file CellNNIterator.hpp.

Member Function Documentation

template<unsigned int dim, typename Cell , int NNc_size, unsigned int impl>
const Cell::Mem_type_type::loc_index& CellNNIterator< dim, Cell, NNc_size, impl >::get ( )
inline

Get the value of the cell.

Returns
the next element object

Definition at line 133 of file CellNNIterator.hpp.

template<unsigned int dim, typename Cell , int NNc_size, unsigned int impl>
const Cell::Mem_type_type::loc_index& CellNNIterator< dim, Cell, NNc_size, impl >::get ( ) const
inline

Get the value of the cell.

Returns
the next element object

Definition at line 143 of file CellNNIterator.hpp.

template<unsigned int dim, typename Cell , int NNc_size, unsigned int impl>
bool CellNNIterator< dim, Cell, NNc_size, impl >::isNext ( )
inline

Check if there is the next element.

Returns
true if there is the next element

Definition at line 107 of file CellNNIterator.hpp.

template<unsigned int dim, typename Cell , int NNc_size, unsigned int impl>
CellNNIterator& CellNNIterator< dim, Cell, NNc_size, impl >::operator++ ( )
inline

take the next element

Returns
itself

Definition at line 119 of file CellNNIterator.hpp.

template<unsigned int dim, typename Cell , int NNc_size, unsigned int impl>
void CellNNIterator< dim, Cell, NNc_size, impl >::selectValid ( )
inlineprotected

Select non-empty cell.

Definition at line 64 of file CellNNIterator.hpp.


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