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_iterator_sub< dim, device_grid > Class Template Reference

Distributed grid iterator. More...

Detailed Description

template<unsigned int dim, typename device_grid>
class grid_dist_iterator_sub< dim, device_grid >

Distributed grid iterator.

Iterator across the local elements of the distributed grid

Template Parameters
dimdimensionality of the grid
device_gridtype of basic grid
implimplementation

Definition at line 22 of file grid_dist_id_iterator_sub.hpp.

#include <grid_dist_id_iterator_sub.hpp>

Data Structures

struct  sub_set
 

Public Member Functions

grid_dist_iterator_sub< dim,
device_grid > & 
operator= (const grid_dist_iterator_sub< dim, device_grid > &tmp)
 Copy operator=. More...
 
 grid_dist_iterator_sub (const grid_dist_iterator_sub< dim, device_grid > &tmp)
 Copy constructor. More...
 
 grid_dist_iterator_sub (const grid_key_dx< dim > &start, const grid_key_dx< dim > &stop, const openfpm::vector< device_grid > &gk, const openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext)
 Constructor of the distributed grid iterator. More...
 
grid_dist_iterator_sub< dim,
device_grid > & 
operator++ ()
 Get the next element. More...
 
bool isNext ()
 Check if there is the next element. More...
 
grid_dist_key_dx< dim > get ()
 Get the actual key. More...
 
grid_key_dx< dim > getGKey (const grid_dist_key_dx< dim > &k)
 Convert a g_dist_key_dx into a global key. More...
 
grid_key_dx< dim > getStart () const
 
grid_key_dx< dim > getStop () const
 
size_t N_loc_grid ()
 Return the number of local grids. More...
 
size_t loc_grid_info_start (size_t i, size_t j)
 Return the component j of the starting point (P1) of the domain part for the local grid i. More...
 
size_t loc_grid_info_size (size_t i, size_t j)
 Return the component j of the stop point (P2) of the domain part for the local grid i. More...
 

Private Member Functions

bool compute_subset (size_t gc, grid_key_dx< dim > &start_c, grid_key_dx< dim > &stop_c)
 compute the subset where it has to iterate More...
 
void selectValidGrid ()
 from g_c increment g_c until you find a valid grid More...
 

Private Attributes

size_t g_c
 grid list counter
 
const openfpm::vector
< device_grid > & 
gList
 List of the grids we are going to iterate.
 
const openfpm::vector< GBoxes
< device_grid::dims > > & 
gdb_ext
 Extension of each grid: domain and ghost + domain.
 
grid_key_dx_iterator_sub< dim > a_it
 Actual iterator.
 
grid_key_dx< dim > start
 start key
 
grid_key_dx< dim > stop
 stop key
 

Constructor & Destructor Documentation

template<unsigned int dim, typename device_grid>
grid_dist_iterator_sub< dim, device_grid >::grid_dist_iterator_sub ( const grid_dist_iterator_sub< dim, device_grid > &  tmp)
inline

Copy constructor.

Parameters
tmpiterator to copy

Definition at line 131 of file grid_dist_id_iterator_sub.hpp.

template<unsigned int dim, typename device_grid>
grid_dist_iterator_sub< dim, device_grid >::grid_dist_iterator_sub ( const grid_key_dx< dim > &  start,
const grid_key_dx< dim > &  stop,
const openfpm::vector< device_grid > &  gk,
const openfpm::vector< GBoxes< device_grid::dims >> &  gdb_ext 
)
inline

Constructor of the distributed grid iterator.

Parameters
startposition
stopposition
gkstd::vector of the local grid
gdb_extinformation about the local grids

Definition at line 149 of file grid_dist_id_iterator_sub.hpp.

Member Function Documentation

template<unsigned int dim, typename device_grid>
bool grid_dist_iterator_sub< dim, device_grid >::compute_subset ( size_t  gc,
grid_key_dx< dim > &  start_c,
grid_key_dx< dim > &  stop_c 
)
inlineprivate

compute the subset where it has to iterate

Parameters
gcActual grid
start_cadjusted start point for the grid g_c
stop_cadjusted stop point for the grid g_c
Returns
false if the sub-set does not contain points

Definition at line 60 of file grid_dist_id_iterator_sub.hpp.

template<unsigned int dim, typename device_grid>
grid_dist_key_dx<dim> grid_dist_iterator_sub< dim, device_grid >::get ( )
inline

Get the actual key.

Returns
the actual key

Definition at line 207 of file grid_dist_id_iterator_sub.hpp.

template<unsigned int dim, typename device_grid>
grid_key_dx<dim> grid_dist_iterator_sub< dim, device_grid >::getGKey ( const grid_dist_key_dx< dim > &  k)
inline

Convert a g_dist_key_dx into a global key.

See Also
grid_dist_key_dx
grid_dist_iterator
Returns
the global position in the grid

Definition at line 220 of file grid_dist_id_iterator_sub.hpp.

template<unsigned int dim, typename device_grid>
bool grid_dist_iterator_sub< dim, device_grid >::isNext ( )
inline

Check if there is the next element.

Returns
true if there is the next, false otherwise

Definition at line 192 of file grid_dist_id_iterator_sub.hpp.

template<unsigned int dim, typename device_grid>
size_t grid_dist_iterator_sub< dim, device_grid >::loc_grid_info_size ( size_t  i,
size_t  j 
)
inline

Return the component j of the stop point (P2) of the domain part for the local grid i.

Parameters
ilocal grid
jdimension

Definition at line 283 of file grid_dist_id_iterator_sub.hpp.

template<unsigned int dim, typename device_grid>
size_t grid_dist_iterator_sub< dim, device_grid >::loc_grid_info_start ( size_t  i,
size_t  j 
)
inline

Return the component j of the starting point (P1) of the domain part for the local grid i.

Parameters
ilocal grid
jdimension

Definition at line 270 of file grid_dist_id_iterator_sub.hpp.

template<unsigned int dim, typename device_grid>
size_t grid_dist_iterator_sub< dim, device_grid >::N_loc_grid ( )
inline

Return the number of local grids.

Definition at line 257 of file grid_dist_id_iterator_sub.hpp.

template<unsigned int dim, typename device_grid>
grid_dist_iterator_sub<dim,device_grid>& grid_dist_iterator_sub< dim, device_grid >::operator++ ( )
inline

Get the next element.

Returns
the next grid_key

Definition at line 168 of file grid_dist_id_iterator_sub.hpp.

template<unsigned int dim, typename device_grid>
grid_dist_iterator_sub<dim,device_grid>& grid_dist_iterator_sub< dim, device_grid >::operator= ( const grid_dist_iterator_sub< dim, device_grid > &  tmp)
inline

Copy operator=.

Parameters
tmpiterator to copy

Definition at line 114 of file grid_dist_id_iterator_sub.hpp.

template<unsigned int dim, typename device_grid>
void grid_dist_iterator_sub< dim, device_grid >::selectValidGrid ( )
inlineprivate

from g_c increment g_c until you find a valid grid

Definition at line 89 of file grid_dist_id_iterator_sub.hpp.


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