xnn.ffnn.models.charmmlib.to_forcefield#

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

Write a CharmmLibrary as an in-memory .frc file.

The inverse of from_forcefield(): atom types, nonbond(12-6) and nonbond_1-4(12-6) in rmin-eps form (rmin = 2 Rmin/2, the like-pair minimum) with arithmetic combination, the pair overrides, the bonded tables, the templates and fragments, a #metadata with the Coulomb constant and the 1,4 scaling, and a #define.

Parameters:
  • lib (CharmmLibrary) – 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