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

Ignore changes to force group after context creation (#4029)

parent c7efe3d4
......@@ -39,6 +39,7 @@ using namespace OpenMM;
using namespace std;
RBTorsionForceImpl::RBTorsionForceImpl(const RBTorsionForce& owner) : owner(owner) {
forceGroup = owner.getForceGroup();
}
RBTorsionForceImpl::~RBTorsionForceImpl() {
......@@ -64,7 +65,7 @@ void RBTorsionForceImpl::initialize(ContextImpl& context) {
}
double RBTorsionForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy, int groups) {
if ((groups&(1<<owner.getForceGroup())) != 0)
if ((groups&(1<<forceGroup)) != 0)
return kernel.getAs<CalcRBTorsionForceKernel>().execute(context, includeForces, includeEnergy);
return 0.0;
}
......
......@@ -40,6 +40,7 @@ using namespace OpenMM;
using namespace std;
RMSDForceImpl::RMSDForceImpl(const RMSDForce& owner) : owner(owner) {
forceGroup = owner.getForceGroup();
}
RMSDForceImpl::~RMSDForceImpl() {
......@@ -73,7 +74,7 @@ void RMSDForceImpl::initialize(ContextImpl& context) {
}
double RMSDForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy, int groups) {
if ((groups&(1<<owner.getForceGroup())) != 0)
if ((groups&(1<<forceGroup)) != 0)
return kernel.getAs<CalcRMSDForceKernel>().execute(context, includeForces, includeEnergy);
return 0.0;
}
......
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