Commit 3872f39b authored by Jason Swails's avatar Jason Swails
Browse files

Convert temperature from a quantity to float if it's a quantity.

Fix case when OBC2 GB model is used and the salt concentration is non-zero. When
the salt concentration is non-zero, the customgbforces implementation has to be
used (since the native kernel does not support salt concentrations).  However,
since the native kernel runs ~2x faster on CUDA (and most likely far more
efficiently on CPU and Reference, most likely), it is worth continuing to use
the native kernel when possible.
parent 9519a9e9
......@@ -208,6 +208,8 @@ class AmberPrmtopFile(object):
if implicitSolvent is not None and implicitSolventKappa is None:
if unit.is_quantity(implicitSolventSaltConc):
implicitSolventSaltConc = implicitSolventSaltConc.value_in_unit(unit.moles/unit.liter)
if unit.is_quantity(temperature):
temperature = temperature.value_in_unit(unit.kelvin)
# The constant is 1 / sqrt( epsilon_0 * kB / (2 * NA * q^2 * 1000) )
# where NA is avogadro's number, epsilon_0 is the permittivity of
# free space, q is the elementary charge (this number matches
......
......@@ -890,7 +890,7 @@ def readAmberSystem(prmtop_filename=None, prmtop_loader=None, shake=None, gbmode
else:
raise Exception("Illegal value specified for implicit solvent model")
for iAtom in range(prmtop.getNumAtoms()):
if gbmodel == 'OBC2':
if gbmodel == 'OBC2' and implicitSolventKappa == 0:
gb.addParticle(charges[iAtom], gb_parms[iAtom][0], gb_parms[iAtom][1])
elif gbmodel == 'GBn2':
gb.addParticle([charges[iAtom], gb_parms[iAtom][0], gb_parms[iAtom][1],
......
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