1 # -*- coding: iso-8859-1 -*-
4 from hoomd_script
import *
8 # unit tests for integrate.nve_rigid
9 class integrate_bdnvt_rigid_tests (unittest
.TestCase
):
12 sysdef
= init
.create_random(N
=100, phi_p
=0.05);
13 for p
in sysdef
.particles
:
16 sysdef
.sysdef
.getRigidData().initializeData()
17 force
.constant(fx
=0.1, fy
=0.1, fz
=0.1)
19 # tests basic creation of the integrater
22 integrate
.mode_standard(dt
=0.005);
23 bd
= integrate
.bdnvt_rigid(all
, T
=1.2, seed
=52);
26 bd
= integrate
.bdnvt_rigid(all
, T
=1.2);
29 bd
= integrate
.bdnvt_rigid(all
, T
=1.2, gamma_diam
=True);
33 def test_set_params(self
):
35 bd
= integrate
.bdnvt_rigid(all
, T
=1.2);
39 def test_set_gamma(self
):
41 bd
= integrate
.bdnvt_rigid(all
, T
=1.2);
42 bd
.set_gamma('A', 0.5);
43 bd
.set_gamma('B', 1.0);
48 # unit tests for integrate.nve_rigid w/o rigid bodies
49 class integrate_bdnvt_rigid_nobody_tests (unittest
.TestCase
):
52 sysdef
= init
.create_random(N
=100, phi_p
=0.05);
53 force
.constant(fx
=0.1, fy
=0.1, fz
=0.1)
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)
65 if __name__
== '__main__':
66 unittest
.main(argv
= ['test.py', '-v'])