[gmx-developers] Re: [gmx-users] positions and velocities of COM of whole water molecules instead of those of individual atoms?

hessb at mpip-mainz.mpg.de hessb at mpip-mainz.mpg.de
Tue May 19 17:03:36 CEST 2009


>>>> Dear GROMACS Masters,
>>>>
>>>> is there a trick to obtain coordinates and velocities of center of
>>>> mass of each water molecule?
>>>>
>>>
>>> Have a look at g_traj, although to analyze each molecule separately
>>> could
>>> take many iterations with specific index groups.
>>>
>> g_traj can really do it (for coordinates), thanks!
>>
>> g_traj with -mol option was what I needed. It is documented in the
>> third sentence
>> of the DESCRIPTION section of g_traj manual...
>>
>>   "When  -mol is set, the numbers in the index file are interpreted as
>> molecule
>>    numbers and the same procedure as with -com is used for each
>> molecule."
>>
>> -Bohumir
>>
>
> Dear GROMACS developers,
>
> for g_traj to output .trr format with -mol option:
>
>   g_traj -mol -f traj.trr -s md.tpr  -n index_res.ndx -oxt traj2.trr
>
> I needed to change fr_av.natoms (in gmx_traj.c) from 2 to ngrps:
>
> cvs diff gmx_traj.c
> Index: gmx_traj.c
> ===================================================================
> RCS file: /home/gmx/cvs/gmx/src/tools/gmx_traj.c,v
> retrieving revision 1.16
> diff -r1.16 gmx_traj.c
> 162c165
> <     fr_av.natoms = 2;
> ---
>>     fr_av.natoms = ngrps;
>
> Otherwise I had only 2 atoms in the output .trr file.
>
> Interestingly, output in .gro format:
>   g_traj -mol -f traj.trr -s md.tpr  -n index_res.ndx -oxt traj2.gro
> worked fine even without the above modification.
>
> Can you please take a look at it?
>
> Thanks for making GROMACS work for everybody,
> -Bohumir
>
> PS: I will try to get molecular COM velocity too (in addition to
> coordinates).

I fixed it for 4.0.6 and 4.1

Thanks for reporting this,

Berk





More information about the gromacs.org_gmx-developers mailing list