Merge release-4-6 into master
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_anaeig.c
index eef2ef1b99102429807850c9ae30cbac6c08ee85..6ccc8f854120cecec2c4913e402783fe398a07c1 100644 (file)
@@ -1277,6 +1277,11 @@ int gmx_anaeig(int argc, char *argv[])
             snew(xrefp, atoms->nr);
             if (xref1 != NULL)
             {
+                /* Safety check between selected fit-group and reference structure read from the eigenvector file */
+                if (natoms != nfit)
+                {
+                    gmx_fatal(FARGS, "you selected a group with %d elements instead of %d, your selection does not fit the reference structure in the eigenvector file.", nfit, natoms);
+                }
                 for (i = 0; (i < nfit); i++)
                 {
                     copy_rvec(xref1[i], xrefp[ifit[i]]);