Severe bug using write_data and the sphere atom style

Hi all,

When using the write_data command, I found a major problem in the ‘Atoms’ section of the output file. The problem is caused by duplication of x[i][0] in AtomVecSphere::PackData. The buffer therefore contains 11 lines, but only 10 are expected in AtomVecSphere::WriteData. The z coordinate is therefore being cast as an integer flag and the last image flag is being omitted entirely.

To fix this, change the affected lines in AtomVecSphere::PackData to the following:

buf[i][4] = x[i][0];
buf[i][5] = x[i][1];
buf[i][6] = x[i][2];
buf[i][7] = (image[i] & IMGMASK) - IMGMAX;
buf[i][8] = (image[i] >> IMGBITS & IMGMASK) - IMGMAX;
buf[i][9] = (image[i] >> IMG2BITS) - IMGMAX;


Kevin Hanley

Post-doctoral researcher
Dept. of Civil and Environmental Engineering
Imperial College London, SW7 2AZ

made the change, will be in next patch

thanks for catching it