On 26/07/2012 8:22 PM, prithvi raj pandey wrote:
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?

Did you verify that the trajectory has velocities, and that you read them, and that they're found in fr.v? Look at the code for a tool that reads velocities (g_velacc, I guess).

Mark
--
gmx-users mailing list    gmx-users@gromacs.org
http://lists.gromacs.org/mailman/listinfo/gmx-users
* Only plain text messages are allowed!
* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/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/Support/Mailing_Lists

Reply via email to