Local grid point to array index PPPM

Hi all,

Is there a function that takes the input of the grid coordinates x, y, and z that spits outs the location in the array 1 to N for the grid used in PPPM (in other words, the index position in the array)? If not, can someone confirm that index = x + yNGRIDx + zNGRIDx*NGRIDy?


I suggest you look in the pppm.cpp code to see how it does this operation,
e.g. when it interpolates charge to the grid.