Make PBC type enumeration into PbcType enum class
[alexxy/gromacs.git] / src / gromacs / mdtypes / inputrec.cpp
index ec77f940f08ad37b2d16cda57a69a3e11ee16cd5..c7a4ea7096b384c4a5ab41d77035d554c4edba51 100644 (file)
@@ -854,7 +854,7 @@ void pr_inputrec(FILE* fp, int indent, const char* title, const t_inputrec* ir,
         /* Neighborsearching parameters */
         PS("cutoff-scheme", ECUTSCHEME(ir->cutoff_scheme));
         PI("nstlist", ir->nstlist);
-        PS("pbc", epbc_names[ir->ePBC]);
+        PS("pbc", c_pbcTypeNames[ir->pbcType].c_str());
         PS("periodic-molecules", EBOOL(ir->bPeriodicMols));
         PR("verlet-buffer-tolerance", ir->verletbuf_tol);
         PR("rlist", ir->rlist);
@@ -1293,7 +1293,7 @@ void cmp_inputrec(FILE* fp, const t_inputrec* ir1, const t_inputrec* ir2, real f
     cmp_int64(fp, "inputrec->nsteps", ir1->nsteps, ir2->nsteps);
     cmp_int64(fp, "inputrec->init_step", ir1->init_step, ir2->init_step);
     cmp_int(fp, "inputrec->simulation_part", -1, ir1->simulation_part, ir2->simulation_part);
-    cmp_int(fp, "inputrec->ePBC", -1, ir1->ePBC, ir2->ePBC);
+    cmp_int(fp, "inputrec->pbcType", -1, static_cast<int>(ir1->pbcType), static_cast<int>(ir2->pbcType));
     cmp_bool(fp, "inputrec->bPeriodicMols", -1, ir1->bPeriodicMols, ir2->bPeriodicMols);
     cmp_int(fp, "inputrec->cutoff_scheme", -1, ir1->cutoff_scheme, ir2->cutoff_scheme);
     cmp_int(fp, "inputrec->nstlist", -1, ir1->nstlist, ir2->nstlist);
@@ -1486,7 +1486,7 @@ gmx_bool inputrecNphTrotter(const t_inputrec* ir)
 
 bool inputrecPbcXY2Walls(const t_inputrec* ir)
 {
-    return (ir->ePBC == epbcXY && ir->nwall == 2);
+    return (ir->pbcType == PbcType::XY && ir->nwall == 2);
 }
 
 bool integratorHasConservedEnergyQuantity(const t_inputrec* ir)
@@ -1525,7 +1525,7 @@ int inputrec2nboundeddim(const t_inputrec* ir)
     }
     else
     {
-        return ePBC2npbcdim(ir->ePBC);
+        return numPbcDimensions(ir->pbcType);
     }
 }
 
@@ -1533,12 +1533,12 @@ int ndof_com(const t_inputrec* ir)
 {
     int n = 0;
 
-    switch (ir->ePBC)
+    switch (ir->pbcType)
     {
-        case epbcXYZ:
-        case epbcNONE: n = 3; break;
-        case epbcXY: n = (ir->nwall == 0 ? 3 : 2); break;
-        case epbcSCREW: n = 1; break;
+        case PbcType::Xyz:
+        case PbcType::No: n = 3; break;
+        case PbcType::XY: n = (ir->nwall == 0 ? 3 : 2); break;
+        case PbcType::Screw: n = 1; break;
         default: gmx_incons("Unknown pbc in calc_nrdf");
     }