[gmx-users] Q's about adding bonded interaction

Mark Abraham Mark.Abraham at anu.edu.au
Sat Nov 24 03:46:32 CET 2007

Frankie Montenegro wrote:
> Hi everyone,
> */I have posted these few questions on the developers list few days ago
> but didn't get any feedback. I'd really appreciate some input, I am
> quite lost in gromacs (not so small) source tree. /*
> I am trying to add a two-body bonded interaction, following a "list of
> files to modify", given in the manual (page 190). I have following 
> questions:
> * 1.* In the file *src/gmxlib/ifunc.c* there is an array of functions whose
> arguments include some integers. For example
> def_bond   ("MORSE",    "Morse",           2, 3, 0,  eNR_MORSE,
> morse_bonds   )
> The first integer argument represents the number of interacting atoms, 
> second is
> number of parameters. *What about the third integer?*

Check out the definition of def_bond and work your way backwards. That's 
how I worked it out. I don't remember the answer, however.

> *2.* The same question for the file * src/gmxlib/nrnb.c* and this 
> structure initialization:
> static const t_nrnb_data nbdata[eNRNB] = {
>  { "LJ",                             33 }, /* nb_kernel010 */
>  { "Buckingham",                     61 }, /* nb_kernel020 */
>  { "VdW(T)",                         54 }, /* nb_kernel030 */
> .......
> *What is the meaning of the integers (33, 61, 54)? Do I need to worry 
> about this
> for my added interaction?*

IIRC it's a flop-count that GROMACS uses to produce the end-of-logfile 
summary of what's happened during the run. Again, something like

grep "nbdata\[" include/*.h */*.[ch]

will find you all the mentions of that text fragment, except those in 
src/gmxlib/nonbonded and deeper.

> *3. *In the file *src/kernel/convparm.c* there is a switch statement for
> every type of interaction. For example:
> case F_MORSE:
>  new->morse.b0    =old[0];
>  new->morse.cb    =old[1];
>  new->morse.beta  =old[2];
>  break;
> If I am adding an interaction which has three parameters, *do I need to
> be concerned about order (which one is in old[0], etc...)? *
> *More importantly*, *is this related to the order of input parameters in 
> the
> topology file? If not, where is this order established?

I'd expect it is related to the order in the topology file, because 
order is sensitive there and it is sensitive here too, and in the same 
way - see Table 5.4. Again, you can search back through the code for 
where the order of the values in "old" were established to verify this.

> *4. *The list in the manual has file */src/kernel/topdirs.c *included
> twice. Is this:
> *(a) the same line listed twice by mistake, or
> (b) a typo, and there is another file to be modified? *


> *5. *There are couple of files in the list that don't seem to need any
> modification for the type of the interaction I am adding.
> For example * src/kernel/enums.h* or *src/kernel/topio.c*  *Does that 
> seem right?*

It's quite possible.


More information about the gromacs.org_gmx-users mailing list