[gmx-users] Writing velocity of particles using template.c

prithvi raj pandey pandeyprithviraj at gmail.com
Thu Jul 26 12:22:24 CEST 2012


Dear gmx users,

I am using template.c of gromacs 4.0.7 for writing my own analysis
tool. When I am using the fr.x[i][XX], it writes the coordinates of
the particles (i crosschecked it with the coordinates written by the
trjconv command). But the problem arises when I use fr.v[i][XX] for
writing the velocities of the particles or fr.f[i][XX] for writing the
force. The program compiles fine by using make command. But finally
the template stops showing segmentation fault. The main loop is as
follows -

 do {

fprintf(fp,"BOX  %f %f %f %f
\n",fr.time,fr.box[XX][XX],fr.box[YY][YY],fr.box[ZZ][ZZ]);

for (i=0; i<top.atoms.nr; i++)
{
    fprintf(fp,"Velocity at t=%8.3f : %f  %f
%f\n",fr.time,fr.v[i][XX],fr.v[i][YY],fr.v[i][ZZ]);
}
  } while(read_next_frame(status,&fr));

Am I using the variable used for writing velocity/force wrongly?

--
Prithvi Raj Pandey
National Chemical Laboratory,
Pune 411008
India.



More information about the gromacs.org_gmx-users mailing list