Enable parallel tests.
[hoomd-blue.git] / test / hoomd_script / test_constraint_sphere.py
blob16ed43f04656e02051b055c6ca403b139bdaa6ca
1 # -*- coding: iso-8859-1 -*-
2 # Maintainer: joaander
4 from hoomd_script import *
5 import unittest
6 import os
8 # test the constrain.sphere command
9 class constraint_sphere_tests (unittest.TestCase):
10 def setUp(self):
11 print
12 sysdef = init.create_empty(N=2, box=data.boxdim(L=40), particle_types=['A']);
13 sysdef.particles[0].position = (5,0,0);
14 sysdef.particles[1].position = (-5,1,1);
16 sorter.set_params(grid=8)
18 def test_basic(self):
19 all = group.all()
20 constrain.sphere(group=all, P=(0,0,0), r=5)
21 integrate.mode_standard(dt=0.005);
22 integrate.bdnvt(group=all, T=1.2);
23 run(10);
25 def test_error(self):
26 all = group.all()
27 self.assertRaises(RuntimeError, constrain.sphere, group=all, P=(0,0,0), r=10)
29 def tearDown(self):
30 init.reset();
33 if __name__ == '__main__':
34 unittest.main(argv = ['test.py', '-v'])