[gmx-users] g_velacc bug?

Claudio J. Margulis claudio-margulis at uiowa.edu
Tue Dec 2 22:07:01 CET 2003


Hi, I'm trying to use g_velacc to compute the velocity autocorrelation
function for a set of molecules.
When I compute g_velacc for atoms it gives the correct answer (I wrote
my own program to check)
When I compute it for molecules (with option -mol and and index file
with molecules not atoms)
I get strange results.
 
I looked at the source code (admitedly I'm a much better fortran
programmer than c) but these few lines look weird to me.
Can anybody tell me if  line 7 to 9 they are right or not?
 
    1   if (bMol)
    2     for(i=0; i<gnx; i++) {
    3      clear_rvec(mv_mol);
    4     for(j=0; j<atndx[index[i]+1] - atndx[index[i]]; j++) {
    5      at = a[atndx[index[i]]+j];
    6     m  = top.atoms.atom[at].m;
    7   mv_mol[XX] += m*fr.v[at][XX];
    8   mv_mol[XX] += m*fr.v[at][YY];
    9  mv_mol[XX] += m*fr.v[at][ZZ];
        }
        c1[i][tel3+XX]=mv_mol[XX];
        c1[i][tel3+YY]=mv_mol[YY];
        c1[i][tel3+ZZ]=mv_mol[ZZ];
      }
 
 
 
shouldn't it be 
         mv_mol[XX] += m*fr.v[at][XX];
          mv_mol[YY] += m*fr.v[at][YY];
          mv_mol[ZZ] += m*fr.v[at][ZZ];
 
if this is computing the velocity of center of mass of the molecule?
 
 
Thanks!
Claudio.
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-users/attachments/20031202/4b17da10/attachment.html>


More information about the gromacs.org_gmx-users mailing list