Fix potential problem in Messenger related to MPI window
[hoomd-blue.git] / test / hoomd_script / test_integrate_nph.py
blob5be5b78b00b8c297e044cedd48707c2bbab4fb98
1 # -*- coding: iso-8859-1 -*-
2 # Maintainer: joaander
4 from hoomd_script import *
5 import unittest
6 import os
8 # unit tests for integrate.nph
9 class integrate_nph_tests (unittest.TestCase):
10 def setUp(self):
11 print
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
18 def test(self):
19 all = group.all();
20 integrate.mode_standard(dt=0.005);
21 integrate.nph(group=all, tau=0.5, P=1.0, tauP=0.5);
22 run(100);
24 def test_mtk_cubic(self):
25 all = group.all();
26 integrate.mode_standard(dt=0.005);
27 integrate.nph(group=all, tau=0.5, P=1.0, tauP=0.5);
28 run(100);
30 def test_mtk_orthorhombic(self):
31 all = group.all();
32 integrate.mode_standard(dt=0.005);
33 integrate.nph(group=all, tau=0.5, P=1.0, tauP=0.5, couple="none");
34 run(100);
36 def test_mtk_tetragonal(self):
37 all = group.all();
38 integrate.mode_standard(dt=0.005);
39 integrate.nph(group=all, tau=0.5, P=1.0, tauP=0.5, couple="xy");
40 run(100);
42 def test_mtk_triclinic(self):
43 all = group.all();
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);
46 run(100);
48 # test set_params
49 def test_set_params(self):
50 integrate.mode_standard(dt=0.005);
51 all = group.all();
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);
57 run(100);
59 # test w/ empty group
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)
64 run(1);
66 def tearDown(self):
67 init.reset();
70 if __name__ == '__main__':
71 unittest.main(argv = ['test.py', '-v'])