Commit 2d360317 authored by incardon's avatar incardon
Browse files

Fixing stencil operator

parent 261069df
......@@ -181,6 +181,8 @@ void test_stencil_sub_iterator(grid_sm<3,void> & g_sm)
while (gsi.isNext() == true)
{
auto key = gsi.get();
size_t lin1 = gsi.getStencil<0>();
size_t lin2 = gsi.getStencil<1>();
size_t lin3 = gsi.getStencil<2>();
......@@ -200,6 +202,8 @@ void test_stencil_sub_iterator(grid_sm<3,void> & g_sm)
ret &= (sum == 0);
ret &= g_sm.LinId(key) == (long int)lin1;
++gsi;
}
......
......@@ -36,10 +36,6 @@ class grid_key_dx_iterator
//! information of the grid where this iterator iterate
grid_sm<dim,void> grid_base;
//! Additional operation and information in case we do stencil
//! operations
stencil stl_code;
/*! \brief return the index i of the gk key
*
* \param i index to get
......@@ -58,6 +54,10 @@ protected:
//! Actual key
grid_key_dx<dim> gk;
//! Additional operation and information in case we do stencil
//! operations
stencil stl_code;
public:
/*! \brief Default constructor
......
......@@ -401,6 +401,8 @@ public:
size_t id = this->gk.get(0);
this->gk.set_d(0,id+1);
this->stl_code.increment();
//! check the overflow of all the index with exception of the last dimensionality
long int i = 0;
......@@ -412,9 +414,12 @@ public:
{
// ! overflow, increment the next index
size_t idr = this->gk.get(i) - gk_start.get(i);
this->gk.set_d(i,gk_start.get(i));
id = this->gk.get(i+1);
this->gk.set_d(i+1,id+1);
this->stl_code.adjust_offset(i,idr,grid_base);
}
else
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment