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

Fixed error in CustomNonbondedForce on CPU (#3840)

parent e2a5b168
......@@ -172,7 +172,7 @@ void CpuCustomNonbondedForceFvec<FVEC, BLOCK_SIZE>::calculateBlockIxnImpl(Thread
r.store(data.rvec.data());
FVEC dEdR(data.forceVecExpression.evaluate());
FVEC energy;
if (includeEnergy)
if (includeEnergy || useSwitch)
energy = FVEC(data.energyVecExpression.evaluate());
if (useSwitch) {
const auto t = blendZero((r-switchingDistance)*invSwitchingInterval, r>switchingDistance);
......
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