Skip to content

Fort76 Analyzer Analysis

fort.76 (restraint monitor) analysis utilities.

This module provides helpers for extracting and organizing restraint-related quantities written by ReaxFF into fort.76 files via Fort76Handler.

Typical use cases include:

  • extracting target and actual values for specific restraints
  • selecting subsets of restraint columns with alias support
  • preparing clean tables for plotting or downstream analysis

get_fort76_data(handler, columns, dropna_rows=False, copy=True)

Extract user-requested columns from a fort.76 file.

Works on

Fort76Handler — fort.76

Parameters:

Name Type Description Default
handler Fort76Handler

Parsed fort.76 handler.

required
columns sequence of str

Column names to extract. Aliases are supported, including restraint specifications such as "restraint 1 target" or "r2_actual".

required
dropna_rows bool

If True, drop rows where all selected non-iter columns are NaN.

False
copy bool

If True, return a copy of the DataFrame.

True

Returns:

Type Description
DataFrame

Table containing only the requested columns, in the order specified.

Examples:

>>> from reaxkit.io.handlers.fort76_handler import Fort76Handler
>>> from reaxkit.analysis.per_file.fort76_analyzer import get_fort76_data
>>> h = Fort76Handler("fort.76")
>>> df = get_fort76_data(
...     h,
...     ["iter", "restraint 1 target value", "restraint 1 actual value"]
... )

get_fort76_restraint_pairs(handler, restraint_index, include_iter=True)

Extract target and actual values for a single restraint.

Works on

Fort76Handler — fort.76

Parameters:

Name Type Description Default
handler Fort76Handler

Parsed fort.76 handler.

required
restraint_index int

Index of the restraint (1-based, as in the ReaxFF input).

required
include_iter bool

If True, include the iter column.

True

Returns:

Type Description
DataFrame

Table with columns ["iter", "rN_target", "rN_actual"] if include_iter=True, otherwise ["rN_target", "rN_actual"].

Examples:

>>> from reaxkit.io.handlers.fort76_handler import Fort76Handler
>>> from reaxkit.analysis.per_file.fort76_analyzer import get_fort76_restraint_pairs
>>> h = Fort76Handler("fort.76")
>>> df = get_fort76_restraint_pairs(h, restraint_index=1)