Make PBC type enumeration into PbcType enum class
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_spol.cpp
index c52f4ab7a50b40ff533033e023b1324b41c9ee4f..d67045be907debdfe1c247d4f380ea00665b474d 100644 (file)
@@ -59,7 +59,7 @@
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
-static void calc_com_pbc(int nrefat, const t_topology* top, rvec x[], t_pbc* pbc, const int index[], rvec xref, int ePBC)
+static void calc_com_pbc(int nrefat, const t_topology* top, rvec x[], t_pbc* pbc, const int index[], rvec xref, PbcType pbcType)
 {
     const real tol = 1e-4;
     gmx_bool   bChanged;
@@ -82,7 +82,7 @@ static void calc_com_pbc(int nrefat, const t_topology* top, rvec x[], t_pbc* pbc
     }
     svmul(1 / mtot, xref, xref);
     /* Now check if any atom is more than half the box from the COM */
-    if (ePBC != epbcNONE)
+    if (pbcType != PbcType::No)
     {
         iter = 0;
         do
@@ -217,7 +217,7 @@ int gmx_spol(int argc, char* argv[])
     }
 
     snew(top, 1);
-    // TODO: Only ePBC is used, not the full inputrec.
+    // TODO: Only pbcType is used, not the full inputrec.
     t_inputrec  irInstance;
     t_inputrec* ir = &irInstance;
     read_tpx_top(ftp2fn(efTPR, NFILE, fnm), ir, box, &natoms, nullptr, nullptr, top);
@@ -246,7 +246,7 @@ int gmx_spol(int argc, char* argv[])
     /* initialize reading trajectory:                         */
     natoms = read_first_x(oenv, &status, ftp2fn(efTRX, NFILE, fnm), &t, &x, box);
 
-    rcut = 0.99 * std::sqrt(max_cutoff2(ir->ePBC, box));
+    rcut = 0.99 * std::sqrt(max_cutoff2(ir->pbcType, box));
     if (rcut == 0)
     {
         rcut = 10 * rmax;
@@ -269,7 +269,7 @@ int gmx_spol(int argc, char* argv[])
     molindex = top->mols.index;
     atom     = top->atoms.atom;
 
-    gpbc = gmx_rmpbc_init(&top->idef, ir->ePBC, natoms);
+    gpbc = gmx_rmpbc_init(&top->idef, ir->pbcType, natoms);
 
     /* start analysis of trajectory */
     do
@@ -277,10 +277,10 @@ int gmx_spol(int argc, char* argv[])
         /* make molecules whole again */
         gmx_rmpbc(gpbc, natoms, box, x);
 
-        set_pbc(&pbc, ir->ePBC, box);
+        set_pbc(&pbc, ir->pbcType, box);
         if (bCom)
         {
-            calc_com_pbc(nrefat, top, x, &pbc, index[0], xref, ir->ePBC);
+            calc_com_pbc(nrefat, top, x, &pbc, index[0], xref, ir->pbcType);
         }
 
         for (m = 0; m < isize[1]; m++)