displace_atom rotate needs to operate on unwrapped coordinates with image flags set to zero

This commit is contained in:
Axel Kohlmeyer 2017-05-29 16:57:35 -04:00
parent c0339120d2
commit d93938f7e1
1 changed files with 6 additions and 0 deletions

View File

@ -271,9 +271,15 @@ void DisplaceAtoms::command(int narg, char **arg)
int *body = atom->body;
int *mask = atom->mask;
int nlocal = atom->nlocal;
imageint *image = atom->image;
for (i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
// unwrap coordinate and reset image flags accordingly
domain->unmap(x[i],image[i]);
image[i] = ((imageint) IMGMAX << IMG2BITS) |
((imageint) IMGMAX << IMGBITS) | IMGMAX;
d[0] = x[i][0] - point[0];
d[1] = x[i][1] - point[1];
d[2] = x[i][2] - point[2];