xnn.ffnn.models.oplslib.to_forcefield#

xnn.ffnn.models.oplslib.to_forcefield(lib, name=None, version='1.0')[source]#

Write an OPLSLibrary as an in-memory .frc file.

The inverse of from_forcefield(): atom types, equivalences, charges, nonbond(12-6) (sigma-eps, geometric), the four bonded tables, the templates and fragments, a #metadata and a #define. Dihedral V0 constants are not representable in torsion_opls and are dropped (they do not affect forces or energy differences).

Parameters:
  • lib (OPLSLibrary) – The library.

  • name (str, optional) – The #define name; default lib.name.

  • version (str, optional) – Version stamp of every row.

Returns:

Save it with .write(path).

Return type:

xnn.ffnn.common.frc.FrcFile