Build a mask for the nearest neighbors of a given lattice. It is a NxN matrix, with N the number of sites in the lattice, stocking .true. values only for the pairs of sites linked by a "NN-bond". It calls internally xy_shells, for all inter-site distances, so if you need more than NNs consider calling xy_shells directly. Note that we provide a similar subroutine for next-nearest-neighbors, which optionally gives also the NNs, so if just two shells are needed you should call that.
xy_next_nearest_neighbors(lattice,nnn,[nn])
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(xy_lattice), | intent(in) | :: | lattice | |||
logical, | intent(out), | allocatable | :: | nn_mask(:,:) |