Gromacs-4.6 and earlier versions had the output transposed. This
patch fixes it such that paxisN.dat contains the x/y/z components
of the N:th prinicipal axis. The default file output names have
been changed to paxisN.dat to increase the probability that users
who rely on old scripts will need to read the help text and find
the changed format.
Fixes #1441, related to #609.
Change-Id: Ic1ed9370145d3389ae8f43c2a419765dabf3a66f
{
const char *desc[] = {
"[THISMODULE] calculates the three principal axes of inertia for a group",
{
const char *desc[] = {
"[THISMODULE] calculates the three principal axes of inertia for a group",
+ "of atoms. NOTE: Old versions of Gromacs wrote the output data in a",
+ "strange transposed way. As of Gromacs-5.0, the output file paxis1.dat",
+ "contains the x/y/z components of the first (major) principal axis for",
+ "each frame, and similarly for the middle and minor axes in paxis2.dat",
+ "and paxis3.dat."
};
static gmx_bool foo = FALSE;
};
static gmx_bool foo = FALSE;
{ efTRX, "-f", NULL, ffREAD },
{ efTPS, NULL, NULL, ffREAD },
{ efNDX, NULL, NULL, ffOPTRD },
{ efTRX, "-f", NULL, ffREAD },
{ efTPS, NULL, NULL, ffREAD },
{ efNDX, NULL, NULL, ffOPTRD },
- { efDAT, "-a1", "axis1", ffWRITE },
- { efDAT, "-a2", "axis2", ffWRITE },
- { efDAT, "-a3", "axis3", ffWRITE },
+ { efDAT, "-a1", "paxis1", ffWRITE },
+ { efDAT, "-a2", "paxis2", ffWRITE },
+ { efDAT, "-a3", "paxis3", ffWRITE },
{ efDAT, "-om", "moi", ffWRITE }
};
#define NFILE asize(fnm)
{ efDAT, "-om", "moi", ffWRITE }
};
#define NFILE asize(fnm)
calc_principal_axes(&top, x, index, gnx, axes, moi);
calc_principal_axes(&top, x, index, gnx, axes, moi);
- fprintf(axis1, "%15.10f %15.10f %15.10f %15.10f\n", t, axes[XX][XX], axes[YY][XX], axes[ZZ][XX]);
- fprintf(axis2, "%15.10f %15.10f %15.10f %15.10f\n", t, axes[XX][YY], axes[YY][YY], axes[ZZ][YY]);
- fprintf(axis3, "%15.10f %15.10f %15.10f %15.10f\n", t, axes[XX][ZZ], axes[YY][ZZ], axes[ZZ][ZZ]);
+ fprintf(axis1, "%15.10f %15.10f %15.10f %15.10f\n", t, axes[XX][XX], axes[XX][YY], axes[XX][ZZ]);
+ fprintf(axis2, "%15.10f %15.10f %15.10f %15.10f\n", t, axes[YY][XX], axes[YY][YY], axes[YY][ZZ]);
+ fprintf(axis3, "%15.10f %15.10f %15.10f %15.10f\n", t, axes[ZZ][XX], axes[ZZ][YY], axes[ZZ][ZZ]);
fprintf(fmoi, "%15.10f %15.10f %15.10f %15.10f\n", t, moi[XX], moi[YY], moi[ZZ]);
}
while (read_next_x(oenv, status, &t, x, box));
fprintf(fmoi, "%15.10f %15.10f %15.10f %15.10f\n", t, moi[XX], moi[YY], moi[ZZ]);
}
while (read_next_x(oenv, status, &t, x, box));