PSF - read and write psf format

PSF file format given at http://www.ks.uiuc.edu/Training/Tutorials/namd/namd-tutorial-win-html/node24.html

espressopp.tools.psfwrite(filename, system, maxdist=None, molsize=4, typenames=None)

Writes !NATOM and !NBOND sections of a psf format file

Parameters:
  • filename (string) – output file name
  • system (espressopp System object) – espressopp system
  • maxdist (float) – if this is specified, only bonds in which the pair of particles are separated by a distance < maxdist are written to the !NBOND section
  • molsize (int) – if molsize>0, the molecule count is increased every molsize particles
  • typenames (dict, key=int, value=string) – dictionary used for mapping from espressopp’s integer particle types to the particle type strings written in a psf file
espressopp.tools.psfread(filename)

Reads !NATOM section of a psf format file

Parameters:filename (string) – input file name
Returns:pid,segname,resindex,resname,atomname,atomtype,mass,charge (lists of type int,str,int,str,str,str,float,float)