[gmx-developers] Re: readxtc() -> SWIG -> Python

Erik Lindahl lindahl at csb.stanford.edu
Tue Oct 21 19:56:52 CEST 2003


Hi,

Check out the routine (to read the next compressed frame)


int
xdrfile_read_compr_coord_float(
						float    *ptr,
                                			int      *ncoord,
                                			float    *precision,
                                			XDRFILE*  xfp);


in the code I sent you. The first argument is a pointer to 3*N floats 
of storage.
If  ncoord is non-zero, we check that the number of coordinates in the 
frame is equal to this, and if it is zero
we just write the number of coordinates read to that variable.

The precision isn't important when reading.

xfp is a pointer to and XDRFILE structure, which you can open and close 
with the xdrfile_open/close() calls almost exactly like normal file IO.

xdrfile.c is independent of any other code; you can choose to use the 
system XDR libraries if you want to, but I also include my own versions 
in that file.


Cheers,

Erik




On Tuesday, October 21, 2003, at 11:56 AM, David wrote:

> On Tue, 2003-10-21 at 18:57, Kaihsu Tai wrote:
>> (Sorry for the monologue.)  It appears that xtcio.c depends
>> on a lot of other things; I suppose the putative readxtc.c
>> does not?  Thanks
>
> yes, you will have to link with gromacs for the time being. You only
> need to wrap a few functions though.
>
> read_xtc
> write_xtc
> open_xtc
> close_xtc
>
> Erik and me actually planned to separate the I/O routines from the rest
> of the code, however there would still be considerable overhead from
> lots of small functions, so it's probably just as easy to link to
> gromacs.
>




More information about the gromacs.org_gmx-developers mailing list