Fix potential problem in Messenger related to MPI window
[hoomd-blue.git] / test / hoomd_script / test_charge_pppm.py
blob131ce84474dcf86af32ac524cddef08fb5dab623
1 # -*- coding: iso-8859-1 -*-
2 # Maintainer: joaander
4 from hoomd_script import *
5 import unittest
6 import os
8 # charge.pppm
9 class charge_pppm_tests (unittest.TestCase):
10 def setUp(self):
11 print
12 s = init.create_random(N=100, phi_p=0.05);
14 sorter.set_params(grid=8)
15 for i in range(0,50):
16 s.particles[i].charge = -1;
18 for i in range(50,100):
19 s.particles[i].charge = 1;
21 # basic test of creation and param setting
22 def test(self):
23 all = group.all()
24 c = charge.pppm(all);
25 c.set_params(Nx=16, Ny=16, Nz=16, order=4, rcut=2.0);
26 integrate.mode_standard(dt=0.005);
27 integrate.nve(all);
28 run(100);
30 # Cannot test pppm multiple times currently because of implementation limitations
31 ## test missing coefficients
32 #def test_set_missing_coeff(self):
33 #all = group.all()
34 #c = charge.pppm(all);
35 #integrate.mode_standard(dt=0.005);
36 #integrate.nve(all);
37 #self.assertRaises(RuntimeError, run, 100);
39 ## test enable/disable
40 #def test_enable_disable(self):
41 #all = group.all()
42 #c = charge.pppm(all);
43 #c.set_params(Nx=16, Ny=16, Nz=16, order=4, rcut=2.0);
45 #c.disable(log=True);
46 #c.enable();
48 def tearDown(self):
49 init.reset();
52 if __name__ == '__main__':
53 unittest.main(argv = ['test.py', '-v'])