# How to save the force on a molecule in GROMACS?

I am a new student of molecular dynamics. I have started using GROMACS a month ago.

I have a small box of 8192 molecules each with 3 atoms. I froze the last molecule and ran the simulation. I even converted the .trr file from binary to .gro and checked that the last molecule indeed stayed in the same place.

However, I want the .trr file to print the force on each molecule or each atom - in the x, y, and z-direction.
I even set the nstfout in the grompp.mdp file to a reasonable non zero number - 5000.

However, the .trr file - when converted to .gro - did not show the force. Can someone tell me what I am doing wrong and how to get GROMACS to save/reveal the force in the .trr file?

• It may be considered off-topic as the question is about using program - more appropriate on computational science SE Nov 30 '15 at 10:29
• I don't think this is off-topic here. However, it may well be true that other sites may be able to answer better. Nov 30 '15 at 12:18
• The GROMACS Users mailing list is a good place for such questions gromacs.org/Support/Mailing_Lists/GMX-Users_List Feb 1 '16 at 17:07

Gro output format does not support forces, so using it as an intermediate output format defeats your purpose.

Use

gmx traj -f your.trr -of


which runs the gmx wrapper binary, calling the traj module to do trajectory processing, names your input trajectory file after -f and triggers the output of forces with -of (optionally named after -of, defaulting to force.xvg), or similarly

gmx dump -f your.trr


to dump the entire contents of the file including forces) to the terminal.

gmx help traj

gmx traj -h