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

Bug fix for GBVI force

parent dcd9f1ce
...@@ -1108,18 +1108,14 @@ void gpuSetGBVIParameters(gpuContext gpu, float innerDielectric, float solventDi ...@@ -1108,18 +1108,14 @@ void gpuSetGBVIParameters(gpuContext gpu, float innerDielectric, float solventDi
(*gpu->psGBVIData)[i].w = 1.0f; (*gpu->psGBVIData)[i].w = 1.0f;
(*gpu->psGBVISwitchDerivative)[i] = 1.0f; (*gpu->psGBVISwitchDerivative)[i] = 1.0f;
(*gpu->psObcData)[i].x = radius[i];
(*gpu->psObcData)[i].y = 0.9f*radius[i];
#undef DUMP_PARAMETERS
#define DUMP_PARAMETERS 0 #define DUMP_PARAMETERS 0
#if (DUMP_PARAMETERS == 1) #if (DUMP_PARAMETERS == 1)
(void) fprintf( stderr,"GBVI param: %5u R=%14.7e scaledR=%14.7e gamma*tau=%14.7e bornRadiusScaleFactor=%14.7e\n", (void) fprintf( stderr,"GBVI param: %5u R=%15.7e scaledR=%15.7e R-S=%15.7e gamma*tau=%15.7e bornRadiusScaleFactor=%15.7e\n",
i, (*gpu->psGBVIData)[i].x, (*gpu->psGBVIData)[i].y, i, (*gpu->psGBVIData)[i].x, (*gpu->psGBVIData)[i].y, (*gpu->psGBVIData)[i].x - (*gpu->psGBVIData)[i].y,
(*gpu->psGBVIData)[i].z, (*gpu->psGBVIData)[i].w ); (*gpu->psGBVIData)[i].z, (*gpu->psGBVIData)[i].w );
#endif #endif
#undef DUMP_PARAMETERS
} }
//(void) fprintf( stderr, "gpuSetGBVIParameters: setting Obc parameters!!!! should be removed.\n" );
// Dummy out extra atom data // Dummy out extra atom data
for (unsigned int i = atoms; i < gpu->sim.paddedNumberOfAtoms; i++) for (unsigned int i = atoms; i < gpu->sim.paddedNumberOfAtoms; i++)
{ {
......
...@@ -62,8 +62,8 @@ static __device__ float getGBVI_Volume( float r, float R, float S ) ...@@ -62,8 +62,8 @@ static __device__ float getGBVI_Volume( float r, float R, float S )
return (mask*( L_upper - L_lower ) + addOn); return (mask*( L_upper - L_lower ) + addOn);
*/ */
float addOn = 0.0; float addOn = 0.0;
float mask = 1.0; float mask = 1.0;
float lowerBound = (r - S); float lowerBound = (r - S);
float diff = (S - R); float diff = (S - R);
...@@ -130,6 +130,7 @@ static __device__ float getGBVI_dE2( float r, float R, float S, float bornForce ...@@ -130,6 +130,7 @@ static __device__ float getGBVI_dE2( float r, float R, float S, float bornForce
} }
float dE2 = getGBVI_dL_dr( r, lowerBound, S ) + mask*getGBVI_dL_dx( r, lowerBound, S ); float dE2 = getGBVI_dL_dr( r, lowerBound, S ) + mask*getGBVI_dL_dx( r, lowerBound, S );
dE -= (absDiff >= r) && r >= diff ? 0.0f : dE2; dE -= (absDiff >= r) && r >= diff ? 0.0f : dE2;
dE = r < -diff ? 0.0f : dE;
dE *= ( (r > 1.0e-08f) ? (bornForce/r) : 0.0f); dE *= ( (r > 1.0e-08f) ? (bornForce/r) : 0.0f);
......
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