def test_lennard_jones_energy(self): a = forcefields.lennard_jones(2.0, [1.0, 1.0]) assert_almost_equal(a, -0.015380859) b = forcefields.lennard_jones([2.0, 4.5], [1.0, 1.0]) assert_almost_equal(b, [-0.015380859, -0.00012041]) c = forcefields.lennard_jones([2.0, 4.5], [0.5, 3.5]) assert_almost_equal(c, [-0.05456543, -0.00042149]) d = forcefields.lennard_jones([1.0, 1.5, 20.0], [5.0, 3.5]) assert_almost_equal(d, [1.50000000, -0.268733500, -5.46874988e-08]) e = forcefields.lennard_jones([100.0, 200.0, 500.0], [100.0, 300.0]) assert_almost_equal(e, [0, 0, 0])
def test_lennard_jones_force(self): a = forcefields.lennard_jones(2.0, [1.0, 1.0], force=True) assert_almost_equal(a, -0.045410156) b = forcefields.lennard_jones([2.0, 4.0, 6.0], [1.0, 1.0], force=True) assert_almost_equal(b, [-0.045410156, -3.66032124e-04, -2.14325517e-05]) c = forcefields.lennard_jones([2.0, 4.0, 6.0], [1.5, 4.0], force=True) assert_almost_equal(c, [-0.185302734, -1.46457553e-03, -8.57325038e-05]) d = forcefields.lennard_jones([150.0, 300.0, 500.0], [200.0, 500.0], force=True) assert_almost_equal(d, [-1.7558299e-12, -1.3717421e-14, -3.8400000e-16])
def test_lennard_jones_energy(self): a = forcefields.lennard_jones(2., [1., 1.]) assert_almost_equal(a, -0.015380859)
def test_lennard_jones_force(self): a = forcefields.lennard_jones(2., [1., 1.], force=True) assert_almost_equal(a, -0.045410156)