Enable parallel tests.
[hoomd-blue.git] / test / hoomd_script / test_integrate_npt.py
blob46793a8777fd60f22d82384aa07af0449036ecd8
1 # -*- coding: iso-8859-1 -*-
2 # Maintainer: joaander
4 from hoomd_script import *
5 import unittest
6 import os
8 # unit tests for integrate.npt
9 class integrate_npt_tests (unittest.TestCase):
10 def setUp(self):
11 print
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
19 def test(self):
20 all = group.all();
21 integrate.mode_standard(dt=0.005);
22 integrate.npt(all, T=1.2, tau=0.5, P=1.0, tauP=0.5);
23 run(100);
25 def test_mtk_cubic(self):
26 all = group.all();
27 integrate.mode_standard(dt=0.005);
28 integrate.npt(all, T=1.2, tau=0.5, P=1.0, tauP=0.5);
29 run(100);
31 def test_mtk_orthorhombic(self):
32 all = group.all();
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");
35 run(100);
37 def test_mtk_tetragonal(self):
38 all = group.all();
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");
41 run(100);
43 def test_mtk_triclinic(self):
44 all = group.all();
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);
47 run(100);
49 # test set_params
50 def test_set_params(self):
51 integrate.mode_standard(dt=0.005);
52 all = group.all();
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)
59 run(100);
61 # test w/ empty group
62 def test_empty(self):
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)
66 run(1);
68 def tearDown(self):
69 init.reset();
72 if __name__ == '__main__':
73 unittest.main(argv = ['test.py', '-v'])