def test_list(self): particle_positions = np.array([[19, -18]]) box_space = np.array([4, 4]) cutoff = 1 s1 = Neighbourlist(particle_positions, box_space, cutoff) print(s1.calculate_index(np.array([-1, 1]))) print(s1.cell_neighbour_list_2D())
def test_list3d(self): particle_positions = np.array([[9, 6, 4]]) box_space = np.array([8, 6, 4]) cutoff = 2 s1 = Neighbourlist(particle_positions, box_space, cutoff) print(s1.calculate_index(np.array([1, 0, 0]))) lol = s1.cell_neighbour_list_3D() print(lol)
def test_cnlist1d_1(self): particle_positions = np.array([[9], [4], [1]]) box_space = np.array([12]) cutoff = 3 s1 = Neighbourlist(particle_positions, box_space, cutoff) print(s1.calculate_index(np.array([1, 0, 0]))) reference_CnList = np.array([[3, 0, 1, 2], [0, 1, 2, 3], [1, 2, 3, 0]]) cnlist = s1.cell_neighbour_list_1D() print(cnlist) sorted_referenceCnList = np.sort(reference_CnList, axis=0) sorted_outputCnList = np.sort(cnlist[:, :, 0], axis=0) npt.assert_equal(sorted_referenceCnList, sorted_outputCnList, 'Failed', verbose=True)