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

Distributed grid iterator. More...

Detailed Description

template<unsigned int dim, typename device_grid, typename stencil>
class grid_dist_iterator< dim, device_grid, FREE, stencil >

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 45 of file grid_dist_id_iterator.hpp.

#include <grid_dist_id_iterator.hpp>

Public Member Functions

 grid_dist_iterator (openfpm::vector< device_grid > &gk, const openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext, const grid_key_dx< dim > &stop)
 Constructor of the distributed grid iterator. More...
 
 grid_dist_iterator (openfpm::vector< device_grid > &gk, const openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext, const grid_key_dx< dim > &stop, const grid_key_dx< dim >(&stencil_pnt)[stencil::nsp])
 Constructor of the distributed grid iterator with stencil support. More...
 
grid_dist_iterator< dim,
device_grid, FREE, stencil > & 
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 > getStop () const
 it return the stop point of the iterator More...
 
grid_key_dx< dim > getStart () const
 it return the start point of the iterator More...
 
const openfpm::vector< GBoxes
< device_grid::dims > > & 
getGBoxes ()
 Get the boxes. More...
 
grid_key_dx< dim > getGKey (const grid_dist_key_dx< dim > &k)
 Convert a g_dist_key_dx into a global key. More...
 
template<unsigned int id>
grid_dist_lin_dx getStencil ()
 Return the stencil point offset. More...
 

Private Member Functions

void selectValidGrid ()
 from g_c increment g_c until you find a valid grid More...
 

Private Attributes

size_t g_c
 grid list counter
 
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,
stencil > 
a_it
 Actual iterator.
 
grid_key_dx< dim > stop
 stop point (is the grid size)
 

Constructor & Destructor Documentation

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

Constructor of the distributed grid iterator.

Parameters
gkstd::vector of the local grid
gdb_extset of local subdomains
stopend point

Definition at line 87 of file grid_dist_id_iterator.hpp.

template<unsigned int dim, typename device_grid , typename stencil >
grid_dist_iterator< dim, device_grid, FREE, stencil >::grid_dist_iterator ( openfpm::vector< device_grid > &  gk,
const openfpm::vector< GBoxes< device_grid::dims >> &  gdb_ext,
const grid_key_dx< dim > &  stop,
const grid_key_dx< dim >(&)  stencil_pnt[stencil::nsp] 
)
inline

Constructor of the distributed grid iterator with stencil support.

Parameters
gkstd::vector of the local grid
gdb_extset of local subdomains
stopend point
stencil_pntstencil points

Definition at line 104 of file grid_dist_id_iterator.hpp.

Member Function Documentation

template<unsigned int dim, typename device_grid , typename stencil >
grid_dist_key_dx<dim> grid_dist_iterator< dim, device_grid, FREE, stencil >::get ( )
inline

Get the actual key.

Returns
the actual key

Definition at line 165 of file grid_dist_id_iterator.hpp.

template<unsigned int dim, typename device_grid , typename stencil >
const openfpm::vector<GBoxes<device_grid::dims> >& grid_dist_iterator< dim, device_grid, FREE, stencil >::getGBoxes ( )
inline

Get the boxes.

Get the boxes that define the local grids

Returns
Vector of local boxes

Definition at line 205 of file grid_dist_id_iterator.hpp.

template<unsigned int dim, typename device_grid , typename stencil >
grid_key_dx<dim> grid_dist_iterator< dim, device_grid, FREE, stencil >::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
Parameters
kkey position in local coordinates
Returns
the global position in the grid

Definition at line 220 of file grid_dist_id_iterator.hpp.

template<unsigned int dim, typename device_grid , typename stencil >
grid_key_dx<dim> grid_dist_iterator< dim, device_grid, FREE, stencil >::getStart ( ) const
inline

it return the start point of the iterator

The start point of the iterator is the point with all coordinates zeros

Returns
the start point

Definition at line 189 of file grid_dist_id_iterator.hpp.

template<unsigned int dim, typename device_grid , typename stencil >
template<unsigned int id>
grid_dist_lin_dx grid_dist_iterator< dim, device_grid, FREE, stencil >::getStencil ( )
inline

Return the stencil point offset.

Template Parameters
id
Returns
linearized distributed key

Definition at line 240 of file grid_dist_id_iterator.hpp.

template<unsigned int dim, typename device_grid , typename stencil >
grid_key_dx<dim> grid_dist_iterator< dim, device_grid, FREE, stencil >::getStop ( ) const
inline

it return the stop point of the iterator

The stop point of the iterator is just the grid size

Returns
the stop point

Definition at line 177 of file grid_dist_id_iterator.hpp.

template<unsigned int dim, typename device_grid , typename stencil >
bool grid_dist_iterator< dim, device_grid, FREE, stencil >::isNext ( )
inline

Check if there is the next element.

Returns
true if there is the next, false otherwise

Definition at line 150 of file grid_dist_id_iterator.hpp.

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

Get the next element.

Returns
the next grid_key

Definition at line 126 of file grid_dist_id_iterator.hpp.

template<unsigned int dim, typename device_grid , typename stencil >
void grid_dist_iterator< dim, device_grid, FREE, stencil >::selectValidGrid ( )
inlineprivate

from g_c increment g_c until you find a valid grid

Definition at line 65 of file grid_dist_id_iterator.hpp.


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