8 #ifndef SRC_GRID_GRID_DIST_ID_ITERATOR_DEC_HPP_ 
    9 #define SRC_GRID_GRID_DIST_ID_ITERATOR_DEC_HPP_ 
   11 #include "grid_dist_id_iterator.hpp" 
   12 #include "Grid/grid_dist_util.hpp" 
   13 #include "grid_dist_id_iterator_util.hpp" 
   22 template<
typename Decomposition>
 
   41     typename Decomposition::stype 
spacing[Decomposition::dims];
 
   59         if (g_c < gdb_ext.size())
 
   62             size_t sz[Decomposition::dims];
 
   63             for (
size_t i = 0 ; i < Decomposition::dims ; i++)
 
   64                 sz[i] = gdb_ext.
get(g_c).GDbox.getP2()[i] + 1;
 
  123         for (
size_t i = 0 ; i < Decomposition::dims ; i++)
 
  127         create_gdb_ext<Decomposition::dims,Decomposition>(
gdb_ext,dec,sz,dec.getDomain(),
spacing);
 
  143     :
g_c(0),start(start),stop(stop)
 
  146         create_gdb_ext<Decomposition::dims,Decomposition>(
gdb_ext,dec,sz,dec.getDomain(),
spacing);
 
  219         size_t sub_id = k.
getSub();
 
  224         k_glob = k_glob + 
gdb_ext.get(sub_id).origin;
 
grid_dist_id_iterator_dec< Decomposition > & operator=(const grid_dist_id_iterator_dec< Decomposition > &tmp)
Copy operator=. 
 
Decomposition::stype spacing[Decomposition::dims]
Spacing. 
 
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. 
 
Given the decomposition it create an iterator. 
 
grid_dist_key_dx< Decomposition::dims > get_int()
Get the actual key. 
 
grid_dist_key_dx< Decomposition::dims > get_dist()
Get the actual grid key for a distributed grid. 
 
Grid key for a distributed grid. 
 
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. 
 
grid_key_dx< Decomposition::dims > start
start key 
 
bool isNext()
Check if there is the next element. 
 
mem_id get(size_t i) const 
Get the i index. 
 
size_t g_c
grid list counter 
 
This class define the domain decomposition interface. 
 
Decomposition::stype getSpacing(size_t i)
Get the spacing of the grid. 
 
grid_dist_id_iterator_dec< Decomposition > & operator++()
Get the next element. 
 
openfpm::vector< GBoxes< Decomposition::dims > > gdb_ext
Extension of each grid: domain and ghost + domain. 
 
grid_key_dx< Decomposition::dims > getStart()
Get the starting point of the sub-grid we are iterating. 
 
void zero()
Set to zero the key. 
 
grid_key_dx< Decomposition::dims > stop
stop key 
 
grid_key_dx_iterator_sub< Decomposition::dims > a_it
Actual iterator. 
 
grid_key_dx< dim > get() const 
Return the actual grid key iterator. 
 
grid_key_dx< Decomposition::dims > getStop()
Get the starting point of the sub-grid we are iterating. 
 
void set_d(size_t i, mem_id id)
Set the i index. 
 
Implementation of 1-D std::vector like structure. 
 
bool isNext()
Check if there is the next element. 
 
void selectValidGrid()
from g_c increment g_c until you find a valid grid 
 
size_t getSub() const 
Get the local grid. 
 
void reinitialize(const grid_key_dx_iterator_sub< dim > &g_s_it)
Reinitialize the iterator. 
 
grid_key_dx< dim > getKey() const 
Get the key.