xnn.ffnn.models.ffield.to_forcefield#
- xnn.ffnn.models.ffield.to_forcefield(lib, name=None, version='1.0', reference_text='')[source]#
Write a classical
FFieldLibraryas an in-memory.frcfile.The inverse of
from_forcefield(): the standard blocks become the#reaxff_*sections (value columns in SEAMM’s alphabetical order, as SEAMM itself writes them), plus a#defineand#metadata.- Parameters:
lib (FFieldLibrary) – The library; must be classical (
not lib.is_nn).name (str, optional) – The
#definename; default"reaxff/<lib.name>".version (str, optional) – Version stamp of every row and the
#reference 1text.reference_text (str, optional) – Version stamp of every row and the
#reference 1text.
- Returns:
Save it with
.write(path).- Return type:
- Raises:
ValueError – For a ReaxFF-nn library (network weights cannot be expressed in the format; use
FFieldLibrary.save()).