Disallow extracting V/F from XTC files in g_traj
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_traj.c
index 29f1bd49c329cd940e231d8f4181ddc5ae78e680..6f26469d7c45b8ede4fb2de984b86cea0c4b7c4f 100644 (file)
@@ -904,6 +904,12 @@ int gmx_traj(int argc, char *argv[])
 
     read_first_frame(oenv, &status, ftp2fn(efTRX, NFILE, fnm), &fr, flags);
 
+
+    if ((bOV || bOF) && fn2ftp(ftp2fn(efTRX, NFILE, fnm)) == efXTC)
+    {
+        gmx_fatal(FARGS, "Cannot extract velocities or forces since your input XTC file does not contain them.");
+    }
+
     if (bCV || bCF)
     {
         snew(sumx, fr.natoms);