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

Further optimization to updating long range correction (#3275)

* Further optimization to updating long range correction

* Bug fix
parent 4e78d7ae
...@@ -2268,9 +2268,13 @@ double CommonCalcCustomNonbondedForceKernel::execute(ContextImpl& context, bool ...@@ -2268,9 +2268,13 @@ double CommonCalcCustomNonbondedForceKernel::execute(ContextImpl& context, bool
} }
} }
if (recomputeLongRangeCorrection) { if (recomputeLongRangeCorrection) {
if (includeEnergy || forceCopy->getNumEnergyParameterDerivatives() > 0) {
cc.getWorkThread().addTask(new LongRangeTask(cc, context.getOwner(), longRangeCorrectionData, longRangeCoefficient, longRangeCoefficientDerivs, forceCopy)); cc.getWorkThread().addTask(new LongRangeTask(cc, context.getOwner(), longRangeCorrectionData, longRangeCoefficient, longRangeCoefficientDerivs, forceCopy));
hasInitializedLongRangeCorrection = true; hasInitializedLongRangeCorrection = true;
} }
else
hasInitializedLongRangeCorrection = false;
}
if (interactionGroupData.isInitialized()) { if (interactionGroupData.isInitialized()) {
if (!hasInitializedKernel) { if (!hasInitializedKernel) {
hasInitializedKernel = true; hasInitializedKernel = true;
......
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