Dear all,
I have a question with function domain->closest_image. If i is the local id of a local atom, j is the local id of an atom in i’s neighborlist.
Is there any difference between xH gotten by the following two kinds of code?
Code 1:
double **x = atom->x;
double xH[3];
j = domain->closest_image(i,j);
xH[0] = x[j][0];
xH[1] = x[j][1];
xH[2] = x[j][2];
Code 2:
double **x = atom->x;
double xH[3];
closet_image(x[i], x[j], xH);
Thank you!
Dear all,
I have a question with function domain->closest_image. If i is the local id
of a local atom, j is the local id of an atom in i's neighborlist.
Is there any difference between xH gotten by the following two kinds of
code?
first off, you may not use the neighborlist entries without stripping
off the bits indicating 1-2, 1-3, or 1-4 neighbors or you are likely
to get crashes.
second, there is a conceptual difference. in the first case, the code
will only look at periodic images of atoms that are within the list of
local and ghost atoms and determine which of them is the closest
periodic image. in the second case, the closest periodic position is
computed. those two codes may or may not return the same coordinates.
difficult to say in this generality.
axel.
Deae Axel,
Thanks for your notification. I have already used NEIGHMASK to strip off the bits.
I found in pair_lj_cut_tip4p_cut, the second kind of method is used to find the coordinates of the corresponding Hydrogen atom of an oxygen atom for a water molecule. However, in neigh_bond, the first method to find.
In your opinion, which method is better if the neighborlist is a full neighborlist?
Deae Axel,
Thanks for your notification. I have already used NEIGHMASK to strip off the
bits.
I found in pair_lj_cut_tip4p_cut, the second kind of method is used to find
the coordinates of the corresponding Hydrogen atom of an oxygen atom for a
water molecule. However, in neigh_bond, the first method to find.
it is not used to locate the closest image relative to an oxygen, but
to a specific position in space, for which *no* atom exists in the
neighbor list. that is a special case for the TIP4P water model.
In your opinion, which method is better if the neighborlist is a full
neighborlist?
you should use the first method unless you have a good reason not to.
axel.