xnn.ffnn.models.ffield.write_ffield#
- xnn.ffnn.models.ffield.write_ffield(lib, path=None, *, digits=None)[source]#
Write a classical library as a ReaxFF
ffieldtext file (LAMMPS format).The classical column layout read by LAMMPS
pair_style reaxff(and other ReaxFF codes): general parameters, then atom, bond, off-diagonal, angle, torsion and hydrogen-bond blocks, with atom types numbered in library order and0for torsion wildcards. Columns the model does not evaluate carry the library’s own values (unused,heat_increment). Use it for a refit field withwrite_ffield(model.export_library(), "ffield.refit").- Parameters:
lib (FFieldLibrary) – The library; must be classical (
not lib.is_nn).path (str or Path, optional) – Destination file; when omitted only the text is returned.
digits (int, optional) – Decimals of every value. Default: 15 significant digits, which keeps every value to float64 precision;
4gives the traditional fixed layout.
- Returns:
The file content.
- Return type:
- Raises:
ValueError – For a ReaxFF-nn library (network weights have no place in the format; use
FFieldLibrary.save()).