minimum image for bond interaction

Dear Steve or Alex,
I am planning on simulating some polymer system where the bond might
drift aross the periodic boundaries. Unfortunately, I consistently
encountered bond error. And it seems like the error happens when a
bond across a periodic boundary. I have been searching some post on
the mail-list, some one said the minimum image is considered when
lammps calculates bond interactions. But I check the source code of
bond_style, e.g. fene. I got this

double **x = atom->x;
double **f = atom->f;
int **bondlist = neighbor->bondlist;
int nbondlist = neighbor->nbondlist;
int nlocal = atom->nlocal;
int newton_bond = force->newton_bond;

for (n = 0; n < nbondlist; n++) {
i1 = bondlist[n][0];
i2 = bondlist[n][1];
type = bondlist[n][2];

delx = x[i1][0] - x[i2][0];
dely = x[i1][1] - x[i2][1];
delz = x[i1][2] - x[i2][2];

// force from log term

rsq = delx*delx + dely*dely + delz*delz;
r0sq = r0[type] * r0[type];
rlogarg = 1.0 - rsq/r0sq;

// if r -> r0, then rlogarg < 0.0 which is an error
// issue a warning and reset rlogarg = epsilon
// if r > 2*r0 something serious is wrong, abort

if (rlogarg < 0.1) {
char str[128];
sprintf(str,"FENE bond too long: " BIGINT_FORMAT " %d %d %g",
update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq));
error->warning(FLERR,str,0);
if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond");
rlogarg = 0.1;

It seems no minimum image correction is made. Would you please confirm
whether minimum image is considered or not?

Best
Frank

Dear Steve or Alex,
I am planning on simulating some polymer system where the bond might
drift aross the periodic boundaries. Unfortunately, I consistently
encountered bond error. And it seems like the error happens when a

what "bond error"?

bond across a periodic boundary. I have been searching some post on

unlikely that it has to do with PBC by itself; more likely are
bad box dimensions or other setup errors.

the mail-list, some one said the minimum image is considered when

lammps doesn't have to apply minimum image conventions
explicitly. they come implicitly through the use of local/ghost
atoms from the domain decomposition when updating the
neighbor lists. if you had only one domain, the ghost atoms
are explicit image copies.

lammps calculates bond interactions. But I check the source code of
bond_style, e.g. fene. I got this

[...]

It seems no minimum image correction is made. Would you please confirm

it is not needed. when building the bond list, the proper
local/ghost atom indices are added.

whether minimum image is considered or not?

as explained, LAMMPS is different in this respect
than other, simpler MD codes.

as usual, i would look for atoms with high kinetic
energy. also, the question remains whether the
problems happen at the beginning of the simulation
or later. it may also be related to neighborlist update
settings, cutoffs and other input choices. or you
may just have a bad starting geometry.

axel.

Dear Axel,
Thanks a lot for your quick reply. It actually very helpful. According
to you clarification about the local/ghost atoms, I think the problem
might due to the ghost atom cutoff. I will explain my guess as follow,
see whether it makes sense.

My system has DPD pairwise interaction and FENE bond. DPD cutoff is
1\sigma and FENE maximum R0 is 4\sigma. Since I use default setting
for neighbor and communicate, the ghost cutoff will be
1+0.3=1.3\sigma, which is still much smaller than R0. I am running
serial code on one processor, so my ghost atoms will be the image
copies as you said.

When one atom in a bond pair crosses the boundary and the bond
distance is larger than the ghost cutoff, the correct image copy won't
be selected. Therefore, the bond distance is evaluated incorrectly.
The bad fene bond error always reports a bond distance about the size
of the dimension of the simulation cell.

The solution is increasing the ghost cutoff to match the fene bond R0.
I have tried this, and the simulation works well so far.

Best
Frank

is smaller than my fene bond maximum R0. Therefore, when one atom of
in a bond pair travel across the boundary, everything is fine

The solution is increasing the ghost cutoff to match the fene bond R0.
I have tried this, and the simulation works well so far.

yes, this is the solution - there is a note on the communicate cutoff
command doc page to this effect.

We removed the minimum-image computation from all the bond, angle, etc
routines for efficiency, since the neighbor list now finds the closest image
when building the bond neighbor list. But what you saw is
an unintended side effect. Need to think if there is some way to
check for it w/out re-computing all the minimum images every timestep.

Steve