Grid key class iterator, iterate through a starting linearized grid element to a stop linearized grid element in particular if linearize is the function that linearize all the grid_key_dx, it create an iterator that pass through Linearize^(-1)(start) Linearize^(-1)(start+1) ....... Linearize^(-1)(stop)
dim | dimensionality of the grid |
Usage: In general you never create object directly, but you get it from a grid_cpu or grid_gpu with getIteratorLinStartStop()
Definition at line 28 of file grid_key_dx_iterator_sp.hpp.
#include <grid_key_dx_iterator_sp.hpp>
Public Member Functions | |
template<typename T > | |
grid_key_dx_iterator_sp (grid_sm< dim, T > &g, mem_id from, mem_id to) | |
Constructor require a grid grid<dim,T> | |
bool | isNext () |
Check if there is the next element. | |
Public Member Functions inherited from grid_key_dx_iterator< dim, stencil, linearizer > | |
grid_key_dx_iterator () | |
Default constructor. | |
grid_key_dx_iterator (const grid_key_dx_iterator< dim > &g_it) | |
Constructor from a grid_key_dx_iterator<dim> | |
template<typename grid_lin > | |
grid_key_dx_iterator (const grid_lin &g, const grid_key_dx< dim >(&stencil_pnt)[stencil::nsp]) | |
Constructor require a grid_sm<dim,T> | |
grid_key_dx_iterator (const grid_key_dx< dim >(&stencil_pnt)[stencil::nsp]) | |
Constructor. | |
grid_key_dx_iterator (const linearizer &g) | |
Constructor require a grid_sm<dim,T> | |
grid_key_dx_iterator< dim > | operator= (const grid_key_dx_iterator< dim > &key_it) |
Constructor from another grid_key_dx_iterator. | |
grid_key_dx_iterator< dim, stencil, linearizer > & | operator++ () |
Get the next element. | |
void | set (int d, size_t sz) |
Set the dimension. | |
template<unsigned int id> | |
size_t | getStencil () const |
Get the actual position. | |
bool | isNext () |
Check if there is the next element. | |
const grid_key_dx< dim > & | get () const |
Get the actual key. | |
void | reinitialize (const grid_key_dx_iterator< dim > &key) |
Reinitialize the grid_key_dx_iterator. | |
const linearizer & | getGridInfo () const |
Get the information about the grid. | |
void | reset () |
Reset the iterator (it restart from the beginning) | |
void | calc_stencil_offset (const grid_key_dx< dim > &start_p) |
Calculate the stencil offset. | |
grid_key_dx< dim > | getStart () |
Return the starting point of the iteration. | |
grid_key_dx< dim > | getStop () |
Return the stop point of the iteration. | |
size_t | getVolume () |
Get the volume spanned by this sub-grid iterator. | |
Private Attributes | |
grid_key_dx< dim > | gk_stop |
stop point | |
Additional Inherited Members | |
Protected Attributes inherited from grid_key_dx_iterator< dim, stencil, linearizer > | |
grid_key_dx< dim > | gk |
Actual key. | |
stencil | stl_code |
|
inline |
Constructor require a grid grid<dim,T>
It construct an iterator from one index to another, in particular if linearize is the function that linearize all the grid_key, it create an iterator that pass through Linearize^(-1)(start) Linearize^(-1)(start+1) ....... Linearize^(-1)(stop)
For example for start (1,1) and stop (3,3) the point indicated with # are explored by the iterator
* +-----+-----+-----+-----+-----+-----+ (6,5) | | | | | | | | | | | | | | | | | | | | | +-----+-----+-----+-----+-----+-----+ | | | | | | | | | | | | | | | | | | | | | #-----#-----#-----#-----+-----+-----+ | | | | | | | | | | | | | | | | | | | | | #-----#-----#-----#-----#-----#-----# | | | | | | | | | | | | | | +-----#-----#-----#-----#-----#-----# | | | | | | | | | | | | | | | | | | | | | +-----+-----+-----+-----+-----+-----+ (0,0) * * *
T | type of object that the grid store |
g | Grid on which iterate |
from | starting point |
to | end point |
Convert to a grid_key
Convert to a grid_key
Definition at line 80 of file grid_key_dx_iterator_sp.hpp.
|
inline |
Check if there is the next element.
Check if there is the next element
for all dimensions
check if we still have points
(Final point) we we still have one point
Definition at line 98 of file grid_key_dx_iterator_sp.hpp.
|
private |
stop point
Definition at line 31 of file grid_key_dx_iterator_sp.hpp.