[gmx-users] g_velacc bug?

David spoel at xray.bmc.uu.se
Tue Dec 2 22:52:00 CET 2003


On Tue, 2003-12-02 at 22:06, Claudio J. Margulis wrote:
> 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?
> 
please replace by YY and ZZ and test. Could you report back whether that
solves the problem? I'm afraid this program is not very often used, and
hence not well tested.
>  
> 
>     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.
> 
>  
-- 
David.
________________________________________________________________________
David van der Spoel, PhD, Assist. Prof., Molecular Biophysics group,
Dept. of Cell and Molecular Biology, Uppsala University.
Husargatan 3, Box 596,  	75124 Uppsala, Sweden
phone:	46 18 471 4205		fax: 46 18 511 755
spoel at xray.bmc.uu.se	spoel at gromacs.org   http://xray.bmc.uu.se/~spoel
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




More information about the gromacs.org_gmx-users mailing list