1 # -*- coding: iso-8859-1 -*-
4 from hoomd_script
import *
9 class pair_nlist_tests (unittest
.TestCase
):
12 init
.create_random(N
=100, phi_p
=0.05);
13 #indirectly create the neighbor list by creating a pair.lj
16 sorter
.set_params(grid
=8)
20 def test_set_params(self
):
21 globals.neighbor_list
.set_params(r_buff
=0.6);
22 globals.neighbor_list
.set_params(check_period
= 20);
24 # test reset_exclusions
25 def test_reset_exclusions_works(self
):
26 globals.neighbor_list
.reset_exclusions();
27 globals.neighbor_list
.reset_exclusions(exclusions
= ['1-2']);
28 globals.neighbor_list
.reset_exclusions(exclusions
= ['1-3']);
29 globals.neighbor_list
.reset_exclusions(exclusions
= ['1-4']);
30 globals.neighbor_list
.reset_exclusions(exclusions
= ['bond']);
31 globals.neighbor_list
.reset_exclusions(exclusions
= ['angle']);
32 globals.neighbor_list
.reset_exclusions(exclusions
= ['dihedral']);
33 globals.neighbor_list
.reset_exclusions(exclusions
= ['bond', 'angle']);
35 # test reset_exclusions error messages
36 def test_reset_exclusions_nowork(self
):
37 self
.assertRaises(RuntimeError,
38 globals.neighbor_list
.reset_exclusions
,
39 exclusions
= ['bond', 'angle', 'invalid']);
44 if __name__
== '__main__':
45 unittest
.main(argv
= ['test.py', '-v'])