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)
def test_list1d(self): particle_positions = np.array([[1], [0], [3], [4], [0]]) box_space = np.array([4]) cutoff = 2 s1 = Neighbourlist(particle_positions, box_space, cutoff) print(s1.cell_neighbour_list_1D())