espressomd.io.writer package

Submodules

espressomd.io.writer.h5md module

Interface module for the H5md core implementation.

class espressomd.io.writer.h5md.H5md(file_path, unit_system=<espressomd.io.writer.h5md.UnitSystem object>)[source]

Bases: object

H5md file object.

Used for accessing the H5MD core implementation.

Note

Bonds will be written to the file automatically if they exist.

Parameters
  • file_path (str) – Path to the trajectory file.

  • unit_system (UnitSystem, optional) – Physical units for the data.

close()[source]

Close the H5md file.

flush()[source]

Call the H5md flush method.

get_params()[source]

Get the parameters from the script interface.

write()[source]

Call the H5md write method.

class espressomd.io.writer.h5md.UnitSystem(**kwargs)[source]

Bases: object

Data class for writing H5MD trajectories with physical units. There are four settable units: ‘mass’, ‘length’, ‘time’, ‘charge’. Units should be written as strings following the specifications defined here, e.g. UnitSystem(time='ps', mass='u', length='nm', charge='e').

espressomd.io.writer.vtf module

espressomd.io.writer.vtf.vtf_pid_map(system, types='all')[source]

Generates a VTF particle index map to ESPResSo id. This fills the gap for particle ID’s as required by VMD.

Parameters
Returns

A dictionary where the values are the VTF indices and the keys are the ESPresSo particle id.

Return type

dict

espressomd.io.writer.vtf.writevcf(system, fp, types='all')[source]

writes a VCF (VTF Coordinate Format) to a file. This can be used to write a timestep to a VTF file.

Parameters
  • system (espressomd.system.System)

  • types (str) – Specifies the particle types. The string ‘all’ will write all particles

  • fp (file) – File pointer to write to.

espressomd.io.writer.vtf.writevsf(system, fp, types='all')[source]

writes a VST (VTF Structure Format) to a file. This can be used to write the header of a VTF file.

Parameters
  • system (espressomd.system.System)

  • types (str) – Specifies the particle types. The string ‘all’ will write all particles

  • fp (file) – File pointer to write to.

Module contents