1 # -*- coding: iso-8859-1 -*-
4 from hoomd_script
import *
8 # unit tests for integrate.nph
9 class integrate_nph_tests (unittest
.TestCase
):
12 init
.create_random(N
=100, phi_p
=0.05);
13 force
.constant(fx
=0.1, fy
=0.1, fz
=0.1)
15 sorter
.set_params(grid
=8)
17 # tests basic creation of the integrator
20 integrate
.mode_standard(dt
=0.005);
21 integrate
.nph(group
=all
, tau
=0.5, P
=1.0, tauP
=0.5);
24 def test_mtk_cubic(self
):
26 integrate
.mode_standard(dt
=0.005);
27 integrate
.nph(group
=all
, tau
=0.5, P
=1.0, tauP
=0.5);
30 def test_mtk_orthorhombic(self
):
32 integrate
.mode_standard(dt
=0.005);
33 integrate
.nph(group
=all
, tau
=0.5, P
=1.0, tauP
=0.5, couple
="none");
36 def test_mtk_tetragonal(self
):
38 integrate
.mode_standard(dt
=0.005);
39 integrate
.nph(group
=all
, tau
=0.5, P
=1.0, tauP
=0.5, couple
="xy");
42 def test_mtk_triclinic(self
):
44 integrate
.mode_standard(dt
=0.005);
45 integrate
.nph(group
=all
, tau
=0.5, P
=1.0, tauP
=0.5, couple
="none", all
=True);
49 def test_set_params(self
):
50 integrate
.mode_standard(dt
=0.005);
52 nph
= integrate
.nph(group
=all
, tau
=0.5, P
=1.0, tauP
=0.5);
53 nph
.set_params(T
=1.3);
54 nph
.set_params(tau
=0.6);
55 nph
.set_params(P
=0.5);
56 nph
.set_params(tauP
=0.6);
60 def test_empty_mtk(self
):
61 empty
= group
.cuboid(name
="empty", xmin
=-100, xmax
=-100, ymin
=-100, ymax
=-100, zmin
=-100, zmax
=-100)
62 mode
= integrate
.mode_standard(dt
=0.005);
63 nve
= integrate
.nph(group
=empty
, P
=1.0, tau
=0.5, tauP
=0.5)
70 if __name__
== '__main__':
71 unittest
.main(argv
= ['test.py', '-v'])