Skip to content

Fort76 Handler Engine Utility

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

Usage context

  • ReaxFF parsing: Read ReaxFF text outputs into normalized tabular structures.
  • Workflow ingestion: Provide canonical handler interfaces used by adapters/workflows.
  • Diagnostics/export: Preserve parsed metadata for reporting and downstream conversion.

Class: 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).

Method: n_frames

N frames.

Returns:

Type Description
int

Return value description.

Method: n_restraints

N restraints.

Returns:

Type Description
int

Return value description.

Method: frame

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

Method: iter_frames

Iter frames.

Parameters:

Name Type Description Default
step int

Parameter description.

1

Yields:

Type Description
Iterator[Dict[str, Any]]

Return value description.