Merge branch 'master' into pygromacs
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_dyecoupl.cpp
similarity index 97%
rename from src/gromacs/gmxana/gmx_dyecoupl.c
rename to src/gromacs/gmxana/gmx_dyecoupl.cpp
index 2f985fa6e5469bbc262807293270a8d2dbadceca..7c8898466a59b01f397a81bcf985219aa6e3645a 100644 (file)
@@ -39,6 +39,7 @@
 #include "gromacs/fileio/trx.h"
 #include "gromacs/fileio/trxio.h"
 #include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
 #include "gromacs/legacyheaders/copyrite.h"
 #include "gromacs/legacyheaders/macros.h"
 #include "gromacs/math/vec.h"
@@ -97,7 +98,7 @@ int gmx_dyecoupl(int argc, char *argv[])
 #define NFILE asize(fnm)
 
 
-    const char  *in_trajfile, *in_ndxfile, *out_xvgrkfile = NULL, *out_xvginstefffile = NULL, *out_xvgrhistfile = NULL, *out_xvgkhistfile = NULL, *out_datfile = NULL;
+    const char  *in_trajfile, *out_xvgrkfile = NULL, *out_xvginstefffile = NULL, *out_xvgrhistfile = NULL, *out_xvgkhistfile = NULL, *out_datfile = NULL;
     gmx_bool     bHaveFirstFrame, bHaveNextFrame, indexOK = TRUE;
     int          ndon, nacc;
     atom_id     *donindex, *accindex;
@@ -138,7 +139,6 @@ int gmx_dyecoupl(int argc, char *argv[])
 
     /* Check command line options for filenames and set bool flags when switch used*/
     in_trajfile        = opt2fn("-f", NFILE, fnm);
-    in_ndxfile         = opt2fn("-n", NFILE, fnm);
     out_xvgrkfile      = opt2fn("-ot", NFILE, fnm);
     out_xvgrhistfile   = opt2fn("-rhist", NFILE, fnm);
     out_xvgkhistfile   = opt2fn("-khist", NFILE, fnm);
@@ -289,8 +289,8 @@ int gmx_dyecoupl(int argc, char *argv[])
                 unitv(donvec, donvec);
                 unitv(accvec, accvec);
 
-                svmul((real) 1. / ndon, donpos, donpos);
-                svmul((real) 1. / nacc, accpos, accpos);
+                svmul(1.0 / ndon, donpos, donpos);
+                svmul(1.0 / nacc, accpos, accpos);
 
                 if (bPBCdist)
                 {
@@ -397,7 +397,7 @@ int gmx_dyecoupl(int argc, char *argv[])
 
                 for (i = 1; i < rkcount; i++)
                 {
-                    bin         = (int) ((rvalues[i] - rmin) / rincr);
+                    bin         = static_cast<int>((rvalues[i] - rmin) / rincr);
                     rhist[bin] += 1;
                 }
                 if (bNormHist)
@@ -431,7 +431,7 @@ int gmx_dyecoupl(int argc, char *argv[])
 
                 for (i = 1; i < rkcount; i++)
                 {
-                    bin         = (int) ((kappa2values[i] - kmin) / kincr);
+                    bin         = static_cast<int>((kappa2values[i] - kmin) / kincr);
                     khist[bin] += 1;
                 }
                 if (bNormHist)