From: Erik Lindahl Date: Fri, 20 Jun 2014 15:52:51 +0000 (+0200) Subject: Disallow extracting V/F from XTC files in g_traj X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=42053c972c232cc05c17e496159a484129a6fe5b;p=alexxy%2Fgromacs.git Disallow extracting V/F from XTC files in g_traj We now issue a fatal error if the user asks for velocities or forces to be written to as output from g_traj when the input XTC file does not contain these quantities. Fixes #1298. Change-Id: I45a12fb1e5db5b2b2e1b072444e5430373fbaaa3 --- diff --git a/src/gromacs/gmxana/gmx_traj.c b/src/gromacs/gmxana/gmx_traj.c index 29f1bd49c3..6f26469d7c 100644 --- a/src/gromacs/gmxana/gmx_traj.c +++ b/src/gromacs/gmxana/gmx_traj.c @@ -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);