OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
grid_dist_iterator< dim, device_grid, device_sub_it, impl, stencil > Class Template Reference

Distributed grid iterator. More...

Detailed Description

template<unsigned int dim, typename device_grid, typename device_sub_it, int impl, typename stencil = no_stencil>
class grid_dist_iterator< dim, device_grid, device_sub_it, impl, stencil >

Distributed grid iterator.

Iterator across the local elements of the distributed grid

Template Parameters
dimdimensionality of the grid
device_gridtype of basic grid
stencilit inject the code to calculate stencil offset
sub_iteratorit indicate the sub-iterator type of the device_grid

Definition at line 277 of file grid_dist_id_iterator.hpp.

#include <grid_dist_id_iterator.hpp>

Public Member Functions

 grid_dist_iterator (const 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.
 
 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.
 
 grid_dist_iterator (const grid_dist_iterator< dim, device_grid, device_sub_it, impl, stencil > &g)
 Copy constructor.
 
 grid_dist_iterator (grid_dist_iterator< dim, device_grid, device_sub_it, impl, stencil > &&g)
 Copy constructor.
 
 ~grid_dist_iterator ()
 Destructor.
 
grid_dist_iterator< dim, device_grid, device_sub_it, impl, stencil > & operator++ ()
 Get the next element.
 
bool isNext () const
 Check if there is the next element.
 
grid_dist_key_dx< dim, typename device_grid::base_key > get () const
 Get the actual key.
 
grid_key_dx< dim > getStop () const
 it return the stop point of the iterator
 
grid_key_dx< dim > getStart () const
 it return the start point of the iterator
 
const openfpm::vector< GBoxes< device_grid::dims > > & getGBoxes ()
 Get the boxes.
 
grid_key_dx< dim > getGKey (const grid_dist_key_dx< dim, typename device_grid::base_key > &k)
 Convert a g_dist_key_dx into a global key.
 
template<unsigned int id>
grid_dist_lin_dx getStencil ()
 Return the stencil point offset.
 

Private Member Functions

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

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.
 
device_sub_it a_it
 Actual iterator.
 
grid_key_dx< dim > stop
 stop point (is the grid size)
 

Constructor & Destructor Documentation

◆ grid_dist_iterator() [1/4]

template<unsigned int dim, typename device_grid , typename device_sub_it , int impl, typename stencil = no_stencil>
grid_dist_iterator< dim, device_grid, device_sub_it, impl, stencil >::grid_dist_iterator ( const 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 330 of file grid_dist_id_iterator.hpp.

◆ grid_dist_iterator() [2/4]

template<unsigned int dim, typename device_grid , typename device_sub_it , int impl, typename stencil = no_stencil>
grid_dist_iterator< dim, device_grid, device_sub_it, impl, 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 350 of file grid_dist_id_iterator.hpp.

◆ grid_dist_iterator() [3/4]

template<unsigned int dim, typename device_grid , typename device_sub_it , int impl, typename stencil = no_stencil>
grid_dist_iterator< dim, device_grid, device_sub_it, impl, stencil >::grid_dist_iterator ( const grid_dist_iterator< dim, device_grid, device_sub_it, impl, stencil > &  g)
inline

Copy constructor.

Definition at line 362 of file grid_dist_id_iterator.hpp.

◆ grid_dist_iterator() [4/4]

template<unsigned int dim, typename device_grid , typename device_sub_it , int impl, typename stencil = no_stencil>
grid_dist_iterator< dim, device_grid, device_sub_it, impl, stencil >::grid_dist_iterator ( grid_dist_iterator< dim, device_grid, device_sub_it, impl, stencil > &&  g)
inline

Copy constructor.

Definition at line 367 of file grid_dist_id_iterator.hpp.

◆ ~grid_dist_iterator()

template<unsigned int dim, typename device_grid , typename device_sub_it , int impl, typename stencil = no_stencil>
grid_dist_iterator< dim, device_grid, device_sub_it, impl, stencil >::~grid_dist_iterator ( )
inline

Destructor.

Definition at line 372 of file grid_dist_id_iterator.hpp.

Member Function Documentation

◆ get()

template<unsigned int dim, typename device_grid , typename device_sub_it , int impl, typename stencil = no_stencil>
grid_dist_key_dx< dim, typename device_grid::base_key > grid_dist_iterator< dim, device_grid, device_sub_it, impl, stencil >::get ( ) const
inline

Get the actual key.

Returns
the actual key

Definition at line 420 of file grid_dist_id_iterator.hpp.

◆ getGBoxes()

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

Get the boxes.

Get the boxes that define the local grids

Returns
Vector of local boxes

Definition at line 460 of file grid_dist_id_iterator.hpp.

◆ getGKey()

template<unsigned int dim, typename device_grid , typename device_sub_it , int impl, typename stencil = no_stencil>
grid_key_dx< dim > grid_dist_iterator< dim, device_grid, device_sub_it, impl, stencil >::getGKey ( const grid_dist_key_dx< dim, typename device_grid::base_key > &  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 475 of file grid_dist_id_iterator.hpp.

◆ getStart()

template<unsigned int dim, typename device_grid , typename device_sub_it , int impl, typename stencil = no_stencil>
grid_key_dx< dim > grid_dist_iterator< dim, device_grid, device_sub_it, impl, 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 444 of file grid_dist_id_iterator.hpp.

◆ getStencil()

template<unsigned int dim, typename device_grid , typename device_sub_it , int impl, typename stencil = no_stencil>
template<unsigned int id>
grid_dist_lin_dx grid_dist_iterator< dim, device_grid, device_sub_it, impl, stencil >::getStencil ( )
inline

Return the stencil point offset.

Template Parameters
id
Returns
linearized distributed key

Definition at line 495 of file grid_dist_id_iterator.hpp.

◆ getStop()

template<unsigned int dim, typename device_grid , typename device_sub_it , int impl, typename stencil = no_stencil>
grid_key_dx< dim > grid_dist_iterator< dim, device_grid, device_sub_it, impl, 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 432 of file grid_dist_id_iterator.hpp.

◆ isNext()

template<unsigned int dim, typename device_grid , typename device_sub_it , int impl, typename stencil = no_stencil>
bool grid_dist_iterator< dim, device_grid, device_sub_it, impl, stencil >::isNext ( ) const
inline

Check if there is the next element.

Returns
true if there is the next, false otherwise

Definition at line 405 of file grid_dist_id_iterator.hpp.

◆ operator++()

template<unsigned int dim, typename device_grid , typename device_sub_it , int impl, typename stencil = no_stencil>
grid_dist_iterator< dim, device_grid, device_sub_it, impl, stencil > & grid_dist_iterator< dim, device_grid, device_sub_it, impl, stencil >::operator++ ( )
inline

Get the next element.

Returns
the next grid_key

Definition at line 381 of file grid_dist_id_iterator.hpp.

◆ selectValidGrid()

template<unsigned int dim, typename device_grid , typename device_sub_it , int impl, typename stencil = no_stencil>
void grid_dist_iterator< dim, device_grid, device_sub_it, impl, stencil >::selectValidGrid ( )
inlineprivate

from g_c increment g_c until you find a valid grid

Definition at line 297 of file grid_dist_id_iterator.hpp.

Field Documentation

◆ a_it

template<unsigned int dim, typename device_grid , typename device_sub_it , int impl, typename stencil = no_stencil>
device_sub_it grid_dist_iterator< dim, device_grid, device_sub_it, impl, stencil >::a_it
private

Actual iterator.

Definition at line 289 of file grid_dist_id_iterator.hpp.

◆ g_c

template<unsigned int dim, typename device_grid , typename device_sub_it , int impl, typename stencil = no_stencil>
size_t grid_dist_iterator< dim, device_grid, device_sub_it, impl, stencil >::g_c
private

grid list counter

Definition at line 280 of file grid_dist_id_iterator.hpp.

◆ gdb_ext

template<unsigned int dim, typename device_grid , typename device_sub_it , int impl, typename stencil = no_stencil>
const openfpm::vector<GBoxes<device_grid::dims> >& grid_dist_iterator< dim, device_grid, device_sub_it, impl, stencil >::gdb_ext
private

Extension of each grid: domain and ghost + domain.

Definition at line 286 of file grid_dist_id_iterator.hpp.

◆ gList

template<unsigned int dim, typename device_grid , typename device_sub_it , int impl, typename stencil = no_stencil>
const openfpm::vector<device_grid>& grid_dist_iterator< dim, device_grid, device_sub_it, impl, stencil >::gList
private

List of the grids we are going to iterate.

Definition at line 283 of file grid_dist_id_iterator.hpp.

◆ stop

template<unsigned int dim, typename device_grid , typename device_sub_it , int impl, typename stencil = no_stencil>
grid_key_dx<dim> grid_dist_iterator< dim, device_grid, device_sub_it, impl, stencil >::stop
private

stop point (is the grid size)

Definition at line 292 of file grid_dist_id_iterator.hpp.


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