DumpConfigurations - read/write xyz files

espressopp.tools.DumpConfigurations.fastreadxyz(filename)
espressopp.tools.DumpConfigurations.fastwritexyz(filename, system, velocities=True, unfolded=True, append=False, scale=1.0)
espressopp.tools.DumpConfigurations.fastwritexyz_standard(filename, system, unfolded=False, append=False)

Fast write standard xyz file. Generally standard xyz file is

>>>  number of particles
>>>  comment line
>>>  type x y z
>>>  ......
>>>  ......
>>>  ......

Additional information can be found here: Wiki: http://en.wikipedia.org/wiki/XYZ_file_format OpenBabel: http://openbabel.org/wiki/XYZ_%28format%29

In this case one can choose folded or unfolded coordinates. Currently it writes only particle type = 0 and pid is a line number. Later different types should be implemented.

espressopp.tools.DumpConfigurations.readxyz(filename)
espressopp.tools.DumpConfigurations.readxyzr(filename)
espressopp.tools.DumpConfigurations.writexyz(filename, system, velocities=True, unfolded=False, append=False)
espressopp.tools.DumpConfigurations.xyzfilewrite(filename, system, append=False, atomtypes={0: 'Fe', 1: 'O', 2: 'C'}, velocities=False, charge=False)

This method creates a xyz file with the data from a specific system: 1. row: number of the atoms 2. row: REMARK generated by ESPResSo++ following rows: atomsymbol positionX positionY positionZ (velocityX velocityY velocityZ) (charge) last row: END

The method needs the following parameters:

  • filename

    name of the file where the table schould be saved in

  • system

    ESPResSo system which creates the data e.g.:

    >>> system, integrator = espressopp.standard_system.LennardJones(100,(10,10,10))
    
  • append

    =False

    the data in the file will be overwritten

    =True

    the data will be appended

  • atomtypes the xyz file needs atom symbols, so it has to translate the numbers insert a dictionary with the right translation

  • velocities

    =False

    does not save the velocity vectors

    =True

    creates collumns for the velocity vectors and saves the data

  • charge

    =False

    does not save the charge

    =True

    creates collumns for the charges and saves the data