def set_adjacency(Nx,Ny,Nz,ex,ey,ez):
    """
    Nx = num of lattice points in X-direction
    Ny = num of lattice points in Y-direction
    Nz = num of lattice points in Z-direction
    ex = lattice speeds in X-direction
    ey = lattice speeds in Y-direction
    ez = lattice speeds in Z-direction
    
    returns adjDict = dictionary where the keys are the global lattice point numbers
    and the values are lists of neighboring lattice points
    
    
    """
    adjDict = {}
    
    for z in range(Nz):
        for y in range(Ny):
            for x in range(Nx):
                gid = x + y*Nx+z*Nx*Ny
                for spd in range(len(ex)):
                    dx = int(ex[spd]); dy = int(ey[spd]); dz = int(ez[spd]);
                    tx = (x+dx)%Nx; ty= (y+dy)%Ny; tz = (z+dz)%Nz
                    tid = tx+ty*Nx+tz*Nx*Ny;
                    adjDict.setdefault(gid,[]).append(tid)
                    
    return adjDict