Merge branch release-2021 into merge-2021-into-master
[alexxy/gromacs.git] / src / gromacs / applied_forces / awh / bias.cpp
index afb2ae1ecf3919bf33251611ccc266668f246158..ea6d4a0795f1c783898c59be4ed181865cfe15f3 100644 (file)
@@ -120,6 +120,10 @@ gmx::ArrayRef<const double> Bias::calcForceAndUpdateBias(const awh_dvec
                 "The step number is negative which is not supported by the AWH code."));
     }
 
+    GMX_RELEASE_ASSERT(!(params_.convolveForce && grid_.hasLambdaAxis()),
+                       "When using AWH to sample an FEP lambda dimension the AWH potential cannot "
+                       "be convolved.");
+
     state_.setCoordValue(grid_, coordValue);
 
     std::vector<double, AlignedAllocator<double>>& probWeightNeighbor = alignedTempWorkSpace_;
@@ -148,12 +152,6 @@ gmx::ArrayRef<const double> Bias::calcForceAndUpdateBias(const awh_dvec
 
             state_.sampleCoordAndPmf(dimParams_, grid_, probWeightNeighbor, convolvedBias);
         }
-        /* Set the umbrella grid point (for the lambda axis) to the
-         * current grid point. */
-        if (params_.convolveForce && grid_.hasLambdaAxis())
-        {
-            state_.setUmbrellaGridpointToGridpoint();
-        }
     }
 
     /* Set the bias force and get the potential contribution from this bias.