From f99217aa26a8d093613c84a607fe5e2600c3261b Mon Sep 17 00:00:00 2001 From: Rossen Apostolov Date: Fri, 23 May 2014 16:30:06 +0200 Subject: [PATCH] Allow trjconv to keep some box dimensions unchanged. Giving -1 to option box will preserve the original box size for the given dimension. Fixes #871. Change-Id: I339aedcf09da8ecb4eb8f32e8057f953a21e0f5f --- src/gromacs/gmxana/gmx_trjconv.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gromacs/gmxana/gmx_trjconv.c b/src/gromacs/gmxana/gmx_trjconv.c index 48f4560bd1..827ef907cc 100644 --- a/src/gromacs/gmxana/gmx_trjconv.c +++ b/src/gromacs/gmxana/gmx_trjconv.c @@ -697,6 +697,10 @@ int gmx_trjconv(int argc, char *argv[]) "Use option [TT]-pbc mol[tt] in addition to [TT]-center[tt] when you", "want all molecules in the box after the centering.[PAR]", + "Option [TT]-box[tt] sets the size of the new box. If you want to" + "modify only some of the dimensions, e.g. when reading from a trajectory," + "you can use -1 for those dimensions that should stay the same" + "It is not always possible to use combinations of [TT]-pbc[tt],", "[TT]-fit[tt], [TT]-ur[tt] and [TT]-center[tt] to do exactly what", "you want in one call to [THISMODULE]. Consider using multiple", @@ -1414,7 +1418,10 @@ int gmx_trjconv(int argc, char *argv[]) clear_mat(fr.box); for (m = 0; m < DIM; m++) { - fr.box[m][m] = newbox[m]; + if (newbox[m] >= 0) + { + fr.box[m][m] = newbox[m]; + } } } -- 2.22.0