Commit c1bdee13 authored by Mark Friedrichs's avatar Mark Friedrichs
Browse files

Added missing Born radii switching derivative

parent 643ea90e
...@@ -378,10 +378,11 @@ void kReduceGBVIBornForces_kernel() ...@@ -378,10 +378,11 @@ void kReduceGBVIBornForces_kernel()
float energy = 0.0f; float energy = 0.0f;
while (pos < cSim.atoms) while (pos < cSim.atoms)
{ {
float bornRadius = cSim.pBornRadii[pos]; float bornRadius = cSim.pBornRadii[pos];
float4 gbviData = cSim.pGBVIData[pos]; float4 gbviData = cSim.pGBVIData[pos];
float totalForce = 0.0f; float switchDeriv = cSim.pGBVISwitchDerivative[pos];
float* pFt = cSim.pBornForce + pos; float totalForce = 0.0f;
float* pFt = cSim.pBornForce + pos;
int i = cSim.nonbondOutputBuffers; int i = cSim.nonbondOutputBuffers;
while (i >= 4) while (i >= 4)
...@@ -416,7 +417,7 @@ void kReduceGBVIBornForces_kernel() ...@@ -416,7 +417,7 @@ void kReduceGBVIBornForces_kernel()
energy -= gbviData.z*ratio3; energy -= gbviData.z*ratio3;
totalForce += (3.0f*gbviData.z*ratio3)/bornRadius; // 'cavity' term totalForce += (3.0f*gbviData.z*ratio3)/bornRadius; // 'cavity' term
float br2 = bornRadius*bornRadius; float br2 = bornRadius*bornRadius;
totalForce *= (1.0f/3.0f)*br2*br2; totalForce *= (1.0f/3.0f)*br2*br2*switchDeriv;
pFt = cSim.pBornForce + pos; pFt = cSim.pBornForce + pos;
*pFt = totalForce; *pFt = totalForce;
......
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