Commit fe144750 authored by Peter Eastman's avatar Peter Eastman
Browse files

Bug fix

parent a8e9c99a
...@@ -2473,7 +2473,7 @@ void gpuReorderAtoms(gpuContext gpu) ...@@ -2473,7 +2473,7 @@ void gpuReorderAtoms(gpuContext gpu)
float minx = posq[0].x, maxx = posq[0].x; float minx = posq[0].x, maxx = posq[0].x;
float miny = posq[0].y, maxy = posq[0].y; float miny = posq[0].y, maxy = posq[0].y;
float minz = posq[0].z, maxz = posq[0].z; float minz = posq[0].z, maxz = posq[0].z;
if (gpu->sim.nonbondedMethod == PERIODIC) if (gpu->sim.nonbondedMethod == PERIODIC || gpu->sim.nonbondedMethod == EWALD || gpu->sim.nonbondedMethod == PARTICLE_MESH_EWALD)
{ {
minx = miny = minz = 0.0; minx = miny = minz = 0.0;
maxx = gpu->sim.periodicBoxSizeX; maxx = gpu->sim.periodicBoxSizeX;
...@@ -2523,7 +2523,7 @@ void gpuReorderAtoms(gpuContext gpu) ...@@ -2523,7 +2523,7 @@ void gpuReorderAtoms(gpuContext gpu)
molPos[i].y /= atoms.size(); molPos[i].y /= atoms.size();
molPos[i].z /= atoms.size(); molPos[i].z /= atoms.size();
} }
if (gpu->sim.nonbondedMethod == PERIODIC) if (gpu->sim.nonbondedMethod == PERIODIC || gpu->sim.nonbondedMethod == EWALD || gpu->sim.nonbondedMethod == PARTICLE_MESH_EWALD)
{ {
// Move each molecule position into the same box. // Move each molecule position into the same box.
......
...@@ -559,14 +559,6 @@ void testBlockInteractions(bool periodic) { ...@@ -559,14 +559,6 @@ void testBlockInteractions(bool periodic) {
dy -= (float)(floor(0.5+dy/boxSize)*boxSize); dy -= (float)(floor(0.5+dy/boxSize)*boxSize);
dz -= (float)(floor(0.5+dz/boxSize)*boxSize); dz -= (float)(floor(0.5+dz/boxSize)*boxSize);
} }
if (dx*dx+dy*dy+dz*dz < cutoff*cutoff) {
dx = pos2.x-center1.x;
dy = pos2.y-center1.y;
dz = pos2.z-center1.z;
dx = max(0.0f, abs(dx)-gridSize1.x);
dy = max(0.0f, abs(dy)-gridSize1.y);
dz = max(0.0f, abs(dz)-gridSize1.z);
}
ASSERT(dx*dx+dy*dy+dz*dz > cutoff*cutoff); ASSERT(dx*dx+dy*dy+dz*dz > cutoff*cutoff);
} }
} }
......
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