Move PBC enums to pbc.*
authorTeemu Murtola <teemu.murtola@gmail.com>
Fri, 6 Nov 2015 12:04:12 +0000 (14:04 +0200)
committerTeemu Murtola <teemu.murtola@gmail.com>
Fri, 6 Nov 2015 12:58:07 +0000 (14:58 +0200)
This starts to break the dependency magnet that enums.h and names.h are,
and makes the selection/ module independent of legacyheaders/.

Change-Id: I70d17f913356be5492d3f38aa6f23f499584fe8b

16 files changed:
src/gromacs/domdec/domdec_setup.cpp
src/gromacs/ewald/pme.cpp
src/gromacs/fileio/tpxio.cpp
src/gromacs/gmxana/gmx_covar.cpp
src/gromacs/gmxana/gmx_traj.cpp
src/gromacs/gmxlib/names.cpp
src/gromacs/gmxlib/txtdump.cpp
src/gromacs/gmxpreprocess/genconf.cpp
src/gromacs/legacyheaders/names.h
src/gromacs/legacyheaders/types/enums.h
src/gromacs/mdlib/coupling.cpp
src/gromacs/mdlib/md_support.cpp
src/gromacs/mdlib/tpi.cpp
src/gromacs/pbcutil/pbc.cpp
src/gromacs/pbcutil/pbc.h
src/gromacs/selection/nbsearch.cpp

index 23a23b9dc8911c6fefab7df8a23dc9d3ac609fb4..f2fdf8a3619b54fe115652c1c18710936d2c85c5 100644 (file)
@@ -56,6 +56,7 @@
 #include "gromacs/legacyheaders/types/commrec.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/perf_est.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
index fa2131a72d6d82729592d2ada6501d76b80f5dda..75cce0d9ba6569d453375ef7ba8174784d962460 100644 (file)
@@ -94,6 +94,7 @@
 #include "gromacs/math/units.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/math/vectypes.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/timing/cyclecounter.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/timing/walltime_accounting.h"
index 018c42f74def5a6c40e92c447b6fe642bf3892c4..053570874e4742fbdb2bf2263b4d8264b05e45f6 100644 (file)
@@ -55,6 +55,7 @@
 #include "gromacs/legacyheaders/types/ifunc.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/pbcutil/boxutilities.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/topology/block.h"
 #include "gromacs/topology/mtop_util.h"
 #include "gromacs/topology/symtab.h"
index 97460a0795ac22268055574f64c3b52a88e36280..f8b0bd142657133d6b78a6427e88ca1a3cc461ce 100644 (file)
@@ -51,6 +51,7 @@
 #include "gromacs/linearalgebra/eigensolver.h"
 #include "gromacs/math/do_fit.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/topology/index.h"
 #include "gromacs/utility/arraysize.h"
index 8ed20e92a4efec4acf7055272e658d1489e2d6e2..a2b8399a776e69ced45d1960d20020be0775f115 100644 (file)
@@ -54,6 +54,7 @@
 #include "gromacs/linearalgebra/nrjac.h"
 #include "gromacs/math/units.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/topology/index.h"
 #include "gromacs/utility/arraysize.h"
index ccf0cd1bb9b6873dbfbc53268326afd1dc3e8a51..ac0553f48dd1998c984477272bc393aaa1e41a92 100644 (file)
 
 /* note: these arrays should correspond to enums in include/types/enums.h */
 
