Improved PBC handling for large molecules during cluster PBC
authorErik Lindahl <lindahl@cbr.su.se>
Sun, 30 Jan 2011 20:59:08 +0000 (21:59 +0100)
committerErik Lindahl <lindahl@cbr.su.se>
Sun, 30 Jan 2011 20:59:08 +0000 (21:59 +0100)
src/tools/gmx_trjconv.c

index db1385302c31877293265aefe5a7922bc58b59d3..ead403fca7414e43cbb7ba5e0d08a8755191b3d3 100644 (file)
@@ -175,8 +175,8 @@ static void calc_pbc_cluster(int ecenter,int nrefat,t_topology *top,int ePBC,
                 /* Make molecule whole, move 2nd and higher atom to same periodicity as 1st atom in molecule */
                 if(j>molind[i])
                 {
-                    pbc_dx(&pbc,x[j],x[molind[i]],dx);
-                    rvec_add(x[molind[i]],dx,x[j]);
+                    pbc_dx(&pbc,x[j],x[j-1],dx);
+                    rvec_add(x[j-1],dx,x[j]);
                 }
                 /* Compute center of geometry of molecule - m_com[i] was zeroed when we did snew() on it! */
                 rvec_inc(m_com[i],x[j]);