1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-16 14:57:05 +01:00

Fix for chris kellys request to peek poke on checkerboarded fields

This commit is contained in:
paboyle
2016-07-14 23:44:48 +01:00
parent 9db2c6525d
commit 42af132dab
2 changed files with 19 additions and 7 deletions

View File

@ -221,6 +221,18 @@ protected:
return idx;
};
virtual int iIndex(std::vector<int> &lcoor)
{
int idx=0;
for(int d=0;d<_ndimension;d++) {
if( d==_checker_dim ) {
idx+=_istride[d]*(lcoor[d]/(2*_rdimensions[d]));
} else {
idx+=_istride[d]*(lcoor[d]/_rdimensions[d]);
}
}
return idx;
}
};
}