TAD Event Transition Bug

Hello,

I appear to have discovered a bug in how TAD performs events. In lammps-6Mar14, TAD correctly detects the first series of possible events then transitions to the appropriate lowest time event. However, when it restores the lowest time event in order to find the next basin, it incorrectly assigns the unwrapped x position, causing it to believe it has crossed the periodic boundary the maximum number of times in the x direction (511). This has two effects: first, the atoms appear to be in the right place, even though they are shifted; second, every nevent steps when it quenches, it believes that an event has occurred, regardless of what the system actually looks like.

I think I have isolated the problem to:

tad.cpp->perform_event(int ievent);

fix_event.cpp->restore_event();

image[i] = ((imageint) IMGMAX << IMG2BITS) |
((imageint) IMGMAX << IMGBITS) | IMGMASK;

I believe it should instead be:
image[i] = ((imageint) IMGMAX << IMG2BITS) |
((imageint) IMGMAX << IMGBITS) | IMGMAX;

I will freely admit that I am not sure if IMGMASK serves a purpose there but it is definitely causing the max x periodic boundary amount. Instead of image defaulting to 537395712 which represents box:(0,0,0), it defaults to 537396223 which is interpreted as box:(511,0,0), the maximum amount allowed under these lammps settings.

To show you the bug, I’ll provide an example of the current simulation I am running. I am happy to provide more information about the input script or data file if it is helpful, I just didn’t want to over complicate this message.

Input Script Highlights:

I believe it should instead be:
image[i] = ((imageint) IMGMAX << IMG2BITS) |
((imageint) IMGMAX << IMGBITS) | IMGMAX;

yes, good catch, that’s a typo with IMGMASK vs IMGMAX

I think we hadn’t seen it before, b/c atoms don’t often
cross boundaries in many TAD simulations.

thanks,

Steve