Commit 070a0f47 authored by Jason Swails's avatar Jason Swails
Browse files

Fix error check for GBneck parameters

This doesn't lead to incorrect results, but it does erroneously flag some radii
as being illegal when they aren't (making it impossible to run some suggested
systems).

The parameters need to be compared to the table limits *before* subtracting off
the offset, whereas it's currently being done after.
parent 6a40448b
......@@ -335,7 +335,7 @@ def _mbondi3_radii(topology):
def _createEnergyTerms(force, solventDielectric, soluteDielectric, SA, cutoff, kappa, offset):
# Add the energy terms to the CustomGBForce. These are identical for all the GB models.
params = "; solventDielectric=%.16g; soluteDielectric=%.16g; kappa=%.16g; offset=%.16g" % (solventDielectric, soluteDielectric, kappa, offset)
if cutoff is not None:
params += "; cutoff=%.16g" % cutoff
......@@ -535,7 +535,7 @@ class GBSAGBnForce(CustomAmberGBForce):
def addParticle(self, parameters):
parameters = CustomAmberGBForce.addParticle(self, parameters)
if parameters[1] < 0.1 or parameters[1] > 0.2:
if parameters[1] + self.OFFSET < 0.1 or parameters[1] + self.OFFSET > 0.2:
raise ValueError('Radii must be between 1 and 2 Angstroms for neck lookup')
def setParticleParameters(self, idx, parameters):
......
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