[gmx-users] template.c: HOW TO READ X and V

David spoel at xray.bmc.uu.se
Tue Aug 9 18:28:27 CEST 2005


On Tue, 2005-08-09 at 18:52 +0400, avb wrote:
> Dear gmx-users,
> I use template.c example to read trajectory.
>  Is it possible to read both coordinates and velocities
>  simultaneously?
> 
> I found in statutil.h flags:
> TRX_READ_X (1<<0)
> TRX_NEED_X (1<<1)
> TRX_READ_V (1<<2)
> TRX_READ_V (1<<3)
> 
> but I can use only one of them: for example flags=TRX_READ_X;
> 
> so when I call read_first_frame and read_next_frame routine subsequently
> I get either coordinate or velocities.
> 
> Is it possible to get both Xes and Ves at the same call to function?
yes, by making a binary OR operator ( | ) between then
flags = TRX_NEED_X | TRX_NEED_V
> 
> 
-- 
David.
________________________________________________________________________
David van der Spoel, PhD, Assoc. Prof., Molecular Biophysics group,
Dept. of Cell and Molecular Biology, Uppsala University.
Husargatan 3, Box 596,          75124 Uppsala, Sweden
phone:  46 18 471 4205          fax: 46 18 511 755
spoel at xray.bmc.uu.se    spoel at gromacs.org   http://xray.bmc.uu.se/~spoel
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




More information about the gromacs.org_gmx-users mailing list