[lammps-users] image flags

Dear Lammps,

I am trying to understand how to assign image flags in fix_rigid.
1. How can I assign an image flag value? I tried the following code to force certain image flag values.

  int box = -2;
  for ( int j=0; j<3; j++ )
       xdata[j] = atom->x[0][j];

     int imagedata = ((box + 512 & 1023) << 20) |
       ((box + 512 & 1023) << 10) | (box + 512 & 1023);

     domain->remap(xdata,imagedata);
   }

My understanding was that this would force the image flag values to be -2, but later when I convert the contents of atom->image into xbox, ybox and zbox and print the values, I do not see that at all.

2. Where in fix_rigid.cpp are the image flags reassigned? I only see code for converting atom->image into xbox, etc, but not the other way around.

Any help with this is greatly appreciated!

Cheers,
Joyce

Please disregard the below email. I figured out my error with the code.

Thanks,
Joyce

Joyce Noah-Vanhoucke wrote:

Image flags are not changed in fix rigid, or any other fix.
They only change when atoms move thru the periodic
boundary which happens only when neighbor lists are
re-built, in domain.cpp. You can access the image
flags, as fix rigid does, to unwrap a molecule, but
you shouldn't change them.

Steve