1 # -*- coding: iso-8859-1 -*-
4 from hoomd_script
import *
8 # test the constrain.sphere command
9 class constraint_sphere_tests (unittest
.TestCase
):
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)
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);
27 self
.assertRaises(RuntimeError, constrain
.sphere
, group
=all
, P
=(0,0,0), r
=10)
33 if __name__
== '__main__':
34 unittest
.main(argv
= ['test.py', '-v'])