Commit 45cbddce authored by Mark Friedrichs's avatar Mark Friedrichs
Browse files

gpuSetObcSoftcoreParameters was not returning GpuObcGbsaSoftcore reference

parent 1e52c490
......@@ -527,6 +527,7 @@ void CudaFreeEnergyCalcGBSAOBCSoftcoreForceKernel::executeForces(ContextImpl& co
// ---------------------------------------------------------------------------------------
_gpuContext* gpu = data.gpu;
int debug = 1;
static int call = 0;
......
......@@ -40,7 +40,7 @@ GpuObcGbsaSoftcore::~GpuObcGbsaSoftcore( ){
// initialize NonPolarScalingFactors array
int GpuObcGbsaSoftcore::initializeNonPolarScalingFactors( unsigned int numberOfParticles ){
_psNonPolarScalingFactors = new CUDAStream<float>( numberOfParticles, 1, "ObcSoftcoreNonPolarScalingFactors");
_psNonPolarScalingFactors = new CUDAStream<float>( numberOfParticles, 1, "ObcSoftcoreNonPolarScaling");
for( unsigned int ii = 0; ii < numberOfParticles; ii++ ){
(*_psNonPolarScalingFactors)[ii] = 1.0f;
}
......
......@@ -244,9 +244,9 @@ void kReduceObcGbsaBornSum(gpuContext gpu)
*/
extern "C"
void gpuSetObcSoftcoreParameters(gpuContext gpu, float innerDielectric, float solventDielectric, float nonPolarPrefactor,
const std::vector<float>& radius, const std::vector<float>& scale,
const std::vector<float>& charge, const std::vector<float>& nonPolarScalingFactors)
GpuObcGbsaSoftcore* gpuSetObcSoftcoreParameters(gpuContext gpu, float innerDielectric, float solventDielectric, float nonPolarPrefactor,
const std::vector<float>& radius, const std::vector<float>& scale,
const std::vector<float>& charge, const std::vector<float>& nonPolarScalingFactors)
{
// ---------------------------------------------------------------------------------------
......@@ -264,6 +264,7 @@ void gpuSetObcSoftcoreParameters(gpuContext gpu, float innerDielectric, float so
// gpu->bIncludeGBSA = true;
GpuObcGbsaSoftcore* gpuObcGbsaSoftcore = new GpuObcGbsaSoftcore();
gpuObcGbsaSoftcore->initializeNonPolarScalingFactors( gpu->sim.paddedNumberOfAtoms );
gpu->sim.surfaceAreaFactor = -6.0f*PI*4.0f*nonPolarPrefactor*1000.0f*0.4184f;
for (unsigned int i = 0; i < atoms; i++)
{
......@@ -301,6 +302,8 @@ void gpuSetObcSoftcoreParameters(gpuContext gpu, float innerDielectric, float so
gpu->psPosq4->Upload();
gpu->sim.preFactor = 2.0f*electricConstant*((1.0f/innerDielectric)-(1.0f/solventDielectric))*gpu->sim.forceConversionFactor;
return gpuObcGbsaSoftcore;
}
void kCalculateObcGbsaSoftcoreBornSum(gpuContext gpu)
......
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