Access to all particle coordinates at a specific timestep

Submitted by aishk on Fri, 10/11/2019 - 23:10

Hello,

Is there a way to access the coordinates of all particles in the simulation at a particular timestep in the code? Also, is this done by the neighbor list or the atomVec class? Are they all stored in some array that I can access easily within the source-code?

I tried looking into how dump_custom_vtk works to display the particle coordinates to the .vtk file but I did not find anything.

If this coordinate storage is done by the neighbor list, is there some calculation needed to get global coordinates instead of local coordinates?

Thanks!

Daniel Queteschiner | Thu, 10/17/2019 - 09:20

It is just double **x = atom->x; // x,y,z coordinates, there are no separate y- or z-coordinate arrays.
atom->x; is basically a 2-dimensional array and the coordinates of atom i would be accessed like
double xi = atom->x[i][0];
double yi = atom->x[i][1];
double zi = atom->x[i][2];