OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
grid_dist_id_iterator_dec< Decomposition, ghost_or_domain > Class Template Reference

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

Detailed Description

template<typename Decomposition, bool ghost_or_domain = false>
class grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >

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, ghost_or_domain >:

Public Member Functions

grid_dist_id_iterator_dec< Decomposition > & operator= (const grid_dist_id_iterator_dec< Decomposition > &tmp)
 Copy operator=.
 
 grid_dist_id_iterator_dec (const grid_dist_id_iterator_dec< Decomposition > &tmp)
 Copy constructor.
 
 grid_dist_id_iterator_dec (Decomposition &dec, const size_t(&sz)[Decomposition::dims])
 Constructor of the distributed grid iterator.
 
 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.
 
bool isNextGrid ()
 Return true if we point to a valid grid.
 
size_t getGridId ()
 Return the index of the grid in which we are iterating.
 
void nextGrid ()
 next grid
 
Box< Decomposition::dims, size_t > getGridBox ()
 Return the actual pointed grid.
 
grid_dist_id_iterator_dec< Decomposition, ghost_or_domain > & operator++ ()
 Get the next element.
 
bool isNext ()
 Check if there is the next element.
 
Decomposition::stype getSpacing (size_t i)
 Get the spacing of the grid.
 
grid_key_dx< Decomposition::dims > get ()
 Get the actual global key of the grid.
 
Point< Decomposition::dims, typename Decomposition::stype > getPoint ()
 Return the point coordinates.
 
grid_dist_key_dx< Decomposition::dims > get_dist ()
 Get the actual grid key for a distributed grid.
 
grid_key_dx< Decomposition::dims > getStart ()
 Get the starting point of the sub-grid we are iterating.
 
grid_key_dx< Decomposition::dims > getStop ()
 Get the starting point of the sub-grid we are iterating.
 

Private Member Functions

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

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.
 
Box< Decomposition::dims, typename Decomposition::stype > domain
 Domain.
 

Constructor & Destructor Documentation

◆ grid_dist_id_iterator_dec() [1/3]

template<typename Decomposition , bool ghost_or_domain = false>
grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::grid_dist_id_iterator_dec ( const grid_dist_id_iterator_dec< Decomposition > &  tmp)
inline

Copy constructor.

Parameters
tmpiterator to copy

Definition at line 111 of file grid_dist_id_iterator_dec.hpp.

◆ grid_dist_id_iterator_dec() [2/3]

template<typename Decomposition , bool ghost_or_domain = false>
grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::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 122 of file grid_dist_id_iterator_dec.hpp.

◆ grid_dist_id_iterator_dec() [3/3]

template<typename Decomposition , bool ghost_or_domain = false>
grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::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 148 of file grid_dist_id_iterator_dec.hpp.

◆ ~grid_dist_id_iterator_dec()

template<typename Decomposition , bool ghost_or_domain = false>
grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::~grid_dist_id_iterator_dec ( )
inline

Definition at line 162 of file grid_dist_id_iterator_dec.hpp.

Member Function Documentation

◆ get()

template<typename Decomposition , bool ghost_or_domain = false>
grid_key_dx< Decomposition::dims > grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::get ( )
inline

Get the actual global key of the grid.

Returns
the global position in the grid

Definition at line 272 of file grid_dist_id_iterator_dec.hpp.

◆ get_dist()

template<typename Decomposition , bool ghost_or_domain = false>
grid_dist_key_dx< Decomposition::dims > grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::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 313 of file grid_dist_id_iterator_dec.hpp.

◆ get_int()

template<typename Decomposition , bool ghost_or_domain = false>
grid_dist_key_dx< Decomposition::dims > grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::get_int ( )
inlineprivate

Get the actual key.

Returns
the actual key

Definition at line 78 of file grid_dist_id_iterator_dec.hpp.

◆ getGridBox()

template<typename Decomposition , bool ghost_or_domain = false>
Box< Decomposition::dims, size_t > grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::getGridBox ( )
inline

Return the actual pointed grid.

Returns
the grid index

Definition at line 200 of file grid_dist_id_iterator_dec.hpp.

◆ getGridId()

template<typename Decomposition , bool ghost_or_domain = false>
size_t grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::getGridId ( )
inline

Return the index of the grid in which we are iterating.

Definition at line 180 of file grid_dist_id_iterator_dec.hpp.

◆ getPoint()

template<typename Decomposition , bool ghost_or_domain = false>
Point< Decomposition::dims, typename Decomposition::stype > grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::getPoint ( )
inline

