Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_nmeig.c
index 536dece1e163f371fec66ab9163158f685a75fc9..eb727c8fa2ef8ac41d81311b0f3b5162fbc83884 100644 (file)
@@ -1,68 +1,61 @@
 /*
+ * This file is part of the GROMACS molecular simulation package.
  *
- *                This source code is part of
- *
- *                 G   R   O   M   A   C   S
- *
- *          GROningen MAchine for Chemical Simulations
- *
- *                        VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
  * of the License, or (at your option) any later version.
  *
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
  *
- * For more info, check our website at http://www.gromacs.org
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
  *
- * And Hey:
- * Green Red Orange Magenta Azure Cyan Skyblue
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <string.h>
 
-#include "statutil.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "smalloc.h"
-#include "macros.h"
-#include "vec.h"
-#include "pbc.h"
-#include "copyrite.h"
-#include "futil.h"
-#include "statutil.h"
-#include "index.h"
-#include "mshift.h"
-#include "xvgr.h"
-#include "gstat.h"
-#include "txtdump.h"
-#include "eigio.h"
-#include "mtop_util.h"
-#include "physics.h"
-#include "main.h"
-#include "gmx_ana.h"
-
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/fileio/mtxio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/eigio.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/linearalgebra/eigensolver.h"
-#include "gromacs/linearalgebra/mtxio.h"
 #include "gromacs/linearalgebra/sparsematrix.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 static double cv_corr(double nu, double T)
 {
@@ -268,14 +261,14 @@ nma_sparse_hessian(gmx_sparsematrix_t     *     sparse_hessian,
 int gmx_nmeig(int argc, char *argv[])
 {
     const char            *desc[] = {
-        "[TT]g_nmeig[tt] calculates the eigenvectors/values of a (Hessian) matrix,",
-        "which can be calculated with [TT]mdrun[tt].",
+        "[THISMODULE] calculates the eigenvectors/values of a (Hessian) matrix,",
+        "which can be calculated with [gmx-mdrun].",
         "The eigenvectors are written to a trajectory file ([TT]-v[tt]).",
         "The structure is written first with t=0. The eigenvectors",
         "are written as frames with the eigenvector number as timestamp.",
-        "The eigenvectors can be analyzed with [TT]g_anaeig[tt].",
+        "The eigenvectors can be analyzed with [gmx-anaeig].",
         "An ensemble of structures can be generated from the eigenvectors with",
-        "[TT]g_nmens[tt]. When mass weighting is used, the generated eigenvectors",
+        "[gmx-nmens]. When mass weighting is used, the generated eigenvectors",
         "will be scaled back to plain Cartesian coordinates before generating the",
         "output. In this case, they will no longer be exactly orthogonal in the",
         "standard Cartesian norm, but in the mass-weighted norm they would be.[PAR]",
@@ -285,7 +278,7 @@ int gmx_nmeig(int argc, char *argv[])
         "degree of freedom at the given temperature.",
         "The total correction is printed on the terminal screen.",
         "The recommended way of getting the corrections out is:[PAR]",
-        "[TT]g_nmeig -s topol.tpr -f nm.mtx -first 7 -last 10000 -T 300 -qc [-constr][tt][PAR]",
+        "[TT]gmx nmeig -s topol.tpr -f nm.mtx -first 7 -last 10000 -T 300 -qc [-constr][tt][PAR]",
         "The [TT]-constr[tt] option should be used when bond constraints were used during the",
         "simulation [BB]for all the covalent bonds[bb]. If this is not the case, ",
         "you need to analyze the [TT]quant_corr.xvg[tt] file yourself.[PAR]",
@@ -350,7 +343,7 @@ int gmx_nmeig(int argc, char *argv[])
 
     t_filenm               fnm[] = {
         { efMTX, "-f", "hessian",    ffREAD  },
-        { efTPX, NULL, NULL,         ffREAD  },
+        { efTPR, NULL, NULL,         ffREAD  },
         { efXVG, "-of", "eigenfreq", ffWRITE },
         { efXVG, "-ol", "eigenval",  ffWRITE },
         { efXVG, "-os", "spectrum",  ffOPTWR },
@@ -359,17 +352,17 @@ int gmx_nmeig(int argc, char *argv[])
     };
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, 0,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
     }
 
     /* Read tpr file for volume and number of harmonic terms */
-    read_tpxheader(ftp2fn(efTPX, NFILE, fnm), &tpx, TRUE, &version, &generation);
+    read_tpxheader(ftp2fn(efTPR, NFILE, fnm), &tpx, TRUE, &version, &generation);
     snew(top_x, tpx.natoms);
 
-    read_tpx(ftp2fn(efTPX, NFILE, fnm), NULL, box, &natoms,
+    read_tpx(ftp2fn(efTPR, NFILE, fnm), NULL, box, &natoms,
              top_x, NULL, NULL, &mtop);
     if (bCons)
     {
@@ -495,7 +488,7 @@ int gmx_nmeig(int argc, char *argv[])
     {
         fprintf (out, "%6d %15g\n", begin+i, eigenvalues[i]);
     }
-    ffclose(out);
+    gmx_ffclose(out);
 
 
     if (opt2bSet("-qc", NFILE, fnm))
@@ -584,14 +577,14 @@ int gmx_nmeig(int argc, char *argv[])
             qutot  += qu;
         }
     }
-    ffclose(out);
+    gmx_ffclose(out);
     if (NULL != spec)
     {
         for (j = 0; (j < maxspec); j++)
         {
             fprintf(spec, "%10g  %10g\n", 1.0*j, spectrum[j]);
         }
-        ffclose(spec);
+        gmx_ffclose(spec);
     }
     if (NULL != qc)
     {
@@ -601,7 +594,7 @@ int gmx_nmeig(int argc, char *argv[])
                nharm, nvsite);
         printf("Total correction to cV = %g J/mol K\n", qcvtot);
         printf("Total correction to  H = %g kJ/mol\n", qutot);
-        ffclose(qc);
+        gmx_ffclose(qc);
         please_cite(stdout, "Caleman2011b");
     }
     /* Writing eigenvectors. Note that if mass scaling was used, the eigenvectors