[gmx-users] interaction lists in idef.h

Mark Abraham Mark.Abraham at anu.edu.au
Tue Sep 4 08:38:02 CEST 2007


wnoid at hec.utah.edu wrote:
> hello all.
> 
> 
> 
> i am trying to trying to write an analysis program that takes advantage
> of the gromacs utilities/structures.  for my analysis i need to identify
> each type of interaction in the potential energy function and the atoms
> involved in each equivalent interaction of the given type.  for example,
> for each different type of bond angle, i would like to identify each
> triple of bonded atoms forming the given type of bond angle.  also i
> would like to be able to identify each pair of atoms - one of type A and
> one of type B - that interact through a nonbonded (lennard-jones type)
> A-B interaction.

You can do this by copying how GROMACS does it when it goes to 
calculated bonded forces... force.c calls calc_bonds() in 
src/gmxlib/bondfree.c and that calls the functions that were associated 
with each bonded type in src/gmxlib/ifunc.c

> i would like to use something like "read_tps_conf" to read a tpr file
> and then extract these lists of pairs, triples, etc. from the
> interaction list in the topology data structure.  however, after
> spending some time fiddling around with interaction list data structures
> such as idef and ilist, it is still not obvious to me how to extract
> this information.  after reading through types/idef.h, it seems that the
> information i need is stored in these structures, but i still don't
> understand how they are used.  is there a relatively easy way to get
> these lists of interactions for each interaction type out of the tpr
> file?  and if so, can someone please enlighten me as to how this is done?
> 
> 
> 
> of course this information can be obtained from the .top file and i have
> started writing my own utility for extracting this information directly
> from the .top file.  however, if there is a clean way to extract the
> information from the .tpr file using gromacs utilities that are already
> written, that would be a big help.

Remember that top file atom numbering starts from one, but all the 
indices in the code are C-style and start from zero.

Mark



More information about the gromacs.org_gmx-users mailing list