parmed.openmm.StateDataReporter

class parmed.openmm.StateDataReporter(**kwargs)[source]

This class acts as a state data reporter for OpenMM simulations, but it is a little more generalized. Notable differences are:

  • It allows the units of the output to be specified, with defaults being those used in Amber (e.g., kcal/mol, angstroms^3, etc.)

  • It will write to any object containing a ‘write’ method; not just files. This allows, for instance, writing to a GUI window that implements the desired ‘write’ attribute.

Most of this code is copied from the OpenMM StateDataReporter class, with the above-mentioned changes made.

Parameters
fstr or file-like

Destination to write the state data (file name or file object)

reportIntervalint

Number of steps between state data reports

stepbool, optional

Print out the step number (Default True)

timebool, optional

Print out the simulation time (Defaults True)

potentialEnergybool, optional

Print out the potential energy of the structure (Default True)

kineticEnergybool, optional

Print out the kinetic energy of the structure (Default True)

totalEnergybool, optional

Print out the total energy of the system (Default True)

temperaturebool, optional

Print out the temperature of the system (Default True)

volumebool, optional

Print out the volume of the unit cell. If the system is not periodic, the value is meaningless (Default False)

densitybool, optional

Print out the density of the unit cell. If the system is not periodic, the value is meaningless (Default False)

separatorstr, optional

The string to separate data fields (Default ‘,’)

systemMassfloat, optional

If not None, the density will be computed from this mass, since setting a mass to 0 is used to constrain the position of that particle. (Default None)

energyUnitunit, optional

The units to print energies in (default unit.kilocalories_per_mole)

timeUnitunit, optional

The units to print time in (default unit.picoseconds)

volumeUnitunit, optional

The units print volume in (default unit.angstroms**3)

densityUnitunit, optional

The units to print density in (default unit.grams/unit.item/unit.milliliter)

Methods

describeNextReport(simulation)

Get information about the next report this object will generate.

finalize()

Closes any open file

report(simulation, state)

Generate a report.

__init__(f, reportInterval, step=True, time=True, potentialEnergy=True, kineticEnergy=True, totalEnergy=True, temperature=True, volume=False, density=False, separator=',', systemMass=None, energyUnit=Unit({BaseUnit(base_dim=BaseDimension('amount'), name='mole', symbol='mol'): - 1.0, ScaledUnit(factor=4.184, master=kilojoule, name='kilocalorie', symbol='kcal'): 1.0}), timeUnit=Unit({BaseUnit(base_dim=BaseDimension('time'), name='picosecond', symbol='ps'): 1.0}), volumeUnit=Unit({BaseUnit(base_dim=BaseDimension('length'), name='angstrom', symbol='A'): 3.0}), densityUnit=Unit({BaseUnit(base_dim=BaseDimension('mass'), name='gram', symbol='g'): 1.0, BaseUnit(base_dim=BaseDimension('amount'), name='item', symbol=''): - 1.0, ScaledUnit(factor=0.001, master=decimeter ** 3, name='milliliter', symbol='mL'): - 1.0}))[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(f, reportInterval[, step, time, …])

Initialize self.

describeNextReport(simulation)

Get information about the next report this object will generate.

finalize()

Closes any open file

report(simulation, state)

Generate a report.