[gmx-users] Two questions about virial calculation

xuji xuji at home.ipe.ac.cn
Fri Dec 5 13:51:19 CET 2008


Hi all

I looked into the file named bondfree.c of Gromacs-4.0 
for bond, angle and dihedral force contribution to the virial.
And I have one problem that I can't understand. When the 
periodicity has been taken into account for the virial 
why do you put one atom's contribution to virial in the 
central image? Just like the code int the file bondfree.c
of line 346 and 347
	fshift[ki][m]+=fij;
	fshift[CENTRAL][m]-=fij;
int the "real bonds" function.
And line 681 682 683
      rvec_inc(fshift[t1],f_i);
      rvec_inc(fshift[CENTRAL],f_j);
      rvec_inc(fshift[t2],f_k);
int the "real angles" function.
The fshift array is used to calculate the PBC contribution 
part of the virial in the formula (B.11) in the manual 
Appendix B. It seems that the CENTRAL element of shift_vec 
array is "0". The direct product of fshift[CENTRAL] and 
shift_vec[CENTRAL] should be "0". So why should we accumulate 
the CENTRAL element of the fshift array? Or I misunderstand 
the shift_vec?

Second, in appendix B.1.4 the formula of virial from covalent 
bonds is given. Can someone tell me the formulae of the angle 
and dihedral contribution to virial?

Appreciate any help in advance!

        xuji
        xuji at home.ipe.ac.cn
          2008-12-05


More information about the gromacs.org_gmx-users mailing list