OpenFPM_pdata  1.1.0
Project that contain the implementation of distributed structures
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Pages
grid_dist_id_iterator_dec< Decomposition > Class Template Reference

Given the decomposition it create an iterator. More...

Detailed Description

template<typename Decomposition>
class grid_dist_id_iterator_dec< Decomposition >

Given the decomposition it create an iterator.

Iterator across the local elements of the distributed grid

Template Parameters
decDecomposition type

Definition at line 23 of file grid_dist_id_iterator_dec.hpp.

#include <grid_dist_id_iterator_dec.hpp>

+ Inheritance diagram for grid_dist_id_iterator_dec< Decomposition >:

Public Member Functions

grid_dist_id_iterator_dec
< Decomposition > & 
operator= (const grid_dist_id_iterator_dec< Decomposition > &tmp)
 Copy operator=. More...
 
 grid_dist_id_iterator_dec (const grid_dist_id_iterator_dec< Decomposition > &tmp)
 Copy constructor. More...
 
 grid_dist_id_iterator_dec (Decomposition &dec, const size_t(&sz)[Decomposition::dims])
 Constructor of the distributed grid iterator. More...
 
 grid_dist_id_iterator_dec (Decomposition &dec, const size_t(&sz)[Decomposition::dims], grid_key_dx< Decomposition::dims > start, grid_key_dx< Decomposition::dims > stop)
 Constructor of the distributed grid iterator. More...
 
grid_dist_id_iterator_dec
< Decomposition > & 
operator++ ()
 Get the next element. More...
 
bool isNext ()
 Check if there is the next element. More...
 
Decomposition::stype getSpacing (size_t i)
 Get the spacing of the grid. More...
 
grid_key_dx< Decomposition::dims > get ()
 Get the actual global key of the grid. More...
 
grid_dist_key_dx
< Decomposition::dims > 
get_dist ()
 Get the actual grid key for a distributed grid. More...
 
grid_key_dx< Decomposition::dims > getStart ()
 Get the starting point of the sub-grid we are iterating. More...
 
grid_key_dx< Decomposition::dims > getStop ()
 Get the starting point of the sub-grid we are iterating. More...
 

Private Member Functions

void selectValidGrid ()
 from g_c increment g_c until you find a valid grid More...
 
grid_dist_key_dx
< Decomposition::dims > 
get_int ()
 Get the actual key. More...
 

Private Attributes

size_t g_c
 grid list counter
 
openfpm::vector< GBoxes
< Decomposition::dims > > 
gdb_ext
 Extension of each grid: domain and ghost + domain.
 
grid_key_dx_iterator_sub
< Decomposition::dims > 
a_it
 Actual iterator.
 
grid_key_dx< Decomposition::dims > start
 start key
 
grid_key_dx< Decomposition::dims > stop
 stop key
 
Decomposition::stype spacing [Decomposition::dims]
 Spacing.
 

Constructor & Destructor Documentation

template<typename Decomposition>
grid_dist_id_iterator_dec< Decomposition >::grid_dist_id_iterator_dec ( const grid_dist_id_iterator_dec< Decomposition > &  tmp)
inline

Copy constructor.

Parameters
tmpiterator to copy

Definition at line 107 of file grid_dist_id_iterator_dec.hpp.

template<typename Decomposition>
grid_dist_id_iterator_dec< Decomposition >::grid_dist_id_iterator_dec ( Decomposition dec,
const size_t(&)  sz[Decomposition::dims] 
)
inline

Constructor of the distributed grid iterator.

Parameters
decDecomposition
szsize of the grid

Definition at line 118 of file grid_dist_id_iterator_dec.hpp.

template<typename Decomposition>
grid_dist_id_iterator_dec< Decomposition >::grid_dist_id_iterator_dec ( Decomposition dec,
const size_t(&)  sz[Decomposition::dims],
grid_key_dx< Decomposition::dims >  start,
grid_key_dx< Decomposition::dims >  stop 
)
inline

Constructor of the distributed grid iterator.

Parameters
decDecomposition
szsize of the grid
startpoint
stoppoint

Definition at line 142 of file grid_dist_id_iterator_dec.hpp.

Member Function Documentation

template<typename Decomposition>
grid_key_dx<Decomposition::dims> grid_dist_id_iterator_dec< Decomposition >::get ( )
inline

Get the actual global key of the grid.

Returns
the global position in the grid

Definition at line 214 of file grid_dist_id_iterator_dec.hpp.

template<typename Decomposition>
grid_dist_key_dx<Decomposition::dims> grid_dist_id_iterator_dec< Decomposition >::get_dist ( )
inline

Get the actual grid key for a distributed grid.

Note
if you are using this iterator and you need the position for grid_dist_id use this function to retrieve the grid point
Returns
the grid point

Definition at line 237 of file grid_dist_id_iterator_dec.hpp.

template<typename Decomposition>
grid_dist_key_dx<Decomposition::dims> grid_dist_id_iterator_dec< Decomposition >::get_int ( )
inlineprivate

Get the actual key.

Returns
the actual key

Definition at line 76 of file grid_dist_id_iterator_dec.hpp.

template<typename Decomposition>
Decomposition::stype grid_dist_id_iterator_dec< Decomposition >::getSpacing ( size_t  i)
inline

Get the spacing of the grid.

Parameters
i

Definition at line 203 of file grid_dist_id_iterator_dec.hpp.

template<typename Decomposition>
grid_key_dx<Decomposition::dims> grid_dist_id_iterator_dec< Decomposition >::getStart ( )
inline

Get the starting point of the sub-grid we are iterating.

Returns
the starting point

Definition at line 247 of file grid_dist_id_iterator_dec.hpp.

template<typename Decomposition>
grid_key_dx<Decomposition::dims> grid_dist_id_iterator_dec< Decomposition >::getStop ( )
inline

Get the starting point of the sub-grid we are iterating.

Returns
the stop point

Definition at line 257 of file grid_dist_id_iterator_dec.hpp.

template<typename Decomposition>
bool grid_dist_id_iterator_dec< Decomposition >::isNext ( )
inline

Check if there is the next element.

Returns
true if there is the next, false otherwise

Definition at line 188 of file grid_dist_id_iterator_dec.hpp.

template<typename Decomposition>
grid_dist_id_iterator_dec<Decomposition>& grid_dist_id_iterator_dec< Decomposition >::operator++ ( )
inline

Get the next element.

Returns
the next grid_key

Definition at line 164 of file grid_dist_id_iterator_dec.hpp.

template<typename Decomposition>
grid_dist_id_iterator_dec<Decomposition>& grid_dist_id_iterator_dec< Decomposition >::operator= ( const grid_dist_id_iterator_dec< Decomposition > &  tmp)
inline

Copy operator=.

Parameters
tmpiterator to copy
Returns
itself

Definition at line 90 of file grid_dist_id_iterator_dec.hpp.

template<typename Decomposition>
void grid_dist_id_iterator_dec< Decomposition >::selectValidGrid ( )
inlineprivate

from g_c increment g_c until you find a valid grid

Definition at line 47 of file grid_dist_id_iterator_dec.hpp.


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