"vscode:/vscode.git/clone" did not exist on "1f54f70c95f840170420156a06d1288499d367e3"
Commit 697ab72e authored by Charlles Abreu's avatar Charlles Abreu
Browse files

Fixed TestMetadynamics

parent 82bad78d
...@@ -293,6 +293,8 @@ class BiasVariable(object): ...@@ -293,6 +293,8 @@ class BiasVariable(object):
self.minValue = self._standardize(minValue) self.minValue = self._standardize(minValue)
self.maxValue = self._standardize(maxValue) self.maxValue = self._standardize(maxValue)
self.biasWidth = self._standardize(biasWidth) self.biasWidth = self._standardize(biasWidth)
if not isinstance(periodic, Bool):
raise ValueError("BiasVariable: invalid argument")
self.periodic = periodic self.periodic = periodic
if gridWidth is None: if gridWidth is None:
self.gridWidth = int(np.ceil(5*(maxValue-minValue)/biasWidth)) self.gridWidth = int(np.ceil(5*(maxValue-minValue)/biasWidth))
......
...@@ -16,9 +16,10 @@ class TestMetadynamics(unittest.TestCase): ...@@ -16,9 +16,10 @@ class TestMetadynamics(unittest.TestCase):
system.addForce(force) system.addForce(force)
cv = CustomBondForce('r') cv = CustomBondForce('r')
cv.addBond(0, 1) cv.addBond(0, 1)
bias = BiasVariable(cv, 0.94, 1.06, 0.02) bias = BiasVariable(cv, 0.94, 1.06, 0.00431, gridWidth=31)
meta = Metadynamics(system, [bias], 300*kelvin, 2.0, 5.0, 10) meta = Metadynamics(system, [bias], 300*kelvin, 2.0, 5.0, 10)
integrator = LangevinIntegrator(300*kelvin, 10/picosecond, 0.001*picosecond) integrator = LangevinIntegrator(300*kelvin, 10/picosecond, 0.001*picosecond)
integrator.setRandomNumberSeed(4321)
topology = Topology() topology = Topology()
chain = topology.addChain() chain = topology.addChain()
residue = topology.addResidue('H2', chain) residue = topology.addResidue('H2', chain)
......
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