-const char *epbc_names[epbcNR+1] =
-{
-    "xyz", "no", "xy", "screw", NULL
-};
-
 const char *ens_names[ensNR+1] =
 {
     "Grid", "Simple", NULL
index 8fae65ec19718c8547b3b85dad77634a74d43019..9ae3252cc7f63e30ba156696c12ab2ace11fe299 100644 (file)
@@ -50,6 +50,7 @@
 #include "gromacs/legacyheaders/types/commrec.h"
 #include "gromacs/legacyheaders/types/ifunc.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
@@ -919,7 +920,7 @@ void pr_inputrec(FILE *fp, int indent, const char *title, t_inputrec *ir,
         PS("cutoff-scheme", ECUTSCHEME(ir->cutoff_scheme));
         PI("nstlist", ir->nstlist);
         PS("ns-type", ENS(ir->ns_type));
-        PS("pbc", EPBC(ir->ePBC));
+        PS("pbc", epbc_names[ir->ePBC]);
         PS("periodic-molecules", EBOOL(ir->bPeriodicMols));
         PR("verlet-buffer-tolerance", ir->verletbuf_tol);
         PR("rlist", ir->rlist);
index 06b9102624a1f8c36c685d915026111e4593e3ee..f352335aa8633b39851ebd3be15d56a8a1551555 100644 (file)
@@ -47,6 +47,7 @@
 #include "gromacs/math/3dtransforms.h"
 #include "gromacs/math/utilities.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/random/random.h"
 #include "gromacs/utility/arraysize.h"
 #include "gromacs/utility/cstringutil.h"
index 2d88c6ec902d575a6373338c258dd2c1279db357..ccdb4d044c98f1bfe68bb9707bda00b56ff0f4ff 100644 (file)
@@ -50,7 +50,6 @@ extern "C" {
  * extra argument (the +1)
  * these should correspond to names.c and include/types/enums.h
  */
-extern const char *epbc_names[epbcNR+1];
 extern const char *etcoupl_names[etcNR+1];
 extern const char *epcoupl_names[epcNR+1];
 extern const char *epcoupltype_names[epctNR+1];
@@ -116,7 +115,6 @@ extern const char *gmx_nbkernel_vdw_names[GMX_NBKERNEL_VDW_NR+1];
 #define ECUTSCHEME(e)  ENUM_NAME(e, ecutsNR, ecutscheme_names)
 #define ENS(e)         ENUM_NAME(e, ensNR, ens_names)
 #define EI(e)          ENUM_NAME(e, eiNR, ei_names)
-#define EPBC(e)        ENUM_NAME(e, epbcNR, epbc_names)
 #define ETCOUPLTYPE(e) ENUM_NAME(e, etcNR, etcoupl_names)
 #define EPCOUPLTYPE(e) ENUM_NAME(e, epcNR, epcoupl_names)
 #define EPCOUPLTYPETYPE(e) ENUM_NAME(e, epctNR, epcoupltype_names)
index dee1fc1e3f7979cfae32dc69941f0ab73e59c69e..0f454b6b4cd5656d85fcaafc74750bcf87c1f0e2 100644 (file)
 #ifndef ENUMS_H_
 #define ENUMS_H_
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-} /* fixes auto-indentation problems */
-#endif
-
 /* note: these enums should correspond to the names in gmxlib/names.c */
 
-enum {
-    epbcXYZ, epbcNONE, epbcXY, epbcSCREW, epbcNR
-};
-
 enum {
     etcNO, etcBERENDSEN, etcNOSEHOOVER, etcYES, etcANDERSEN, etcANDERSENMASSIVE, etcVRESCALE, etcNR
 }; /* yes is an alias for berendsen */
@@ -447,8 +436,4 @@ enum gmx_nblist_interaction_type
     GMX_NBLIST_INTERACTION_NR
 };
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* ENUMS_H_ */
index c1c72f6b72cfab04b958a62a98da9a8808880742..0fd3e52b0cda1c8b01b410d6e2a0af80832dae82 100644 (file)
@@ -55,6 +55,7 @@
 #include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdlib/update.h"
 #include "gromacs/pbcutil/boxutilities.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/random/random.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
index 849f7d9a0e0daa1f0c3cdfa5da45846cd88990cd..5275a72ca9eed84f607b65607c296814af32740c 100644 (file)
@@ -56,6 +56,7 @@
 #include "gromacs/mdlib/mdrun_signalling.h"
 #include "gromacs/mdlib/tgroup.h"
 #include "gromacs/mdlib/vcm.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/topology/mtop_util.h"
 #include "gromacs/utility/arrayref.h"
index 936f4b5541692726fdb2c1610221dbdc8203b2f0..74b06114e00c6b44ced73aaa2965a06c8c6de3b4 100644 (file)
@@ -79,6 +79,7 @@
 #include "gromacs/mdlib/tgroup.h"
 #include "gromacs/mdlib/update.h"
 #include "gromacs/mdlib/vsite.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/random/random.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/timing/walltime_accounting.h"
index 740d57b8fa09bd591d333761911da7604757c5c1..393285f3d743d336a279a88f991ca48dc18267bc 100644 (file)
@@ -50,7 +50,6 @@
 #include <algorithm>
 
 #include "gromacs/legacyheaders/gmx_omp_nthreads.h"
-#include "gromacs/legacyheaders/names.h"
 #include "gromacs/legacyheaders/txtdump.h"
 #include "gromacs/legacyheaders/types/commrec.h"
 #include "gromacs/legacyheaders/types/inputrec.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
 
+const char *epbc_names[epbcNR+1] =
+{
+    "xyz", "no", "xy", "screw", NULL
+};
+
 /* Skip 0 so we have more chance of detecting if we forgot to call set_pbc. */
 enum {
     epbcdxRECTANGULAR = 1, epbcdxTRICLINIC,
index b96a197a2e813f3fd2259281f82c55b62810ea0c..8c239e6716ddd81104b7b83c7c44fcbb8b37069a 100644 (file)
@@ -50,6 +50,13 @@ struct gmx_domdec_t;
 extern "C" {
 #endif
 
+enum {
+    epbcXYZ, epbcNONE, epbcXY, epbcSCREW, epbcNR
+};
+
+//! Strings corresponding to epbc enum values.
+extern const char *epbc_names[epbcNR+1];
+
 /* Maximum number of combinations of single triclinic box vectors
  * required to shift atoms that are within a brick of the size of
  * the diagonal of the box to within the maximum cut-off distance.
index 86fdcbefaed185a097378354f35f05ef366567f3..dcbd1a19b3a98400b9732fb1c61eb39dab682893 100644 (file)
@@ -62,7 +62,6 @@
 #include <algorithm>
 #include <vector>
 
-#include "gromacs/legacyheaders/names.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/selection/position.h"
@@ -890,7 +889,7 @@ void AnalysisNeighborhoodSearchImpl::init(
         {
             std::string message =
                 formatString("Computations in the XY plane are not supported with PBC type '%s'",
-                             EPBC(pbc->ePBC));
+                             epbc_names[pbc->ePBC]);
             GMX_THROW(NotImplementedError(message));
         }
         if (pbc->ePBC == epbcXYZ &&