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

Fixed an error when using a NonbondedForce inside a CustomCVForce (#3500)

parent 7432ad8c
...@@ -8,8 +8,12 @@ KERNEL void copyState(GLOBAL real4* RESTRICT posq, GLOBAL real4* RESTRICT innerP ...@@ -8,8 +8,12 @@ KERNEL void copyState(GLOBAL real4* RESTRICT posq, GLOBAL real4* RESTRICT innerP
GLOBAL mixed4* RESTRICT velm, GLOBAL mixed4* RESTRICT innerVelm, GLOBAL int* RESTRICT atomOrder, GLOBAL int* RESTRICT innerInvAtomOrder, int numAtoms) { GLOBAL mixed4* RESTRICT velm, GLOBAL mixed4* RESTRICT innerVelm, GLOBAL int* RESTRICT atomOrder, GLOBAL int* RESTRICT innerInvAtomOrder, int numAtoms) {
for (int i = GLOBAL_ID; i < numAtoms; i += GLOBAL_SIZE) { for (int i = GLOBAL_ID; i < numAtoms; i += GLOBAL_SIZE) {
int index = innerInvAtomOrder[atomOrder[i]]; int index = innerInvAtomOrder[atomOrder[i]];
innerPosq[index] = posq[i]; real4 p = posq[i];
innerVelm[index] = velm[i]; p.w = innerPosq[index].w;
innerPosq[index] = p;
mixed4 v = velm[i];
v.w = innerVelm[index].w;
innerVelm[index] = v;
#ifdef USE_MIXED_PRECISION #ifdef USE_MIXED_PRECISION
innerPosqCorrection[index] = posqCorrection[i]; innerPosqCorrection[index] = posqCorrection[i];
#endif #endif
......
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