This simple script has been updated to work for both poscar and con files. Periodic boundary conditions and non-orthogonal cells are also properly treated. Thanks to Yuri Mastrikov for pointing out this problem.
Well, it would be better to say that distances in periodic systems are treated in the same way we always do (and in vasp), by converting to direct coordinates and making sure that each coordinate is on the interval (-0.5,0.5). However, for non-orthogonal cells, this does not give the minimum distance between two atoms. Alan Wright pointed out that the correct way to find the minimum distance vector is to subtract or add lattice vectors until the distance is a minimum. This is equivalent to making sure the distance vector is in the Wigner-Seitz cell, which is not the same as the (-0.5,0.5) direct cell. At some point, we should make this change throughout the scripts, starting with distance routine in Vasp.pm.
updated diffcon.pl
Moderator: moderators