[gmx-users] xdrfile library, read co-ordinates from .xtc

Lipi Thukral Lipi.Thukral at iwr.uni-heidelberg.de
Tue Aug 11 19:36:43 CEST 2009

Dear Gromacs Users,

I have downloaded xdr library to read .xtc files.

The installation of the xdrlibrary worked without any problems. The 
compilation of the test program "trr2xtc.c" also worked.

Now I'm trying to store the coordinates of a xtc trajectory into a local 
variable. I first tried to print out the coordinates. I just modified the 
trr2xtc code. Here a few line of my code:

  xd_read = xdrfile_open(rfile, "r");
  x_xtc = calloc(natoms_xtc, sizeof (x_xtc[0]));
  result_xtc = read_xtc(xd_read, natoms_xtc, &step_xtc, &time_xtc, box_xtc, x_xtc, &prec_xtc);
  printf("%f %f %f\n",x_xtc[0],x_xtc[1],x_xtc[2]);

The coordinates in the variable x_xtc seems to be random. How do I access 
the proper coordinates from the trajectory?

I would appreciate any help.


   Lipi Thukral
   Computational Molecular Biophysics, IWR
   University of Heidelberg, Im Neuenheimer Feld 368
   D-69120 Heidelberg, Germany.
   Tel.: +49-(0)6221-54-8806, Fax: -8868
   email: Lipi.Thukral at iwr.uni-heidelberg.de

More information about the gromacs.org_gmx-users mailing list