[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
int the "real bonds" function.
And line 681 682 683
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 at home.ipe.ac.cn

More information about the gromacs.org_gmx-users mailing list