Enable parallel tests.
[hoomd-blue.git] / test / hoomd_script / test_integrate_nvt_rigid.py
blobce38065d91f74e868ca16de8f5fb576ef2179aaa
1 # -*- coding: iso-8859-1 -*-
2 # Maintainer: joaander
4 from hoomd_script import *
5 import unittest
6 import os
8 # unit tests for integrate.nve_rigid
9 class integrate_nvt_rigid_tests (unittest.TestCase):
10 def setUp(self):
11 print
12 sysdef = init.create_random(N=100, phi_p=0.05);
13 for p in sysdef.particles:
14 p.body = p.tag % 10
16 sysdef.sysdef.getRigidData().initializeData()
17 force.constant(fx=0.1, fy=0.1, fz=0.1)
19 # tests basic creation of the integrater
20 def test_basic(self):
21 all = group.all();
22 integrate.mode_standard(dt=0.005);
23 integrate.nvt_rigid(all, T=1.2, tau=0.5);
24 run(100);
26 # test set_params
27 def test_set_params(self):
28 all = group.all();
29 nvt = integrate.nvt_rigid(all, T=1.2, tau=0.5);
30 nvt.set_params(T=1.3);
32 def tearDown(self):
33 init.reset();
35 # unit tests for integrate.nve_rigid w/o rigid bodies
36 class integrate_nvt_rigid_nobody_tests (unittest.TestCase):
37 def setUp(self):
38 print
39 sysdef = init.create_random(N=100, phi_p=0.05);
40 force.constant(fx=0.1, fy=0.1, fz=0.1)
42 # test w/ empty group
43 def test_empty(self):
44 empty = group.cuboid(name="empty", xmin=-100, xmax=-100, ymin=-100, ymax=-100, zmin=-100, zmax=-100)
45 mode = integrate.mode_standard(dt=0.005);
46 nve = integrate.nvt_rigid(group=empty, T=1.2, tau=0.5)
47 run(1);
49 def tearDown(self):
50 init.reset();
52 if __name__ == '__main__':
53 unittest.main(argv = ['test.py', '-v'])