[gmx-users] Calculated bonded interactions - number of bonds- bondfree.c
Justin Lemkul
jalemkul at vt.edu
Thu Oct 26 13:11:03 CEST 2017
On 10/26/17 1:56 AM, Hoa Trinh wrote:
> Hi all,
> I am trying to look into the source code of Gromacs 5.0.7 to see how
> Gromacs calculate bonded interactions. For example, to calculate bond
> interaction between 2 atoms, there is the function (gmxlib/bondfree.c):
> real bonds(int nbonds, ...)
> {
> ....
> for (i = 0; (i < nbonds); )
> {
> type = forceatoms[i++];
> ai = forceatoms[i++];
> aj = forceatoms[i++];
> ....
> }
> Is "nbonds" the total number of bond interactions? In my topology file, I
> have 126 pairs in the [ bonds ] section. However, when I printf the
> variable nbonds, it appears to be 378. I have no idea why. Can anyone
> please help me to explain what is nbonds?
378 = 126 * 3
nbonds here indicates the size of the array, which holds (type, ai, aj)
for each bond in the system.
-Justin
--
==================================================
Justin A. Lemkul, Ph.D.
Assistant Professor
Virginia Tech Department of Biochemistry
303 Engel Hall
340 West Campus Dr.
Blacksburg, VA 24061
jalemkul at vt.edu | (540) 231-3129
http://www.biochem.vt.edu/people/faculty/JustinLemkul.html
==================================================
More information about the gromacs.org_gmx-users
mailing list