[gmx-users] Calculated bonded interactions - number of bonds- bondfree.c

Hoa Trinh trinhlanhoa at gmail.com
Thu Oct 26 19:58:09 CEST 2017


Dear Mark & Justin,
Thank you very much. Hum, the name of variable nbonds is a bit misleading.

*Lan Hoa*

2017-10-26 6:10 GMT-05:00 Justin Lemkul <jalemkul at vt.edu>:

>
>
> 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
>
> ==================================================
>
>
> --
> Gromacs Users mailing list
>
> * Please search the archive at http://www.gromacs.org/Support
> /Mailing_Lists/GMX-Users_List before posting!
>
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>
> * For (un)subscribe requests visit
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> send a mail to gmx-users-request at gromacs.org.
>


More information about the gromacs.org_gmx-users mailing list