Return the point coordinates.

Returns
the point

Definition at line 292 of file grid_dist_id_iterator_dec.hpp.

◆ getSpacing()

template<typename Decomposition , bool ghost_or_domain = false>
Decomposition::stype grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::getSpacing ( size_t  i)
inline

Get the spacing of the grid.

Parameters
i

Definition at line 261 of file grid_dist_id_iterator_dec.hpp.

◆ getStart()

template<typename Decomposition , bool ghost_or_domain = false>
grid_key_dx< Decomposition::dims > grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::getStart ( )
inline

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

Returns
the starting point

Definition at line 323 of file grid_dist_id_iterator_dec.hpp.

◆ getStop()

template<typename Decomposition , bool ghost_or_domain = false>
grid_key_dx< Decomposition::dims > grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::getStop ( )
inline

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

Returns
the stop point

Definition at line 333 of file grid_dist_id_iterator_dec.hpp.

◆ isNext()

template<typename Decomposition , bool ghost_or_domain = false>
bool grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::isNext ( )
inline

Check if there is the next element.

Returns
true if there is the next, false otherwise

Definition at line 246 of file grid_dist_id_iterator_dec.hpp.

◆ isNextGrid()

template<typename Decomposition , bool ghost_or_domain = false>
bool grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::isNextGrid ( )
inline

Return true if we point to a valid grid.

Returns
true if valid grid

Definition at line 171 of file grid_dist_id_iterator_dec.hpp.

◆ nextGrid()

template<typename Decomposition , bool ghost_or_domain = false>
void grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::nextGrid ( )
inline

next grid

Definition at line 189 of file grid_dist_id_iterator_dec.hpp.

◆ operator++()

template<typename Decomposition , bool ghost_or_domain = false>
grid_dist_id_iterator_dec< Decomposition, ghost_or_domain > & grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::operator++ ( )
inline

Get the next element.

Returns
the next grid_key

Definition at line 222 of file grid_dist_id_iterator_dec.hpp.

◆ operator=()

template<typename Decomposition , bool ghost_or_domain = false>
grid_dist_id_iterator_dec< Decomposition > & grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::operator= ( const grid_dist_id_iterator_dec< Decomposition > &  tmp)
inline

Copy operator=.

Parameters
tmpiterator to copy
Returns
itself

Definition at line 92 of file grid_dist_id_iterator_dec.hpp.

◆ selectValidGrid()

template<typename Decomposition , bool ghost_or_domain = false>
void grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::selectValidGrid ( )
inlineprivate

from g_c increment g_c until you find a valid grid

Definition at line 49 of file grid_dist_id_iterator_dec.hpp.

Field Documentation

◆ a_it

template<typename Decomposition , bool ghost_or_domain = false>
grid_key_dx_iterator_sub<Decomposition::dims> grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::a_it
private

Actual iterator.

Definition at line 32 of file grid_dist_id_iterator_dec.hpp.

◆ domain

template<typename Decomposition , bool ghost_or_domain = false>
Box<Decomposition::dims,typename Decomposition::stype> grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::domain
private

Domain.

Definition at line 44 of file grid_dist_id_iterator_dec.hpp.

◆ g_c

template<typename Decomposition , bool ghost_or_domain = false>
size_t grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::g_c
private

grid list counter

Definition at line 26 of file grid_dist_id_iterator_dec.hpp.

◆ gdb_ext

template<typename Decomposition , bool ghost_or_domain = false>
openfpm::vector<GBoxes<Decomposition::dims> > grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::gdb_ext
private

Extension of each grid: domain and ghost + domain.

Definition at line 29 of file grid_dist_id_iterator_dec.hpp.

◆ spacing

template<typename Decomposition , bool ghost_or_domain = false>
Decomposition::stype grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::spacing[Decomposition::dims]
private

Spacing.

Definition at line 41 of file grid_dist_id_iterator_dec.hpp.

◆ start

template<typename Decomposition , bool ghost_or_domain = false>
grid_key_dx<Decomposition::dims> grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::start
private

start key

Definition at line 35 of file grid_dist_id_iterator_dec.hpp.

◆ stop

template<typename Decomposition , bool ghost_or_domain = false>
grid_key_dx<Decomposition::dims> grid_dist_id_iterator_dec< Decomposition, ghost_or_domain >::stop
private

stop key

Definition at line 38 of file grid_dist_id_iterator_dec.hpp.


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