Hi,<br><br>Do note how the jumps are removed. First of all, this is done atom-wise. For the first frame, the position of each atom is checked against the position in the given reference, and if there's a distance between them larger than half the box vector, it is shifted back over the lattice. For each successive frame, the positions are checked against the positions in the foregoing frame (already reset). Therefore, giving a reference structure which is different from the first frame can give weird results. 
<br><br>The only thing which can really screw the stuff, is when you already pretreated your trajectory using a procedure which changes orientations of the system; typically fitting. Now this could be dealt with properly iff fitting (notably the rotation of the system) was also applied on the box vectors, which are also stored in the .xtc/.trr/.gro/.pdb trajectory file. In addition, before removing jumps, the rotation should be taken into account explicitly... That way (provided that the reference structure corresponds to the first frame) you'd get pretty robust behaviour. Besides (though maybe this should be on the developers list) the removal of jumps could be done according to:
<br><br>transpose(fr.box, S);<br>m_inv(S, T);<br>for (i=0; i&lt;natoms; i++) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mvmul(T, fr.x[i], fr.x[i]);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mvmul(T, xp[i], xp[i]);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fr.x[i][0] += round(xp[i][0] - fr.x
[i][0]);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fr.x[i][1] += round(xp[i][1] - fr.x[i][1]);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fr.x[i][2] += round(xp[i][2] - fr.x[i][2]);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mvmul(S, fr.x[i], fr.x[i]);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mvmul(S, xp[i], xp[i]);
<br>}<br><br>which works for all possible triclinic boxes, whatever the orientation, and avoids shifting iteratively.<br><br>Ciao!<br><br>Tsjerk<br><br>-- <br><br>Tsjerk A. Wassenaar, M.Sc.<br>Groningen Biomolecular Sciences and Biotechnology Institute (GBB)
<br>Dept. of Biophysical Chemistry<br>University of Groningen<br>Nijenborgh 4<br>9747AG Groningen, The Netherlands<br>+31 50 363 4336<br>