Rename havePositionRestraints(...) to haveRestraints(...)
authorArtem Zhmurov <zhmurov@gmail.com>
Tue, 22 Oct 2019 13:47:59 +0000 (15:47 +0200)
committerSzilárd Páll <pall.szilard@gmail.com>
Tue, 22 Oct 2019 17:54:07 +0000 (19:54 +0200)
This function checks if there are  position, distance or orientation
restraints in the system, so the havePositionRestraints(...) name
is misleading.

Change-Id: I9ffaa1ff68172c2227780492577ab1d8626a23f6

src/gromacs/listed_forces/listed_forces.cpp
src/gromacs/listed_forces/listed_forces.h
src/gromacs/mdlib/sim_util.cpp

index 9a469f8f318f2434f1aed85a60d5154b39b0f00e..0a094c4bbe486b90252ccf959ccb126facd996f2 100644 (file)
@@ -462,8 +462,8 @@ calcBondedForces(const t_idef            *idef,
     }
 }
 
-bool havePositionRestraints(const t_idef   &idef,
-                            const t_fcdata &fcd)
+bool haveRestraints(const t_idef   &idef,
+                    const t_fcdata &fcd)
 {
     return
         ((idef.il[F_POSRES].nr > 0) ||
@@ -481,7 +481,7 @@ bool haveCpuListedForces(const t_forcerec &fr,
                          const t_idef     &idef,
                          const t_fcdata   &fcd)
 {
-    return haveCpuBondeds(fr) || havePositionRestraints(idef, fcd);
+    return haveCpuBondeds(fr) || haveRestraints(idef, fcd);
 }
 
 void calc_listed(const t_commrec             *cr,
@@ -512,7 +512,7 @@ void calc_listed(const t_commrec             *cr,
         pbc_null = nullptr;
     }
 
-    if (havePositionRestraints(*idef, *fcd))
+    if (haveRestraints(*idef, *fcd))
     {
         /* TODO Use of restraints triggers further function calls
            inside the loop over calc_one_bond(), but those are too
index 86e1a4e0bfed1c55430b892085aab41058f0814f..84faefc9e4da554781d6ff762aebc6c312ce0277 100644 (file)
@@ -156,9 +156,9 @@ do_force_listed(struct gmx_wallcycle           *wcycle,
                 int                            *global_atom_index,
                 const gmx::StepWorkload        &stepWork);
 
-/*! \brief Returns true if there are position restraints. */
-bool havePositionRestraints(const t_idef   &idef,
-                            const t_fcdata &fcd);
+/*! \brief Returns true if there are position, distance or orientation restraints. */
+bool haveRestraints(const t_idef   &idef,
+                    const t_fcdata &fcd);
 
 /*! \brief Returns true if there are CPU (i.e. not GPU-offloaded) bonded interactions to compute. */
 bool haveCpuBondeds(const t_forcerec &fr);
index b7200de892333a467a45b53f6156893f3d7453b6..6d2ad7048eaff5c6c70d7cc38ada730d3d155961 100644 (file)
@@ -789,7 +789,7 @@ setupDomainLifetimeWorkload(const t_inputrec       &inputrec,
     domainWork.haveSpecialForces      = haveSpecialForces(inputrec, *fr.forceProviders, pull_work, stepWork.computeForces, ed);
     domainWork.haveCpuBondedWork      = haveCpuBondeds(fr);
     domainWork.haveGpuBondedWork      = ((fr.gpuBonded != nullptr) && fr.gpuBonded->haveInteractions());
-    domainWork.haveRestraintsWork     = havePositionRestraints(idef, fcd);
+    domainWork.haveRestraintsWork     = haveRestraints(idef, fcd);
     domainWork.haveCpuListedForceWork = haveCpuListedForces(fr, idef, fcd);
     // Note that haveFreeEnergyWork is constant over the whole run
     domainWork.haveFreeEnergyWork     = (fr.efep != efepNO && mdatoms.nPerturbed != 0);