1 # -*- coding: iso-8859-1 -*-
4 from hoomd_script
import *
8 # unit tests for integrate.npt
9 class integrate_npt_tests (unittest
.TestCase
):
12 init
.create_random(N
=1000, phi_p
=0.05);
13 force
.constant(fx
=0.1, fy
=0.1, fz
=0.1)
14 lj
= pair
.lj(r_cut
=2.5)
15 lj
.pair_coeff
.set('A','A', epsilon
=1.0, sigma
=1.0)
16 sorter
.set_params(grid
=8)
18 # tests basic creation of the integrator
21 integrate
.mode_standard(dt
=0.005);
22 integrate
.npt(all
, T
=1.2, tau
=0.5, P
=1.0, tauP
=0.5);
25 def test_mtk_cubic(self
):
27 integrate
.mode_standard(dt
=0.005);
28 integrate
.npt(all
, T
=1.2, tau
=0.5, P
=1.0, tauP
=0.5);
31 def test_mtk_orthorhombic(self
):
33 integrate
.mode_standard(dt
=0.005);
34 integrate
.npt(all
, T
=1.2, tau
=0.5, P
=1.0, tauP
=0.5, couple
="none");
37 def test_mtk_tetragonal(self
):
39 integrate
.mode_standard(dt
=0.005);
40 integrate
.npt(all
, T
=1.2, tau
=0.5, P
=1.0, tauP
=0.5, couple
="xy");
43 def test_mtk_triclinic(self
):
45 integrate
.mode_standard(dt
=0.005);
46 integrate
.npt(all
, T
=1.2, tau
=0.5, P
=1.0, tauP
=0.5, couple
="none", all
=True);
50 def test_set_params(self
):
51 integrate
.mode_standard(dt
=0.005);
53 npt
= integrate
.npt(all
, T
=1.2, tau
=0.5, P
=1.0, tauP
=0.5);
54 npt
.set_params(T
=1.3);
55 npt
.set_params(tau
=0.6);
56 npt
.set_params(P
=0.5);
57 npt
.set_params(tauP
=0.6);
58 npt
.set_params(rescale_all
=True)
63 empty
= group
.cuboid(name
="empty", xmin
=-100, xmax
=-100, ymin
=-100, ymax
=-100, zmin
=-100, zmax
=-100)
64 mode
= integrate
.mode_standard(dt
=0.005);
65 nve
= integrate
.npt(group
=empty
, T
=1.0, P
=1.0, tau
=0.5, tauP
=0.5)
72 if __name__
== '__main__':
73 unittest
.main(argv
= ['test.py', '-v'])