From a3e935bc88ed8771f17f6f4d60588b81789b9c89 Mon Sep 17 00:00:00 2001 From: Peter Eastman Date: Mon, 1 Apr 2024 15:22:12 -0700 Subject: [PATCH] Clear forces vector before calling PLUMED (#82) --- openmmapi/src/PlumedForceImpl.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/openmmapi/src/PlumedForceImpl.cpp b/openmmapi/src/PlumedForceImpl.cpp index 0752e2f..2eaee4b 100644 --- a/openmmapi/src/PlumedForceImpl.cpp +++ b/openmmapi/src/PlumedForceImpl.cpp @@ -139,6 +139,7 @@ double PlumedForceImpl::computeForce(ContextImpl& context, const vector& p // Calculate the forces and energy. + memset(&forces[0], 0, forces.size()*sizeof(Vec3)); plumed_cmd(plumedmain, "prepareCalc", NULL); plumed_cmd(plumedmain, "performCalcNoUpdate", NULL); if (step != lastStepIndex) {