[lammps-users] nearest neighbor interpolation onto a regular grid

Hi all.

I'd like to be able to interpolate atomic quantities (energy, stress, velocity, etc) onto a regular grid which has roughly the same spacing as the particles (but slightly finer... double counting quantities should be OK). I'd rather have the grid be Lagrangian in the sense that it keeps track of the particles which started life near the grid points at some "zero time", but this isn't *so* critical. The regular grid is needed because I'd like to do FFTs eventually. I'm doing all of this in post-processing now but am getting to system sizes where the post-processing doesn't take a reasonable amount of memory or time. I could do things in an embarrassingly parallel way, but I would be duplicating a lot of what is taken care of automatically in LAMMPS (neighbor lists, setting up virtual particles in the skins of cells, etc.).

I was wondering what the best starting point would be for implementing this. I see that there is a fix_ave_spatial which does something close to what I want, but for a single 2D slice rather than a full 3D grid. Or would looking at the Ewald sum code be a better starting place?