Unverified Commit f68adccc authored by Peter Eastman's avatar Peter Eastman Committed by GitHub
Browse files

Fixed error in long range correction with force groups (#3261)

parent aa8264d0
......@@ -53,6 +53,8 @@ CustomNonbondedForce::CustomNonbondedForce(const string& energy) : energyExpress
CustomNonbondedForce::CustomNonbondedForce(const CustomNonbondedForce& rhs) {
// Copy everything and deep copy the tabulated functions
setForceGroup(rhs.getForceGroup());
setName(rhs.getName());
energyExpression = rhs.energyExpression;
nonbondedMethod = rhs.nonbondedMethod;
cutoffDistance = rhs.cutoffDistance;
......
......@@ -1776,6 +1776,8 @@ public:
cc(cc), longRangeCoefficient(longRangeCoefficient), longRangeCoefficientDerivs(longRangeCoefficientDerivs), force(force) {
}
double computeForceAndEnergy(bool includeForces, bool includeEnergy, int groups) {
if ((groups&(1<<force->getForceGroup())) == 0)
return 0;
cc.getWorkThread().flush();
Vec3 a, b, c;
cc.getPeriodicBoxVectors(a, b, c);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment