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

Softcore factor multiplying LJ eps is now lambda^4 instead of lambda^1

Removed references to softCoreLJLambda in NonbondedSoftcoreForce
parent 8365dede
...@@ -132,15 +132,6 @@ public: ...@@ -132,15 +132,6 @@ public:
* is NoCutoff, this value will have no effect. * is NoCutoff, this value will have no effect.
*/ */
void setCutoffDistance(double distance); void setCutoffDistance(double distance);
/**
* Get the soft-core LJ lambda (in nm) being used for nonbonded interactions.
* is NoCutoff, this value will have no effect.
*/
double getSoftCoreLJLambda(void) const;
/**
* Set the soft core LJ lambda (in nm) being used for nonbonded interactions.
*/
void setSoftCoreLJLambda(double lambda);
/** /**
* Get the error tolerance for Ewald summation. This corresponds to the fractional error in the forces * Get the error tolerance for Ewald summation. This corresponds to the fractional error in the forces
* which is acceptable. This value is used to select the reciprocal space cutoff and separation * which is acceptable. This value is used to select the reciprocal space cutoff and separation
...@@ -283,7 +274,7 @@ private: ...@@ -283,7 +274,7 @@ private:
class ParticleInfo; class ParticleInfo;
class ExceptionInfo; class ExceptionInfo;
NonbondedSoftcoreMethod nonbondedMethod; NonbondedSoftcoreMethod nonbondedMethod;
double cutoffDistance, rfDielectric, ewaldErrorTol, softCoreLJLambda; double cutoffDistance, rfDielectric, ewaldErrorTol;
void addExclusionsToSet(const std::vector<std::set<int> >& bonded12, std::set<int>& exclusions, int baseParticle, int fromParticle, int currentLevel) const; void addExclusionsToSet(const std::vector<std::set<int> >& bonded12, std::set<int>& exclusions, int baseParticle, int fromParticle, int currentLevel) const;
// Retarded visual studio compiler complains about being unable to // Retarded visual studio compiler complains about being unable to
......
...@@ -46,7 +46,7 @@ using std::string; ...@@ -46,7 +46,7 @@ using std::string;
using std::stringstream; using std::stringstream;
using std::vector; using std::vector;
NonbondedSoftcoreForce::NonbondedSoftcoreForce() : nonbondedMethod(NoCutoff), cutoffDistance(1.0), rfDielectric(78.3), ewaldErrorTol(1e-4), softCoreLJLambda(1.0) { NonbondedSoftcoreForce::NonbondedSoftcoreForce() : nonbondedMethod(NoCutoff), cutoffDistance(1.0), rfDielectric(78.3), ewaldErrorTol(1e-4) {
} }
NonbondedSoftcoreForce::NonbondedSoftcoreMethod NonbondedSoftcoreForce::getNonbondedMethod() const { NonbondedSoftcoreForce::NonbondedSoftcoreMethod NonbondedSoftcoreForce::getNonbondedMethod() const {
...@@ -65,14 +65,6 @@ void NonbondedSoftcoreForce::setCutoffDistance(double distance) { ...@@ -65,14 +65,6 @@ void NonbondedSoftcoreForce::setCutoffDistance(double distance) {
cutoffDistance = distance; cutoffDistance = distance;
} }
double NonbondedSoftcoreForce::getSoftCoreLJLambda( void ) const {
return softCoreLJLambda;
}
void NonbondedSoftcoreForce::setSoftCoreLJLambda(double lambda) {
softCoreLJLambda = lambda;
}
double NonbondedSoftcoreForce::getReactionFieldDielectric( void ) const { double NonbondedSoftcoreForce::getReactionFieldDielectric( void ) const {
return rfDielectric; return rfDielectric;
} }
......
...@@ -48,16 +48,19 @@ using namespace OpenMM; ...@@ -48,16 +48,19 @@ using namespace OpenMM;
extern "C" void initOpenMMCudaFreeEnergyPlugin() { extern "C" void initOpenMMCudaFreeEnergyPlugin() {
//(void) fprintf( stderr, "initOpenMMCudaFreeEnergyPlugin called ");
if ( gpuIsAvailable() ){ if ( gpuIsAvailable() ){
CudaPlatform* cudaPlatform = new CudaPlatform(); CudaPlatform* cudaPlatform = new CudaPlatform();
CudaFreeEnergyKernelFactory* factory = new CudaFreeEnergyKernelFactory(); CudaFreeEnergyKernelFactory* factory = new CudaFreeEnergyKernelFactory();
//(void) fprintf( stderr, "gpu is available platform=%p", cudaPlatform);
cudaPlatform->registerKernelFactory(CalcNonbondedSoftcoreForceKernel::Name(), factory); cudaPlatform->registerKernelFactory(CalcNonbondedSoftcoreForceKernel::Name(), factory);
cudaPlatform->registerKernelFactory(CalcGBSAOBCSoftcoreForceKernel::Name(), factory); cudaPlatform->registerKernelFactory(CalcGBSAOBCSoftcoreForceKernel::Name(), factory);
cudaPlatform->registerKernelFactory(CalcGBVISoftcoreForceKernel::Name(), factory); cudaPlatform->registerKernelFactory(CalcGBVISoftcoreForceKernel::Name(), factory);
Platform::registerPlatform(cudaPlatform); Platform::registerPlatform(cudaPlatform);
} }
//(void) fprintf( stderr, "\n");
} }
KernelImpl* CudaFreeEnergyKernelFactory::createKernelImpl(std::string name, const Platform& platform, ContextImpl& context) const { KernelImpl* CudaFreeEnergyKernelFactory::createKernelImpl(std::string name, const Platform& platform, ContextImpl& context) const {
......
...@@ -37,7 +37,8 @@ __device__ float getSoftCoreLJ( float r2, float sig, float eps, float lambdaI, ...@@ -37,7 +37,8 @@ __device__ float getSoftCoreLJ( float r2, float sig, float eps, float lambdaI,
float r = sqrt(r2); float r = sqrt(r2);
float lambda = lambdaI < lambdaJ ? lambdaI : lambdaJ; float lambda = lambdaI < lambdaJ ? lambdaI : lambdaJ;
eps *= lambda; float lambda2 = lambda*lambda;
eps *= lambda2*lambda2;
// (r/sig) // (r/sig)
......
...@@ -54,9 +54,9 @@ ...@@ -54,9 +54,9 @@
using namespace OpenMM; using namespace OpenMM;
extern "C" void initOpenMMReferenceFreeEnergyPlugin() { extern "C" void initOpenMMReferenceFreeEnergyPlugin() {
ReferencePlatform* referencePlatform = new ReferencePlatform(); ReferencePlatform* referencePlatform = new ReferencePlatform();
//(void) fprintf( stderr, "In initOpenMMReferenceFreeEnergyPlugin platform=%p\n", referencePlatform );
ReferenceFreeEnergyKernelFactory* factory = new ReferenceFreeEnergyKernelFactory(); ReferenceFreeEnergyKernelFactory* factory = new ReferenceFreeEnergyKernelFactory();
referencePlatform->registerKernelFactory(CalcNonbondedSoftcoreForceKernel::Name(), factory); referencePlatform->registerKernelFactory(CalcNonbondedSoftcoreForceKernel::Name(), factory);
referencePlatform->registerKernelFactory(CalcGBSAOBCSoftcoreForceKernel::Name(), factory); referencePlatform->registerKernelFactory(CalcGBSAOBCSoftcoreForceKernel::Name(), factory);
......
...@@ -951,6 +951,7 @@ int ReferenceFreeEnergyLJCoulombSoftcoreIxn::calculateOneSoftCoreLJIxn( RealOpen ...@@ -951,6 +951,7 @@ int ReferenceFreeEnergyLJCoulombSoftcoreIxn::calculateOneSoftCoreLJIxn( RealOpen
static const RealOpenMM zero = 0.0; static const RealOpenMM zero = 0.0;
static const RealOpenMM one = 1.0; static const RealOpenMM one = 1.0;
static const RealOpenMM four = 4.0;
static const RealOpenMM six = 6.0; static const RealOpenMM six = 6.0;
static const RealOpenMM twelve = 12.0; static const RealOpenMM twelve = 12.0;
static const RealOpenMM alphaLJ = 0.5; static const RealOpenMM alphaLJ = 0.5;
...@@ -964,7 +965,7 @@ calculateOneLJIxn( one/r, sig, eps, &dEdROrig, &E_Orig ); ...@@ -964,7 +965,7 @@ calculateOneLJIxn( one/r, sig, eps, &dEdROrig, &E_Orig );
// soft-core LJ energy = lambda*4*eps*[ 1/{alphaLJ*(1-lambda) + (r/sig)**6}**2 - 1/{alphaLJ*(1-lambda) + (r/sig)**6} ] // soft-core LJ energy = lambda*4*eps*[ 1/{alphaLJ*(1-lambda) + (r/sig)**6}**2 - 1/{alphaLJ*(1-lambda) + (r/sig)**6} ]
eps *= lambda; eps *= POW( lambda, four );
RealOpenMM sig2 = r/sig; RealOpenMM sig2 = r/sig;
sig2 *= sig2; sig2 *= sig2;
......
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