next up previous contents index
Next: Function diff Up: Module atoms_module Previous: Function atoms_n_neighbours   Contents   Index

Function atoms_neighbour


\begin{boxedminipage}{\textwidth}
\begin{verbatim}j = atoms_neighbour(this,i...
...nes,shift,index, &
max_dist,jn,alt_connect])\end{verbatim}
\end{boxedminipage}

Return the index of the $n^{\mbox{\small {th}}}$ neighbour of atom $i$. Together with the previous function, this facilites a loop over the neighbours of atom $i$. Optionally, we return other geometric information, such as distance, direction cosines and difference vector, and also an direct index into the neighbour tables. If $i <= j$, this is an index into neighbour1(i), if $i > j$, it is an index into neighbour1(j)


\begin{boxedminipage}{\textwidth}
\begin{verbatim}do n = 1,atoms_n_neighbour...
...e, diff, cosines, shift, index)...
end do\end{verbatim}
\end{boxedminipage}

if distance > max_dist, return 0, and do not waste time calculating other quantities

this -- type(Atoms), intent(in), target

i, n -- integer

distance -- real(dp), optional, intent(out)

diff -- real(dp), dimension(3), optional, intent(out)

cosines -- real(dp), optional, intent(out), dimension(3)

shift -- integer, optional, intent(out), dimension(3)

index -- integer, optional, intent(out)

max_dist -- real(dp), optional, intent(in)

jn -- integer, optional, intent(out)

alt_connect -- type(Connection), optional, intent(in), target

Return value -- integer

diff function
next up previous contents index
Next: Function diff Up: Module atoms_module Previous: Function atoms_n_neighbours   Contents   Index
gabor 2009-06-30