"plugins/rpmd/openmmapi/vscode:/vscode.git/clone" did not exist on "b4044e737901534b9681b75914d13f5a8a74eced"
Commit 01d9e345 authored by peastman's avatar peastman Committed by GitHub
Browse files

Merge pull request #1504 from jlmaccal/fix_gb

[WIP] Precompute GBNeck terms
parents 77b9b7ba b3471976
......@@ -1217,6 +1217,7 @@ class CharmmPsfFile(object):
else:
raise ValueError('Illegal nonbonded method for use with GBSA')
gb.setForceGroup(self.GB_FORCE_GROUP)
gb.finalize()
system.addForce(gb)
force.setReactionFieldDielectric(1.0) # applies to NonbondedForce
......
......@@ -1006,8 +1006,8 @@ def readAmberSystem(topology, prmtop_filename=None, prmtop_loader=None, shake=No
for i, (r, s) in enumerate(zip(radii, screen)):
if abs(r - gb_parms[i][0]) > 1e-4 or abs(s - gb_parms[i][1]) > 1e-4:
if not warned:
warnings.warn('Non-optimal GB parameters detected for GB '
'model %s' % gbmodel)
warnings.warn(
'Non-optimal GB parameters detected for GB model %s' % gbmodel)
warned = True
gb_parms[i][0], gb_parms[i][1] = r, s
......@@ -1019,7 +1019,13 @@ def readAmberSystem(topology, prmtop_filename=None, prmtop_loader=None, shake=No
gb_parm[2], gb_parm[3], gb_parm[4]])
else:
gb.addParticle([charge, gb_parm[0], gb_parm[1]])
# OBC2 with kappa == 0 uses mm.GBSAOBC2Force, which doesn't have
# a finalize method
if not (gbmodel == 'OBC2' and implicitSolventKappa == 0.):
gb.finalize()
system.addForce(gb)
if nonbondedMethod == 'NoCutoff':
gb.setNonbondedMethod(mm.NonbondedForce.NoCutoff)
elif nonbondedMethod == 'CutoffNonPeriodic':
......
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