Contact Identification¶
This module defines a class and function for identifying contacts.
-
class
Contacts
(atoms, unitcell=None)[source]¶ A class for contact identification. Contacts are identified using the coordinates of atoms at the time of instantiation.
atoms must be an
Atomic
instance.Parameters: unitcell ( ndarray
) – orthorhombic unitcell dimension array with shape(3,)
for KDTree. Default is None.
-
iterNeighbors
(atoms, radius, atoms2=None, unitcell=None, seqsep=None)[source]¶ Yield pairs of atoms that are within radius of each other and the distance between them.
If atoms2 is also provided, one atom from atoms and another from atoms2 will be yielded. If one of atoms or atoms2 is a coordinate array, pairs of indices and distances will be yielded.
When orthorhombic unitcell dimensions are provided, periodic boundary conditions will be taken into account (see
KDTree
and alsowrapAtoms()
for details). If atoms is aFrame
instance and unitcell is not provided, unitcell information from frame will be used if available.If seqsep is provided, neighbors will be kept if the sequence separation >= seqsep. Note that seqsep will be ignored if atoms are not provided.
-
findNeighbors
(atoms, radius, atoms2=None, unitcell=None, seqsep=None)[source]¶ Returns list of neighbors that are within radius of each other and the distance between them. See
iterNeighbors()
for more details.