Fort13 Handler
ReaxFF force-field optimization error (fort.13) handler.
This module provides a handler for parsing ReaxFF fort.13 files,
which store the total force-field error values produced during
ReaxFF parameter optimization runs.
Typical use cases include:
- tracking optimization convergence
- comparing force-field parameter sets
- plotting total error versus optimization epoch
Fort13Handler
Bases: BaseHandler
Parser for ReaxFF force-field optimization output files (fort.13).
This class parses fort.13 files and exposes total force-field
error values as a simple, iteration-indexed time series.
Parsed Data
Summary table
One row per optimization epoch, returned by dataframe(),
with columns:
["epoch", "total_ff_error"]
Metadata
Returned by metadata(), containing:
["n_records", "min_error", "max_error", "mean_error"]
Notes
- Epoch indices are inferred from line order in the file.
- Non-numeric or empty lines are ignored.
- This handler represents a single-scalar-per-iteration data source.
iter_errors(step=1)
Iterate over total force-field error values with optional subsampling.
Works on
Fort13Handler — fort.13
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
step
|
int
|
Step size for subsampling epochs (default: 1). |
1
|
Yields:
| Type | Description |
|---|---|
dict
|
Dictionary with keys: |
Examples:
>>> h = Fort13Handler("fort.13")
>>> for row in h.iter_errors(step=10):
... print(row["epoch"], row["total_ff_error"])
n_records()
Return the number of optimization epochs recorded in the file.
Works on
Fort13Handler — fort.13
Returns:
| Type | Description |
|---|---|
int
|
Number of parsed optimization epochs. |