Commit 9f4bd981 authored by Peter Eastman's avatar Peter Eastman
Browse files

Cuda platform was updating velocities incorrectly on the first time step

parent 7c1846a8
...@@ -1912,7 +1912,6 @@ void* gpuInit(int numAtoms, unsigned int device, bool useBlockingSync) ...@@ -1912,7 +1912,6 @@ void* gpuInit(int numAtoms, unsigned int device, bool useBlockingSync)
gpu->sim.alphaOBC = alphaOBC; gpu->sim.alphaOBC = alphaOBC;
gpu->sim.betaOBC = betaOBC; gpu->sim.betaOBC = betaOBC;
gpu->sim.gammaOBC = gammaOBC; gpu->sim.gammaOBC = gammaOBC;
gpuSetLangevinIntegrationParameters(gpu, 1.0f, 2.0e-3f, 300.0f, 0.0f);
gpu->sim.maxShakeIterations = 15; gpu->sim.maxShakeIterations = 15;
gpu->sim.shakeTolerance = 1.0e-04f * 2.0f; gpu->sim.shakeTolerance = 1.0e-04f * 2.0f;
gpu->sim.InvMassJ = 9.920635e-001f; gpu->sim.InvMassJ = 9.920635e-001f;
...@@ -2021,6 +2020,8 @@ void gpuSetLangevinIntegrationParameters(gpuContext gpu, float tau, float deltaT ...@@ -2021,6 +2020,8 @@ void gpuSetLangevinIntegrationParameters(gpuContext gpu, float tau, float deltaT
(*gpu->psLangevinParameters)[2] = (float) noisescale; (*gpu->psLangevinParameters)[2] = (float) noisescale;
gpu->psLangevinParameters->Upload(); gpu->psLangevinParameters->Upload();
gpu->psStepSize->Download(); gpu->psStepSize->Download();
if ((*gpu->psStepSize)[0].x == 0)
(*gpu->psStepSize)[0].x = deltaT;
(*gpu->psStepSize)[0].y = deltaT; (*gpu->psStepSize)[0].y = deltaT;
gpu->psStepSize->Upload(); gpu->psStepSize->Upload();
} }
...@@ -2031,6 +2032,8 @@ void gpuSetVerletIntegrationParameters(gpuContext gpu, float deltaT, float error ...@@ -2031,6 +2032,8 @@ void gpuSetVerletIntegrationParameters(gpuContext gpu, float deltaT, float error
gpu->sim.oneOverDeltaT = 1.0f/deltaT; gpu->sim.oneOverDeltaT = 1.0f/deltaT;
gpu->sim.errorTol = errorTol; gpu->sim.errorTol = errorTol;
gpu->psStepSize->Download(); gpu->psStepSize->Download();
if ((*gpu->psStepSize)[0].x == 0)
(*gpu->psStepSize)[0].x = deltaT;
(*gpu->psStepSize)[0].y = deltaT; (*gpu->psStepSize)[0].y = deltaT;
gpu->psStepSize->Upload(); gpu->psStepSize->Upload();
} }
...@@ -2045,6 +2048,8 @@ void gpuSetBrownianIntegrationParameters(gpuContext gpu, float tau, float deltaT ...@@ -2045,6 +2048,8 @@ void gpuSetBrownianIntegrationParameters(gpuContext gpu, float tau, float deltaT
gpu->sim.kT = BOLTZ * gpu->sim.T; gpu->sim.kT = BOLTZ * gpu->sim.T;
gpu->sim.noiseAmplitude = sqrt(2.0f*gpu->sim.kT*deltaT*tau); gpu->sim.noiseAmplitude = sqrt(2.0f*gpu->sim.kT*deltaT*tau);
gpu->psStepSize->Download(); gpu->psStepSize->Download();
if ((*gpu->psStepSize)[0].x == 0)
(*gpu->psStepSize)[0].x = deltaT;
(*gpu->psStepSize)[0].y = deltaT; (*gpu->psStepSize)[0].y = deltaT;
gpu->psStepSize->Upload(); gpu->psStepSize->Upload();
} }
......
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