OpenMM
 All Classes Namespaces Functions Variables Pages
DCDFile Class Reference

DCDFile provides methods for creating DCD files. More...

+ Inheritance diagram for DCDFile:

Public Member Functions

def __init__
 Create a DCD file and write out the header. More...
 
def writeModel
 Write out a model to the DCD file. More...
 

Detailed Description

DCDFile provides methods for creating DCD files.

DCD is a file format for storing simulation trajectories. It is supported by many programs, such as CHARMM, NAMD, and X-PLOR. Note, however, that different programs produce subtly different versions of the format. This class generates the CHARMM version. Also note that there is no standard byte ordering (big-endian or little-endian) for this format. This class always generates files with little-endian ordering.

To use this class, create a DCDFile object, then call writeModel() once for each model in the file.

Constructor & Destructor Documentation

def __init__ (   self,
  file,
  topology,
  dt,
  firstStep = 0,
  interval = 1 
)

Create a DCD file and write out the header.

Parameters
file(file) A file to write to
topology(Topology) The Topology defining the molecular system being written
dt(time) The time step used in the trajectory
firstStep(int=0) The index of the first step in the trajectory
interval(int=1) The frequency (measured in time steps) at which states are written to the trajectory

References DCDFile._file, DCDFile._firstStep, DCDFile._interval, DCDFile._modelCount, DCDFile._topology, and CharmmPsfFile._topology.

Member Function Documentation

def writeModel (   self,
  positions,
  unitCellDimensions = None 
)

Write out a model to the DCD file.

Parameters
positions(list) The list of atomic positions to write
unitCellDimensions(Vec3=None) The dimensions of the crystallographic unit cell. If None, the dimensions specified in the Topology will be used. Regardless of the value specified, no dimensions will be written if the Topology does not represent a periodic system.

References DCDFile._file, DCDFile._firstStep, DCDFile._interval, and DCDFile._modelCount.


The documentation for this class was generated from the following file: