Merge branch release-2018 into release-2019
[alexxy/gromacs.git] / src / gromacs / ewald / pme.cpp
index 91675f18e92b9538f4bd0a56e3b821d19ed5ca7a..717eadbfad9453d3e300af6466410df170772e1c 100644 (file)
@@ -1129,6 +1129,16 @@ int gmx_pme_do(struct gmx_pme_t *pme,
     const gmx_bool       bBackFFT                = (flags & (GMX_PME_CALC_F | GMX_PME_CALC_POT)) != 0;
     const gmx_bool       bCalcF                  = (flags & GMX_PME_CALC_F) != 0;
 
+    /* We could be passing lambda!=1 while no q or LJ is actually perturbed */
+    if (!pme->bFEP_q)
+    {
+        lambda_q  = 1;
+    }
+    if (!pme->bFEP_lj)
+    {
+        lambda_lj = 1;
+    }
+
     assert(pme->nnodes > 0);
     assert(pme->nnodes == 1 || pme->ndecompdim > 0);