Merge branch 'release-2019' into master
[alexxy/gromacs.git] / src / gromacs / mdlib / constr.cpp
index cf66b046a7a6d6955a043bb0c4fd74329c9e4618..e75f429e782970b325c02bd160075f5c89dcc2a7 100644 (file)
@@ -189,6 +189,23 @@ int Constraints::numFlexibleConstraints() const
     return impl_->nflexcon;
 }
 
+bool Constraints::havePerturbedConstraints() const
+{
+    const gmx_ffparams_t &ffparams = impl_->mtop.ffparams;
+
+    for (size_t i = 0; i < ffparams.functype.size(); i++)
+    {
+        if ((ffparams.functype[i] == F_CONSTR ||
+             ffparams.functype[i] == F_CONSTRNC) &&
+            ffparams.iparams[i].constr.dA != ffparams.iparams[i].constr.dB)
+        {
+            return true;
+        }
+    }
+
+    return false;
+}
+
 //! Clears constraint quantities for atoms in nonlocal region.
 static void clear_constraint_quantity_nonlocal(gmx_domdec_t *dd, rvec *q)
 {