1 # -*- coding: iso-8859-1 -*-
4 from hoomd_script
import *
9 class charge_pppm_tests (unittest
.TestCase
):
12 s
= init
.create_random(N
=100, phi_p
=0.05);
14 sorter
.set_params(grid
=8)
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
25 c
.set_params(Nx
=16, Ny
=16, Nz
=16, order
=4, rcut
=2.0);
26 integrate
.mode_standard(dt
=0.005);
30 # Cannot test pppm multiple times currently because of implementation limitations
31 ## test missing coefficients
32 #def test_set_missing_coeff(self):
34 #c = charge.pppm(all);
35 #integrate.mode_standard(dt=0.005);
37 #self.assertRaises(RuntimeError, run, 100);
39 ## test enable/disable
40 #def test_enable_disable(self):
42 #c = charge.pppm(all);
43 #c.set_params(Nx=16, Ny=16, Nz=16, order=4, rcut=2.0);
52 if __name__
== '__main__':
53 unittest
.main(argv
= ['test.py', '-v'])