Package schrodinger :: Package application :: Package desmond :: Package packages :: Module analysis :: Class Pbc
[hide private]
[frames] | no frames]

Class Pbc

object --+
         |
        Pbc

Instance Methods [hide private]
 
__init__(self, box)
This implementation supports the general triclinic cell.
numpy.ndarray
calcMinimumImage(self, ref_pos, pos)
Calculates the minimum image of a position vector pos relative to another position vector ref_pos.
numpy.ndarray
calcMinimumDiff(self, from_pos, to_pos)
Calculates the difference vector from from_pos to the minimum image of to_pos.
numpy.ndarray
wrap(self, pos)
Puts a coordinate back into the box.

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

Properties [hide private]
  box
  volume
  inv_box

Inherited from object: __class__

Method Details [hide private]

__init__(self, box)
(Constructor)

 

This implementation supports the general triclinic cell.

Parameters:
  • box (numpy.ndarray) - 3x3 matrix. For a msys.System instance, you can call msys_model.cell to get this matrix. For a traj.Frame instance, you can call fr.box to get it.
Overrides: object.__init__

calcMinimumImage(self, ref_pos, pos)

 

Calculates the minimum image of a position vector pos relative to another position vector ref_pos. pos and ref_pos can also be arrays of 3D vectors. In this case, they must be of the same size, and minimum images will be calculated for each element in pos and ref_pos.

Parameters:
  • ref_pos (numpy.ndarray. Either 1x3 or Nx3.) - Reference position vector(s)
  • pos (numpy.ndarray. Either 1x3 or Nx3.) - Position vector(s) of which we will calculate the minimum image.
Returns: numpy.ndarray
The position vector(s) of the mininum image. This function does NOT mutate any of the input vectors.

calcMinimumDiff(self, from_pos, to_pos)

 

Calculates the difference vector from from_pos to the minimum image of to_pos. pos and ref_pos can also be arrays of 3D vectors. In this case, they must be of the same size, and minimum image difference will be calculated for each element in pos and ref_pos.

Parameters:
  • from_pos (numpy.ndarray. Either 1x3 or Nx3) - Reference position vector(s)
  • to_pos (numpy.ndarray. Either 1x3 or Nx3) - Position vector(s) of which we will calculate the minimum image.
Returns: numpy.ndarray
The difference vector(s). This function does NOT mutate any of the input vectors.

wrap(self, pos)

 

Puts a coordinate back into the box. If the coordinate is already in the box, this function will return a new position vector that equals the original vector.

Parameters:
  • pos (numpy.ndarray)
Returns: numpy.ndarray
A new position vector which is within the box. This function does NOT mutate and return the input vector pos.

Property Details [hide private]

box

Get Method:
unreachable.box(self)

volume

Get Method:
unreachable.volume(self)

inv_box

Get Method:
unreachable.inv_box(self)