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:
* is NoCutoff, this value will have no effect.
*/
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
* which is acceptable. This value is used to select the reciprocal space cutoff and separation
......@@ -283,7 +274,7 @@ private:
class ParticleInfo;
class ExceptionInfo;
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;
// Retarded visual studio compiler complains about being unable to
......
......@@ -46,7 +46,7 @@ using std::string;
using std::stringstream;
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 {
......@@ -65,14 +65,6 @@ void NonbondedSoftcoreForce::setCutoffDistance(double distance) {
cutoffDistance = distance;
}
double NonbondedSoftcoreForce::getSoftCoreLJLambda( void ) const {
return softCoreLJLambda;
}
void NonbondedSoftcoreForce::setSoftCoreLJLambda(double lambda) {
softCoreLJLambda = lambda;
}
double NonbondedSoftcoreForce::getReactionFieldDielectric( void ) const {
return rfDielectric;
}
......
......@@ -48,16 +48,19 @@ using namespace OpenMM;
extern "C" void initOpenMMCudaFreeEnergyPlugin() {
//(void) fprintf( stderr, "initOpenMMCudaFreeEnergyPlugin called ");
if ( gpuIsAvailable() ){
CudaPlatform* cudaPlatform = new CudaPlatform();
CudaFreeEnergyKernelFactory* factory = new CudaFreeEnergyKernelFactory();
//(void) fprintf( stderr, "gpu is available platform=%p", cudaPlatform);
cudaPlatform->registerKernelFactory(CalcNonbondedSoftcoreForceKernel::Name(), factory);
cudaPlatform->registerKernelFactory(CalcGBSAOBCSoftcoreForceKernel::Name(), factory);
cudaPlatform->registerKernelFactory(CalcGBVISoftcoreForceKernel::Name(), factory);
Platform::registerPlatform(cudaPlatform);
}
//(void) fprintf( stderr, "\n");
}
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,
float r = sqrt(r2);
float lambda = lambdaI < lambdaJ ? lambdaI : lambdaJ;
eps *= lambda;
float lambda2 = lambda*lambda;
eps *= lambda2*lambda2;
// (r/sig)
......
......@@ -54,9 +54,9 @@
using namespace OpenMM;
extern "C" void initOpenMMReferenceFreeEnergyPlugin() {
ReferencePlatform* referencePlatform = new ReferencePlatform();
//(void) fprintf( stderr, "In initOpenMMReferenceFreeEnergyPlugin platform=%p\n", referencePlatform );
ReferenceFreeEnergyKernelFactory* factory = new ReferenceFreeEnergyKernelFactory();
referencePlatform->registerKernelFactory(CalcNonbondedSoftcoreForceKernel::Name(), factory);
referencePlatform->registerKernelFactory(CalcGBSAOBCSoftcoreForceKernel::Name(), factory);
......
......@@ -951,6 +951,7 @@ int ReferenceFreeEnergyLJCoulombSoftcoreIxn::calculateOneSoftCoreLJIxn( RealOpen
static const RealOpenMM zero = 0.0;
static const RealOpenMM one = 1.0;
static const RealOpenMM four = 4.0;
static const RealOpenMM six = 6.0;
static const RealOpenMM twelve = 12.0;
static const RealOpenMM alphaLJ = 0.5;
......@@ -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} ]
eps *= lambda;
eps *= POW( lambda, four );
RealOpenMM sig2 = r/sig;
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