On the same topic, I have a question to the community: does anybody
try to make *so*-library (or *dll* on windows) of xdrfile in order to
use with other programming languages? I spent a day trying to master
this art but didn't still succeed. If somebody more experienced with
dynamic libraries than me can provide such one, I will be very
grateful.

Thanks,
Vitaly

---------- Forwarded message ----------
From: Vitaly V. Chaban <vvcha...@gmail.com>
Date: Tue, Aug 11, 2009 at 11:11 PM
Subject: Re: xdrfile library, read co-ordinates from .xtc
To: gmx-users@gromacs.org, Lipi Thukral <lipi.thuk...@iwr.uni-heidelberg.de>


Hi Lipi,

What do you mean saying that the coordinates are random?

You can access the coordinates of the particular atom with
x_xtc[i][j], where "i" is a number of atom in a system, "j[0]" - is
x-coord, j[1] - y-coord, j[2] - z-coord. The same logic relates to
reading trr files.

Vitaly

>
> 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.
>
>
> Thanks,
> Lipi
_______________________________________________
gmx-users mailing list    gmx-users@gromacs.org
http://lists.gromacs.org/mailman/listinfo/gmx-users
Please search the archive at http://www.gromacs.org/search before posting!
Please don't post (un)subscribe requests to the list. Use the
www interface or send it to gmx-users-requ...@gromacs.org.
Can't post? Read http://www.gromacs.org/mailing_lists/users.php

Reply via email to