8 #ifndef OPENFPM_DATA_SRC_GRID_ITERATORS_GRID_KEY_DX_ITERATOR_STENCIL_HPP_
9 #define OPENFPM_DATA_SRC_GRID_ITERATORS_GRID_KEY_DX_ITERATOR_STENCIL_HPP_
12 #include "Grid/grid_sm.hpp"
27 template<
unsigned int dim,
unsigned int Np>
33 bool initialized =
false;
83 for (
size_t i = 0 ; i < dim ; i++)
84 {gk.set_d(i,g_it.
get_gk(i));}
88 for (
size_t i = 0 ; i < Np ; i++)
107 for (
size_t i = 0 ; i < Np ; i++)
111 for (
size_t k = 0 ; k < dim ; k++) {zero.
set_d(k,0);}
113 zero = zero + stencil[i];
135 for (
size_t i = 0 ; i < dim ; i++)
136 {gk.set_d(i,key_it.
get_gk(i));}
138 for (
size_t i = 0 ; i < Np ; i++)
154 size_t id = gk.get(0);
158 for (
size_t i = 0 ; i < Np ; i++)
164 for ( ; i < dim-1 ; i++)
166 size_t id = gk.get(i);
171 size_t idr = gk.get(i);
179 for (
size_t k = 0 ; k < Np ; k++)
199 inline void set(
int d,
size_t sz)
247 template<
unsigned int id>
inline size_t get()
const
270 for (
size_t i = 0 ; i < dim ; i++)
276 for (
size_t i = 0 ; i < dim ; i++)
grid_sm< dim, void > grid_base
information about the grid
mem_id LinId(const grid_key_dx< N > &gk, const char sum_id[N]) const
Linearization of the grid_key_dx with a specified shift.
void reset()
Reset the iterator (it restart from the beginning)
grid_key_dx is the key to access any element in the grid
size_t size_s(unsigned int i) const
size_t size() const
Return the size of the grid.
void set(int d, size_t sz)
Set the dimension.
grid_key_dx_iterator_stencil(const grid_sm< dim, T > &g, const grid_key_dx< dim >(&stencil)[Np])
Constructor require a grid_sm<dim,T>
grid_key_dx_iterator_stencil< dim, Np > operator=(const grid_key_dx_iterator_stencil< dim, Np > &key_it)
Constructor from another grid_key_dx_iterator.
grid_key_dx_iterator_stencil< dim, Np > & operator++()
Get the next element.
size_t get_gk(size_t i) const
return the index i of the gk key
grid_key_dx_iterator_stencil(const grid_key_dx_iterator_stencil< dim, Np > &g_it)
Constructor from a grid_key_dx_iterator<dim>
void reinitialize(const grid_key_dx_iterator_stencil< dim, Np > &key)
Reinitialize the grid_key_dx_iterator.
const grid_key_dx< dim > & getLoc() const
Get the actual position.
This class is a trick to indicate the compiler a specific specialization pattern. ...
long int stencil_offset[Np]
set of offsets for the stencil
void set_d(size_t i, mem_id id)
Set the i index.
bool isNext()
Check if there is the next element.
grid_key_dx_iterator_stencil()
Default constructor.