OpenFPM_pdata  1.0.0
Project that contain the implementation of distributed structures
 All Data Structures Functions Variables Typedefs Enumerations Friends Pages
grid_key_dx_iterator_stencil< dim, Np > Class Template Reference

Detailed Description

template<unsigned int dim, unsigned int Np>
class grid_key_dx_iterator_stencil< dim, Np >

Grid key class iterator, iterate through the grid element

Parameters
dimdimensionality of the grid
Note
if you have a grid you can get this object from getIterator()

Grid iterator declaration and usage

Definition at line 28 of file grid_key_dx_iterator_stencil.hpp.

#include <grid_key_dx_iterator_stencil.hpp>

Public Member Functions

 grid_key_dx_iterator_stencil ()
 Default constructor. More...
 
 grid_key_dx_iterator_stencil (const grid_key_dx_iterator_stencil< dim, Np > &g_it)
 Constructor from a grid_key_dx_iterator<dim> More...
 
template<typename T >
 grid_key_dx_iterator_stencil (const grid_sm< dim, T > &g, const grid_key_dx< dim >(&stencil)[Np])
 Constructor require a grid_sm<dim,T> More...
 
grid_key_dx_iterator_stencil
< dim, Np > 
operator= (const grid_key_dx_iterator_stencil< dim, Np > &key_it)
 Constructor from another grid_key_dx_iterator. More...
 
grid_key_dx_iterator_stencil
< dim, Np > & 
operator++ ()
 Get the next element. More...
 
void set (int d, size_t sz)
 Set the dimension. More...
 
bool isNext ()
 Check if there is the next element. More...
 
const grid_key_dx< dim > & getLoc () const
 Get the actual position. More...
 
template<unsigned int id>
size_t get () const
 Get the actual position. More...
 
void reinitialize (const grid_key_dx_iterator_stencil< dim, Np > &key)
 Reinitialize the grid_key_dx_iterator. More...
 
void reset ()
 Reset the iterator (it restart from the beginning) More...
 

Protected Attributes

grid_key_dx< dim > gk
 

Private Member Functions

size_t get_gk (size_t i) const
 return the index i of the gk key More...
 

Private Attributes

grid_sm< dim, void > grid_base
 information about the grid
 
long int stencil_offset [Np]
 set of offsets for the stencil
 

Constructor & Destructor Documentation

template<unsigned int dim, unsigned int Np>
grid_key_dx_iterator_stencil< dim, Np >::grid_key_dx_iterator_stencil ( )
inline

Default constructor.

Warning
entremly unsafe Before use the iterator you have call reinitialize

Definition at line 67 of file grid_key_dx_iterator_stencil.hpp.

template<unsigned int dim, unsigned int Np>
grid_key_dx_iterator_stencil< dim, Np >::grid_key_dx_iterator_stencil ( const grid_key_dx_iterator_stencil< dim, Np > &  g_it)
inline

Constructor from a grid_key_dx_iterator<dim>

Parameters
g_itgrid_key_dx_iterator<dim>

Initialize to 0 the index

Definition at line 78 of file grid_key_dx_iterator_stencil.hpp.

template<unsigned int dim, unsigned int Np>
template<typename T >
grid_key_dx_iterator_stencil< dim, Np >::grid_key_dx_iterator_stencil ( const grid_sm< dim, T > &  g,
const grid_key_dx< dim >(&)  stencil[Np] 
)
inline

Constructor require a grid_sm<dim,T>

Parameters
ginfo of the grid on which iterate

Definition at line 100 of file grid_key_dx_iterator_stencil.hpp.

Member Function Documentation

template<unsigned int dim, unsigned int Np>
template<unsigned int id>
size_t grid_key_dx_iterator_stencil< dim, Np >::get ( ) const
inline

Get the actual position.

Get the actual position

Returns
the actual key

Definition at line 247 of file grid_key_dx_iterator_stencil.hpp.

template<unsigned int dim, unsigned int Np>
size_t grid_key_dx_iterator_stencil< dim, Np >::get_gk ( size_t  i) const
inlineprivate

return the index i of the gk key

Parameters
iindex to get
Returns
index value

Definition at line 50 of file grid_key_dx_iterator_stencil.hpp.

template<unsigned int dim, unsigned int Np>
const grid_key_dx<dim>& grid_key_dx_iterator_stencil< dim, Np >::getLoc ( ) const
inline

Get the actual position.

Get the actual position

Returns
the actual key

Definition at line 234 of file grid_key_dx_iterator_stencil.hpp.

template<unsigned int dim, unsigned int Np>
bool grid_key_dx_iterator_stencil< dim, Np >::isNext ( )
inline

Check if there is the next element.

Check if there is the next element

Returns
true if there is the next, false otherwise

we did not reach the end of the grid

we reach the end of the grid

Definition at line 214 of file grid_key_dx_iterator_stencil.hpp.

template<unsigned int dim, unsigned int Np>
grid_key_dx_iterator_stencil<dim,Np>& grid_key_dx_iterator_stencil< dim, Np >::operator++ ( )
inline

Get the next element.

Returns
the next grid_key

increment the first index

check the overflow of all the index with exception of the last dimensionality

Definition at line 150 of file grid_key_dx_iterator_stencil.hpp.

template<unsigned int dim, unsigned int Np>
grid_key_dx_iterator_stencil<dim,Np> grid_key_dx_iterator_stencil< dim, Np >::operator= ( const grid_key_dx_iterator_stencil< dim, Np > &  key_it)
inline

Constructor from another grid_key_dx_iterator.

Parameters
key_itgrid_key_dx_iterator

Initialize the index using key_it

Definition at line 129 of file grid_key_dx_iterator_stencil.hpp.

template<unsigned int dim, unsigned int Np>
void grid_key_dx_iterator_stencil< dim, Np >::reinitialize ( const grid_key_dx_iterator_stencil< dim, Np > &  key)
inline

Reinitialize the grid_key_dx_iterator.

Parameters
keyform

Definition at line 257 of file grid_key_dx_iterator_stencil.hpp.

template<unsigned int dim, unsigned int Np>
void grid_key_dx_iterator_stencil< dim, Np >::reset ( )
inline

Reset the iterator (it restart from the beginning)

Definition at line 266 of file grid_key_dx_iterator_stencil.hpp.

template<unsigned int dim, unsigned int Np>
void grid_key_dx_iterator_stencil< dim, Np >::set ( int  d,
size_t  sz 
)
inline

Set the dimension.

Set the dimension

Parameters
dis the dimension
szset the counter to sz

Definition at line 199 of file grid_key_dx_iterator_stencil.hpp.


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