1 # -*- coding: iso-8859-1 -*-
4 from hoomd_script
import *
9 class pair_cgcmm_tests (unittest
.TestCase
):
12 init
.create_random(N
=100, phi_p
=0.05);
14 sorter
.set_params(grid
=8)
16 # basic test of creation
18 cgcmm
= pair
.cgcmm(r_cut
=3.0);
19 cgcmm
.pair_coeff
.set('A', 'A', epsilon
=1.0, sigma
=1.0, alpha
=1.0, exponents
='lj12_4');
20 cgcmm
.update_coeffs();
22 # test missing coefficients
23 def test_set_missing_epsilon(self
):
24 cgcmm
= pair
.cgcmm(r_cut
=3.0);
25 cgcmm
.pair_coeff
.set('A', 'A', sigma
=1.0, alpha
=1.0);
26 self
.assertRaises(RuntimeError, cgcmm
.update_coeffs
);
28 # test missing coefficients
29 def test_missing_AA(self
):
30 cgcmm
= pair
.cgcmm(r_cut
=3.0);
31 self
.assertRaises(RuntimeError, cgcmm
.update_coeffs
);
33 # test nlist subscribe
34 def test_nlist_subscribe(self
):
35 cgcmm
= pair
.cgcmm(r_cut
=2.5);
36 globals.neighbor_list
.update_rcut();
37 self
.assertAlmostEqual(2.5, globals.neighbor_list
.r_cut
);
43 if __name__
== '__main__':
44 unittest
.main(argv
= ['test.py', '-v'])