xy_nearest_neighbors Subroutine

public pure subroutine xy_nearest_neighbors(lattice, nn_mask)

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])

Arguments

Type IntentOptional Attributes Name
type(xy_lattice), intent(in) :: lattice
logical, intent(out), allocatable :: nn_mask(:,:)

Calls

proc~~xy_nearest_neighbors~~CallsGraph proc~xy_nearest_neighbors xy_neighbors::xy_nearest_neighbors proc~xy_shells xy_neighbors::xy_shells proc~xy_nearest_neighbors->proc~xy_shells proc~xy_distance xy_coordinates::xy_distance proc~xy_shells->proc~xy_distance sort sort proc~xy_shells->sort proc~xy_norm xy_coordinates::xy_norm proc~xy_distance->proc~xy_norm