Commit 4de1df08 authored by Peter Eastman's avatar Peter Eastman
Browse files

Fixed bug in CCMA convergence detection

parent 2eaa120b
......@@ -75,7 +75,7 @@ kComputeCCMAConstraintDirections()
// Mark that no blocks have converged yet.
for (unsigned int index = threadIdx.x+blockIdx.x*blockDim.x; index < gridDim.x; index += blockDim.x*gridDim.x)
cSim.pCcmaConverged[index] = false;
cSim.pCcmaConverged[index] = 0;
}
__global__ void
......@@ -219,9 +219,9 @@ void kApplyCCMA(gpuContext gpu, float4* posq, bool addOldPosition)
kComputeCCMAConstraintDirections<<<gpu->sim.blocks, gpu->sim.ccma_threads_per_block>>>();
LAUNCHERROR("kComputeCCMAConstraintDirections");
for (int i = 0; i < 150; i++) {
kComputeCCMAConstraintForces<<<gpu->sim.blocks, gpu->sim.ccma_threads_per_block>>>(posq, addOldPosition);
kMultiplyByCCMAConstraintMatrix<<<gpu->sim.blocks, gpu->sim.ccma_threads_per_block>>>();
kComputeCCMAConstraintForces<<<gpu->sim.blocks, gpu->sim.ccma_threads_per_block, gpu->sim.ccma_threads_per_block*sizeof(int)>>>(posq, addOldPosition);
gpu->psCcmaConverged->Download();
kMultiplyByCCMAConstraintMatrix<<<gpu->sim.blocks, gpu->sim.ccma_threads_per_block, gpu->sim.ccma_threads_per_block*sizeof(int)>>>();
if ((*gpu->psCcmaConverged)[0])
break;
kUpdateCCMAAtomPositions<<<gpu->sim.blocks, gpu->sim.ccma_threads_per_block>>>(posq, i);
......
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