Commit 12b839b2 authored by Jason Swails's avatar Jason Swails
Browse files

Add a test for flexibleConstraints.

parent cc03f111
...@@ -95,6 +95,29 @@ class TestForceField(unittest.TestCase): ...@@ -95,6 +95,29 @@ class TestForceField(unittest.TestCase):
validateConstraints(self, topology, system, validateConstraints(self, topology, system,
constraints_value, rigidWater_value) constraints_value, rigidWater_value)
def test_flexibleConstraints(self):
""" Test the flexibleConstraints keyword """
topology = self.pdb1.topology
system1 = self.forcefield1.createSystem(topology, constraints=HAngles,
rigidWater=True)
system2 = self.forcefield1.createSystem(topology, constraints=HAngles,
rigidWater=True, flexibleConstraints=True)
validateConstraints(self, topology, system1, HAngles, True)
validateConstraints(self, topology, system2, HAngles, True)
for force in system1.getForces():
if isinstance(force, HarmonicBondForce):
bf1 = force
elif isinstance(force, HarmonicAngleForce):
af1 = force
for force in system2.getForces():
if isinstance(force, HarmonicBondForce):
bf2 = force
elif isinstance(force, HarmonicAngleForce):
af2 = force
# Make sure we picked up extra terms with flexibleConstraints
self.assertGreater(bf2.getNumBonds(), bf1.getNumBonds())
self.assertGreater(af2.getNumAngles(), af2.getNumAngles())
def test_ImplicitSolvent(self): def test_ImplicitSolvent(self):
"""Test the four types of implicit solvents using the implicitSolvent """Test the four types of implicit solvents using the implicitSolvent
parameter. parameter.
......
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