OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
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 34 of file CellNNIterator.hpp.

#include <CellNNIterator.hpp>

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

Public Member Functions

 __attribute__ ((always_inline)) inline CellNNIterator(size_t cell
 Cell NN iterator.
 
const NNc_array< dim, NNc_size > Cell cell (cell)
 
const NNc_array< dim, NNc_size > Cell cell_id (NNc[NNc_id]+cell)
 
const NNc_array< dim, NNc_size > Cell cl (cl)
 
const NNc_array< dim, NNc_size > 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.
 

Data Fields

const NNc_array< dim, NNc_size > Cell & cl:NNc_id(0)
 

Protected Member Functions

 __attribute__ ((always_inline)) inline void selectValid()
 Select non-empty cell.
 

Protected Attributes

const Cell::Mem_type_type::local_index_type * start_id
 actual element id
 
const Cell::Mem_type_type::local_index_type * 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.
 

Member Function Documentation

◆ __attribute__() [1/5]

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

Check if there is the next element.

Returns
true if there is the next element

Definition at line 105 of file CellNNIterator.hpp.

◆ __attribute__() [2/5]

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

take the next element

Returns
itself

Definition at line 117 of file CellNNIterator.hpp.

◆ __attribute__() [3/5]

template<unsigned int dim, typename Cell , int NNc_size, unsigned int impl>
CellNNIterator< dim, Cell, NNc_size, impl >::__attribute__ ( (always_inline)  )

Cell NN iterator.

Parameters
cellCell id
NNcCell neighborhood indexes (relative)
clCell structure

◆ __attribute__() [4/5]

template<unsigned int dim, typename Cell , int NNc_size, unsigned int impl>
CellNNIterator< dim, Cell, NNc_size, impl >::__attribute__ ( (always_inline)  ) const
inline

Get the value of the cell.

Returns
the next element object

Definition at line 131 of file CellNNIterator.hpp.

◆ __attribute__() [5/5]

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

Select non-empty cell.

Definition at line 62 of file CellNNIterator.hpp.

◆ NNc()

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

Definition at line 93 of file CellNNIterator.hpp.

Field Documentation

◆ cell

template<unsigned int dim, typename Cell , int NNc_size, unsigned int impl>
const long int CellNNIterator< dim, Cell, NNc_size, impl >::cell
protected

Center cell, or cell for witch we are searching the NN-cell.

Definition at line 48 of file CellNNIterator.hpp.

◆ cell_id

template<unsigned int dim, typename Cell , int NNc_size, unsigned int impl>
size_t CellNNIterator< dim, Cell, NNc_size, impl >::cell_id
protected

actual cell id = NNc[NNc_id]+cell stored for performance reason

Definition at line 51 of file CellNNIterator.hpp.

◆ cl [1/2]

template<unsigned int dim, typename Cell , int NNc_size, unsigned int impl>
Cell& CellNNIterator< dim, Cell, NNc_size, impl >::cl
protected

Cell list.

Definition at line 54 of file CellNNIterator.hpp.

◆ cl [2/2]

template<unsigned int dim, typename Cell , int NNc_size, unsigned int impl>
const NNc_array<dim,NNc_size> Cell& CellNNIterator< dim, Cell, NNc_size, impl >::cl

Definition at line 92 of file CellNNIterator.hpp.

◆ NNc

template<unsigned int dim, typename Cell , int NNc_size, unsigned int impl>
const NNc_array< dim, NNc_size > & CellNNIterator< dim, Cell, NNc_size, impl >::NNc
protected

NN cell id.

Definition at line 57 of file CellNNIterator.hpp.

◆ NNc_id

template<unsigned int dim, typename Cell , int NNc_size, unsigned int impl>
size_t CellNNIterator< dim, Cell, NNc_size, impl >::NNc_id
protected

Actual NNc_id;.

Definition at line 45 of file CellNNIterator.hpp.

◆ start_id

template<unsigned int dim, typename Cell , int NNc_size, unsigned int impl>
const Cell::Mem_type_type::local_index_type* CellNNIterator< dim, Cell, NNc_size, impl >::start_id
protected

actual element id

Definition at line 39 of file CellNNIterator.hpp.

◆ stop_id

template<unsigned int dim, typename Cell , int NNc_size, unsigned int impl>
const Cell::Mem_type_type::local_index_type* CellNNIterator< dim, Cell, NNc_size, impl >::stop_id
protected

stop id to read the end of the cell

Definition at line 42 of file CellNNIterator.hpp.


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