Gmx velacc

GROMACS version: 2021.4
GROMACS modification: Yes

I want to analysis IR/power spectra of O-H water using gmx velacc. Here is the command I use:

gmx velacc -f nvep.trr -s nvep.tpr -n water.ndx -o power.xvg -recip -mol -m

and here is the result:

Reading file nvep.tpr, VERSION 2021.4-Ubuntu-2021.4-2 (single precision)
Reading file nvep.tpr, VERSION 2021.4-Ubuntu-2021.4-2 (single precision)
Group 0 ( prot_sort) has 30066 elements
There is one group in the index

Split group of 30066 atoms into 10022 molecules
trr version: GMX_trn_file (single precision)
Last frame -1 time 0.000
Last frame -1 time 5000.000
Not enough frames in trajectory - no output generated.

Based on GROMACS documentation, its was said that [.mdp] file must contain velocity information ( nstvout was set in the [.mdp] file). I think I have that:

; Run parameters
integrator = md ; leap-frog integrator
nsteps = 10000000 ;
dt = 0.0005 ; in ps

; Output control
nstxout = 500 ; save coordinates every 1.0 ps
nstvout = 500 ; save velocities every 1.0 ps
nstenergy = 500 ; save energies every 1.0 ps
nstlog = 500 ; update log file every 1.0 ps

Do anyone know what’s wrong?

How many frames are there in your trajectory? According to your settings there should be 20,001 frames. Did the simulation finish?

If you visualize the trajectory in VMD, does it look OK?

No, there are just 5,001 frames when I check on vmd. But, the simulation look OK because I can take the data from gmx msd and rdf

I change .trr generated by production run to .xtc (-dt 1) using gmx trjconv, and the result is just 5,001 frames.

I don’t understand. The simulation itself should have generated 20001 frames (if you are using the settings above).

You then say that you converted it into an xtc file with output every 1 ps, which should give you a file with 5001 frames.

But in the command output where it fails, you are using a trr file with 5001 frames. Have you converted the xtc file back into a trr file? In that case you will have lost the velocity data.

I don’t try to convert back .xtc file into .trr file. So, is the the velocity data in the 20,001 frames of .trr files? and can I run gmx velacc if the .trr file exist?

I’m afraid you have lost me in your explanations then.

Yes, you can use velacc if the .trr file exists. In fact, you can only use a .trr file as input to velacc, since .xtc files do not contain velocity data.

To see the contents of the .trr (or .xtc) files do
gmx check -f traj.trr or perhaps gmx check -f nvep.trr in your case.
If there are not 20001 coordinate and velocity frames (based on the mdp parameters you posted above) you have probably done something to the files and lost data.