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!
mschramm | Wed, 10/16/2019 - 20:23
atom class
Hello,
coordinates are stored in atom
#include "atom.h"
int nlocal = atom->nlocal; // Number of atoms on this processor
double **x = atom->x; // x-cords
double **y = atom->y; // y-cords
double **z = atom->z; // z-cords
Daniel Queteschiner | Thu, 10/17/2019 - 09:20
atom class
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 atomi
would be accessed likedouble xi = atom->x[i][0];
double yi = atom->x[i][1];
double zi = atom->x[i][2];
mschramm | Thu, 10/17/2019 - 23:57
Correct
Sorry about that...
just atom->x for coordinates.