Unverified Commit 979525c7 authored by peastman's avatar peastman Committed by GitHub
Browse files

Merge pull request #1990 from mjschnie/master

Fixed an edge case bug for Gyrcuk Radii. 
parents 44daf269 cf8eea87
...@@ -56,6 +56,10 @@ __device__ void computeBornSumOneInteraction(AtomData1& atom1, AtomData1& atom2) ...@@ -56,6 +56,10 @@ __device__ void computeBornSumOneInteraction(AtomData1& atom1, AtomData1& atom2)
real r2 = dot(delta, delta); real r2 = dot(delta, delta);
real r = SQRT(r2); real r = SQRT(r2);
float sk = atom2.scaledRadius; float sk = atom2.scaledRadius;
if (atom1.radius > r + sk)
return; // No descreening due to atom1 engulfing atom2.
real sk2 = sk*sk; real sk2 = sk*sk;
if (atom1.radius+r < sk) { if (atom1.radius+r < sk) {
real lik = atom1.radius; real lik = atom1.radius;
...@@ -423,6 +427,9 @@ __device__ void computeBornChainRuleInteraction(AtomData3& atom1, AtomData3& ato ...@@ -423,6 +427,9 @@ __device__ void computeBornChainRuleInteraction(AtomData3& atom1, AtomData3& ato
real r = SQRT(r2); real r = SQRT(r2);
real de = 0; real de = 0;
if (atom1.radius > r + sk)
return; // No descreening due to atom1 engulfing atom2.
if (atom1.radius+r < sk) { if (atom1.radius+r < sk) {
real uik = sk-r; real uik = sk-r;
real uik4 = uik*uik; real uik4 = uik*uik;
......
...@@ -157,6 +157,10 @@ void AmoebaReferenceGeneralizedKirkwoodForce::calculateGrycukBornRadii(const vec ...@@ -157,6 +157,10 @@ void AmoebaReferenceGeneralizedKirkwoodForce::calculateGrycukBornRadii(const vec
double r = sqrt(r2); double r = sqrt(r2);
double sk = _atomicRadii[jj]*_scaleFactors[jj]; double sk = _atomicRadii[jj]*_scaleFactors[jj];
// If atom ii engulfs the descreening atom, then continue.
if (_atomicRadii[ii] > r + sk) continue;
double sk2 = sk*sk; double sk2 = sk*sk;
if ((_atomicRadii[ii] + r) < sk) { if ((_atomicRadii[ii] + r) < sk) {
......
...@@ -4151,6 +4151,9 @@ void AmoebaReferenceGeneralizedKirkwoodMultipoleForce::calculateGrycukChainRuleP ...@@ -4151,6 +4151,9 @@ void AmoebaReferenceGeneralizedKirkwoodMultipoleForce::calculateGrycukChainRuleP
double r = sqrt(r2); double r = sqrt(r2);
double de = 0.0; double de = 0.0;
// If atom index engulfs the descreening atom, then there is no descreening.
if (_atomicRadii[iIndex] > r + sk) return;
if ((_atomicRadii[iIndex] + r) < sk) { if ((_atomicRadii[iIndex] + r) < sk) {
double uik4; double uik4;
uik = sk - r; uik = sk - r;
......
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