[gmx-developers] routines for writing an index file

Erik Lindahl lindahl at stanford.edu
Wed Jun 12 21:20:28 CEST 2002


Valentin Gogonea wrote:
> Thanks to Erik and Gerrit for the answers.
> 
> Can somebody can give my a list of the routines/functions that must be 
> called to write an index file.  I know that is trivial to do the 
> printing but I try to use as much as possible routines which are already 
> there in gromacs.
> 

Sure.

The basic structure for representing collections of atoms in gromacs is 
a block. One of Gerrit's slides shows this I think, and the block 
structure is defined in include/types/blocks.h.

In your case you can neglect the 'multinr' stuff - it is only used for 
splitting blocks over processors.

There is a routine called pr_block in include/txtdump.h that you can use
to print an entire block of atoms - can be handy for trial and error :-)

Once you have a block with your atoms it is trivial to write it to an 
index file - just call write_index() defined in include/index.h.

The nice thing about using blocks is that it is trivial to read your 
index file back into a block - for some reason those routines are 
defined in include/rdgroup.h ('read groups'), though...

Cheers,

Erik




More information about the gromacs.org_gmx-developers mailing list