Commit e82796f6 authored by Jason Swails's avatar Jason Swails
Browse files

Fix calling createSystem with unitless hydrogenMass

parent 544581cd
...@@ -28,8 +28,8 @@ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR ...@@ -28,8 +28,8 @@ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE. USE OR OTHER DEALINGS IN THE SOFTWARE.
""" """
from __future__ import absolute_import from __future__ import absolute_import, print_function
from __future__ import print_function
__author__ = "Peter Eastman" __author__ = "Peter Eastman"
__version__ = "1.0" __version__ = "1.0"
...@@ -812,9 +812,11 @@ class ForceField(object): ...@@ -812,9 +812,11 @@ class ForceField(object):
mass = self._atomTypes[typename].mass mass = self._atomTypes[typename].mass
sys.addParticle(mass) sys.addParticle(mass)
# Adjust hydroten masses if requested. # Adjust hydrogen masses if requested.
if hydrogenMass is not None: if hydrogenMass is not None:
if not unit.is_quantity(hydrogenMass):
hydrogenMass *= unit.dalton
for atom1, atom2 in topology.bonds(): for atom1, atom2 in topology.bonds():
if atom1.element == elem.hydrogen: if atom1.element == elem.hydrogen:
(atom1, atom2) = (atom2, atom1) (atom1, atom2) = (atom2, atom1)
......
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