To save storage, the neighbour1 table contains all information about the connection but is only filled in for . neighbour2 is just a list of those of 's neighbours with together with an index into the neighbour1 table of atom .
In normal use (i.e. outside this module) you don't need direct access to the tables so you should use the interface functions atoms_n_neighbours and atoms_neighbour which hide the distiction between the cases and .
neighbour1(i)%int | neighbour1(i)%real | |||
1 | 2 | 3 | 4 | 1 |
shift_a | shift_b | shift_c |
neighbour2(i)%int | |
1 | 2 |
N.B. If and are neighbours with shift shift,
then norm(atoms%pos(j) - atoms%pos(i) + shift)
is a minimum.
Mnemonic: shift is added to to get closer to .