next up previous contents index
Next: Subroutine partition_atoms Up: Module atoms_module Previous: Subroutine connection_remove_atom   Contents   Index

Subroutine calc_connect


\begin{boxedminipage}{\textwidth}
\begin{verbatim}call calc_connect(this[,own_neighbour])\end{verbatim}
\end{boxedminipage}

Fast $O(N)$ connectivity calculation routine. It divides the unit cell into similarly shaped subcells, of sufficient size that sphere of radius cutoff is contained in a subcell, at least in the directions in which the unit cell is big enough. In narrow directions, the unit cell is replicated on the fly to collect neighbours that are images of the stored atoms. For very small unit cells, there is only one subcell, so the routine is equivalent to the standard $O(N^2)$ method.

this -- type(Atoms), intent(inout)

own_neighbour -- logical, optional, intent(in)

partition_atoms subroutine

gabor 2009-06-30