Skip to content

Fort76 Handler

ReaxFF restraint monitor (fort.76) handler.

This module provides a handler for parsing ReaxFF fort.76 files, which record per-iteration restraint energies and target/actual values for distance or coordinate restraints applied during simulations.

Typical use cases include:

  • monitoring restraint convergence
  • comparing target vs actual restraint values
  • debugging constrained MD or minimization runs

Fort76Handler

Bases: BaseHandler

Parser for ReaxFF restraint monitor files (fort.76).

This class parses fort.76 files and exposes per-iteration restraint information as a structured, iteration-indexed table.

Parsed Data

Summary table One row per iteration, returned by dataframe(), with columns:

- Base columns:
  ["iter", "E_res", "E_pot"]

- Restraint columns (repeated per restraint):
  ["r1_target", "r1_actual",
   "r2_target", "r2_actual", ...]

The number of restraints is inferred automatically from the file.

Metadata Returned by metadata(), containing: ["n_records", "n_frames", "n_restraints", "restraint_cols"]

Notes
  • Supports an arbitrary number of restraints per iteration.
  • Header, comment, and malformed lines are skipped robustly.
  • Duplicate iteration indices are resolved by keeping the last entry.
  • This handler represents one row per iteration (frame-like semantics).

frame(i)

Return a normalized per-row structure. restraints is a list of dicts: [{"index": 1, "target": ..., "actual": ...}, ...]