Skip to content

Fort78 Analyzer Analysis

fort.78 (external field schedule) analysis utilities.

This module provides helpers for extracting and aligning electric-field schedule data written by ReaxFF into fort.78 files via Fort78Handler.

Typical use cases include:

  • extracting electric-field components versus iteration
  • matching field values to other outputs sampled at iout2 frequency
  • preparing aligned field profiles for plotting with xmolout or summaries

get_fort78_data(handler, variables)

Extract iteration versus one or more variables from a fort.78 file.

Works on

Fort78Handler — fort.78

Parameters:

Name Type Description Default
handler Fort78Handler

Parsed fort.78 handler.

required
variables str or sequence of str

Field variable name(s) to extract. Aliases are supported (e.g. E_field_z, field_z). Output columns are named exactly as requested.

required

Returns:

Type Description
DataFrame

Table with columns ["iter", <variables...>] where <variables> correspond to the requested names.

Examples:

>>> from reaxkit.io.handlers.fort78_handler import Fort78Handler
>>> from reaxkit.analysis.per_file.fort78_analyzer import get_fort78_data
>>> h = Fort78Handler("fort.78")
>>> df = get_fort78_data(h, variables=["E_field_z", "E_field_x"])

match_electric_field_to_iout2(f78, ctrl, target_iters, field_var='E_field_z')

Match electric-field values from fort.78 to target iterations.

The matching follows a piecewise-constant rule: for each target iteration, the last available fort.78 value with iter <= target_iter is used. By convention, iter = 0 maps to 0.0.

Works on

Fort78Handler + ControlHandler — fort.78 + control

Parameters:

Name Type Description Default
f78 Fort78Handler

Parsed fort.78 handler providing the field schedule.

required
ctrl ControlHandler

Parsed control handler (used to access iout2 for consistency).

required
target_iters sequence of int

Iteration numbers to which the electric field should be matched.

required
field_var str

Electric-field component to use (aliases supported).

"E_field_z"

Returns:

Type Description
Series

Series indexed by target_iters containing matched electric-field values (same units as fort.78, typically V/Å).

Examples:

>>> field = match_electric_field_to_iout2(
...     f78, ctrl, target_iters=[0, 80, 160], field_var="E_field_z"
... )