domain->minimum_image(delx,dely,delz)

Dear all,

I examined fix_bond_break.cpp and it shows that bond distances are
checked against pbc with the line
"domain->minimum_image(delx,dely,delz)". I looked at
fix_bond_create.cpp and could not find the same check when checking
the distance between i and j bond candidate atoms. Why is this so?

Thanks,

Jan-Michael

Dear all,

I examined fix_bond_break.cpp and it shows that bond distances are
checked against pbc with the line
"domain->minimum_image(delx,dely,delz)". I looked at
fix_bond_create.cpp and could not find the same check when checking
the distance between i and j bond candidate atoms. Why is this so?

Thanks,

Jan-Michael

The minimg() only needs to be invoked if
you are calculating the distance to a 2nd atom
that was specified by atom ID, since it may
be indexing an atom far away from the 1st,
e.g. an atom in a bond with the 1st atom.

If you are just calculating the distance to a
2nd atom from the neighbor list, then it
is already guaranteed to be an image "close"
to the 1st atom, which is the case with fix bond/create.

Steve

Thanks Steve,

I have another question. For example, i and j are bonded but j crosses
the periodic boundaries hence there bond length would be more than
half the box size if I did not invoke minimg() and I got their
coordinates from the bondlist/atom ID. If I had another atom, k, which
is found in the neighbor list of i, hence I do not need to invoke
minimg() to get their correct distance between i and k. Does it follow
that j is in the neighborlist of i because it is bonded and I can use
the coordinates from the neighbors list to get the correct distance
between j and k?

Jan-Michael

Thanks Steve,

I have another question. For example, i and j are bonded but j crosses
the periodic boundaries hence there bond length would be more than
half the box size if I did not invoke minimg() and I got their
coordinates from the bondlist/atom ID. If I had another atom, k, which
is found in the neighbor list of i, hence I do not need to invoke
minimg() to get their correct distance between i and k. Does it follow
that j is in the neighborlist of i because it is bonded and I can use
the coordinates from the neighbors list to get the correct distance
between j and k?

no. there are two issues to worry about:

1) if j is bound to i, it is likely not in the neighbor list
   due to the special bonds exclusion. if the 1-2 (or 1-3, or 1-4)
   factor is zero then the interaction is removed from the neighborlist.

2) there is a difference between local and ghost atoms.
   bonds can be between local and ghost atoms, but unless
   explicitly requested, there are no neighbors for ghost atoms.

axel.

To add to Axel's answer, any atom index that
is in the neighbor list of atom I, will be for an atom (owned
or ghost) that is "near" atom I, so that no minimg() is
needed. As Axel said, an atom bonded to I will
not be in the neighbor list if it is fully excluded via
special_bonds.

If you know the global atom ID of an atom bonded to
I, and use atom->map() to get its local index, then
there is no guarantee that atom is "near" atom I. It
could be on the other side of the periodic box, hence
you need to use minimg() before computing the distance to it.

Steve