Best way to output forces of atoms

GROMACS version: 2021
GROMACS modification: Yes/No

Hi guys,

I’m looking for a simple way to extract forces from a trr file with a certain time step for further matching it with the positions for further processing (not just plotting). First, I tried to use this command:
gmx trjconv -f NVT.trr -s NVT.tpr -n index.ndx -o force.gro -force -dt 100
It gave me a gro file with output like
1670CL CL 8800 3.294 3.554 1.270 0.2940 0.1316 0.2854
where the last three values seem to be velocities and changing -force to -vel did not make any difference.

The best output utility I have found so far is to dump the trr file, then parse and match up with the previous output.
gmx dump -f NVT.trr | grep f > force.txt
Yes, it is possible to do, but it does not look like a simple way to do it.

Am I using the trjconv utility correctly? Is it possible to output forces instead of velocities? Is there a simple way to output positions and forces of individual atoms in a tab/space-separted format?

You want: gmx traj -of
You can supply an index file if you want to select certain atoms.

@hess, thanks but it gives me a timeseries for specific atoms, which is convenient for plotting time series, but not processing and more complex plotting, let us say, making a running-averaged histogram of force by the z-coordinate. For this purpose, it is more convenient to read the dump file than the .xvg file. Given n atoms and m timeslices I want is a format like this:

(data at t = t_1)
atom_id_1 x_1 y_1 z_1 fx_1 fy_1 fz_1
atom_id_2 x_2 y_2 z_2 fx_2 fy_2 fz_2
....
atom_id_n x_n y_n z_n fx_n fy_n fz_n
(data at t = t_2)
atom_id_1 x_1 y_1 z_1 fx_1 fy_1 fz_1
atom_id_2 x_2 y_2 z_2 fx_2 fy_2 fz_2
....
atom_id_n x_n y_n z_n fx_n fy_n fz_n
...
(data at t = t_m)
atom_id_1 x_1 y_1 z_1 fx_1 fy_1 fz_1
atom_id_2 x_2 y_2 z_2 fx_2 fy_2 fz_2
....
atom_id_n x_n y_n z_n fx_n fy_n fz_n

We don’t have such functionality. You could write a gmx tool for this yourself.