mol2 Class Reference


Detailed Description

Writes a simulation snapshot in the MOL2 format.

Every period time steps, a new file will be created. The state of the particles at that time step is written to the file in the MOL2 format.

The intended usage is to use write() to generate a single structure file that can be used by VMD for reading in particle names and bond topology Use in conjunction with dump.dcd for reading the full simulation trajectory into VMD.

Public Member Functions

def __init__
 Initialize the mol2 writer.
def write
 Write a file at the current time step.
def disable
 Disables the analyzer.
def enable
 Enables the analyzer.
def set_period
 Changes the period between analyzer executions.


Member Function Documentation

def __init__ (   self,
  filename = "dump",
  period = None 
)

Initialize the mol2 writer.

Parameters:
filename (optional) Base of the file name
period (optional) Number of time steps between file dumps
Examples:
 dump.mol2(filename="atoms.dump", period=1000)
 mol2 = dump.mol2(filename="particles", period=1e5)
 mol2 = dump.mol2()

If period is set, a new file will be created every period steps. The time step at which the file is created is added to the file name in a fixed width format to allow files to easily be read in order. I.e. the write at time step 0 with filename="particles" produces the file particles.0000000000.mol2

If period is not specified, then no periodic updates will occur. Instead, the write() command must be executed to write an output file.

period can be a function: see Variable period specification for details

def disable (   self  )  [inherited]

Disables the analyzer.

Examples:

 analyzer.disable()

Executing the disable command will remove the analyzer from the system. Any run() command executed after disabling an analyzer will not use that analyzer during the simulation. A disabled analyzer can be re-enabled with enable()

To use this command, you must have saved the analyzer in a variable, as shown in this example:

 analyzer = analyzer.some_analyzer()
 # ... later in the script
 analyzer.disable()

def enable (   self  )  [inherited]

Enables the analyzer.

Examples:

 analyzer.enable()

See disable() for a detailed description.

def set_period (   self,
  period 
) [inherited]

Changes the period between analyzer executions.

Parameters:
period New period to set
Examples:
 analyzer.set_period(100)
 analyzer.set_period(1)

While the simulation is running, the action of each analyzer is executed every period time steps.

To use this command, you must have saved the analyzer in a variable, as shown in this example:

 analyzer = analyze.some_analyzer()
 # ... later in the script
 analyzer.set_period(10)

def write (   self,
  filename 
)

Write a file at the current time step.

Parameters:
filename File name to write to
The periodic file writes can be temporarily overridden and a file with any file name written at the current time step.

Executing write() requires that the dump was saved in a variable when it was specified.

 mol2 = dump.mol2()

Examples:

 mol2.write(filename="start.mol2")


Generated on Tue Mar 24 17:40:34 2009 for HOOMD by doxygen 1.5.7.1