Fix potential problem in Messenger related to MPI window
[hoomd-blue.git] / test / hoomd_script / test_integrate_bdnvt_rigid.py
blob9e23f03e6c3f2fb06c1494ab298f988d83aa29d1
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_bdnvt_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 bd = integrate.bdnvt_rigid(all, T=1.2, seed=52);
24 run(100);
25 bd.disable();
26 bd = integrate.bdnvt_rigid(all, T=1.2);
27 run(100);
28 bd.disable();
29 bd = integrate.bdnvt_rigid(all, T=1.2, gamma_diam=True);
30 bd.disable();
32 # test set_params
33 def test_set_params(self):
34 all = group.all();
35 bd = integrate.bdnvt_rigid(all, T=1.2);
36 bd.set_params(T=1.3);
38 # test set_gamma
39 def test_set_gamma(self):
40 all = group.all();
41 bd = integrate.bdnvt_rigid(all, T=1.2);
42 bd.set_gamma('A', 0.5);
43 bd.set_gamma('B', 1.0);
45 def tearDown(self):
46 init.reset();
48 # unit tests for integrate.nve_rigid w/o rigid bodies
49 class integrate_bdnvt_rigid_nobody_tests (unittest.TestCase):
50 def setUp(self):
51 print
52 sysdef = init.create_random(N=100, phi_p=0.05);
53 force.constant(fx=0.1, fy=0.1, fz=0.1)
55 # test w/ empty group
56 def test_empty(self):
57 empty = group.cuboid(name="empty", xmin=-100, xmax=-100, ymin=-100, ymax=-100, zmin=-100, zmax=-100)
58 mode = integrate.mode_standard(dt=0.005);
59 nve = integrate.bdnvt_rigid(group=empty, T=1.2)
60 run(1);
62 def tearDown(self):
63 init.reset();
65 if __name__ == '__main__':
66 unittest.main(argv = ['test.py', '-v'])