Fix g_msd -mol
authorRoland Schulz <roland@utk.edu>
Sat, 10 Nov 2012 21:06:28 +0000 (16:06 -0500)
committerRoland Schulz <roland@utk.edu>
Sat, 10 Nov 2012 21:06:28 +0000 (16:06 -0500)
Fixes #774

Change-Id: I6fa564754bcbc898a5da6428729775c669cd72d2

src/tools/gmx_msd.c

index c536fb845b7baed6c25b0af076ef2133352f6a36..e5b3a22573a9ee167aaa46ccac847cedd7b35d5e 100644 (file)
@@ -666,6 +666,10 @@ int corr_loop(t_corr *curr,const char *fn,t_topology *top,int ePBC,
     if (bMol)
       gmx_rmpbc(gpbc,natoms,box,x[cur]);
 
+    /* calculate the molecules' centers of masses and put them into xa */
+    if (bMol)
+        calc_mol_com(gnx[0],index[0],&top->mols,&top->atoms, x[cur],xa[cur]);
+    
     /* first remove the periodic boundary condition crossings */
     for(i=0;i<curr->ngrp;i++)
     {
@@ -680,10 +684,6 @@ int corr_loop(t_corr *curr,const char *fn,t_topology *top,int ePBC,
                  &top->atoms, com);
     }
 
-    /* calculate the molecules' centers of masses and put them into xa */
-    if (bMol)
-        calc_mol_com(gnx[0],index[0],&top->mols,&top->atoms, x[cur],xa[cur]);
-    
     /* loop over all groups in index file */
     for(i=0; (i<curr->ngrp); i++) 
     {