Package schrodinger :: Package application :: Package matsci :: Package nano :: Module xtal :: Class PBCBond
[hide private]
[frames] | no frames]

Class PBCBond

object --+
         |
        PBCBond

Class to manage a PBC bond, i.e. a long bond connecting two real atoms on opposite sides of a unit cell that is used in lieu of the bond between the real and image atoms.

Instance Methods [hide private]
 
__init__(self, atom1, atom2, order, also_reg_bond)
Create an instance.
str
__repr__(self)
Define a class representation.
 
setDeltasToNeighboringCells(self, atom1_vec, atom2_vec, spanning_vectors)
Set two dictionaries, one for moving to neighboring cells ahead and one for moving behind.
tuple
getNeighborPBCBond(self, cell_indices, ncella, ncellb, ncellc, cell_size, cell_delta, tail_head)
Return a (tail, head) ordered tuple of atom indices for the neighboring PBC bond in the cell given by the cell delta.
 
offsetAtomData(self, offset)
Offset the atom data of this instance.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  PBC_BOND_THRESHOLD = 1e-3
  PBC_BOND_KEY = 'b_matsci_PBC_bond'
  ALSO_REG_BOND_KEY = 'b_matsci_also_reg_bond'
  PBC_BOND_COLOR_KEY = 'i_m_color'
  PBC_BOND_COLOR = 4
  AHEAD = 'ahead'
  BEHIND = 'behind'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, atom1, atom2, order, also_reg_bond)
(Constructor)

 

Create an instance.

Parameters:
  • atom1 (int) - the first atom index of the bond
  • atom2 (int) - the second atom index of the bond
  • order (int) - the bond order
  • also_reg_bond (bool) - indicates whether this PBC bond is also a regular bond, meaning that one of the atoms of the PBC bond is covalently bound to two copies of the other atom, one inside the cell and one outside the cell
Overrides: object.__init__

__repr__(self)
(Representation operator)

 

Define a class representation.

Returns: str
string representation of the class
Overrides: object.__repr__

setDeltasToNeighboringCells(self, atom1_vec, atom2_vec, spanning_vectors)

 

Set two dictionaries, one for moving to neighboring cells ahead and one for moving behind. Keys are tuples of integer cell deltas and values are (tail, head) tuples giving a directionality of this PBC bond along the given direction.

Parameters:
  • atom1_vec (numpy.array) - vector to the first atom of the PBC bond
  • atom2_vec (numpy.array) - vector to the second atom of the PBC bond
  • spanning_vectors (dict) - keys are tuples of cell index triples, values are tuples of normalized spanning vectors for the cell and their original lengths

getNeighborPBCBond(self, cell_indices, ncella, ncellb, ncellc, cell_size, cell_delta, tail_head)

 

Return a (tail, head) ordered tuple of atom indices for the neighboring PBC bond in the cell given by the cell delta. If this cell is the first or last cell then it will wrap around to the ending or beginning cell, respectively.

Parameters:
  • cell_indices (tuple) - a triple of cell indices
  • ncella (int) - the number of cells along a
  • ncellb (int) - the number of cells along b
  • ncellc (int) - the number of cells along c
  • cell_size (int) - the number of atoms in a cell
  • cell_delta (tuple) - a triple of cell deltas which provide the neighboring cells location
  • tail_head (tuple) - provides the tail and head atom indices for this PBC bond given the cell delta
Returns: tuple
atom indices for the neighboring PBC bond

offsetAtomData(self, offset)

 

Offset the atom data of this instance.

Parameters:
  • offset (int) - the offset to use