Skip to content

Fort99 Analyzer Analysis

fort.99 (training-set and EOS) analysis utilities.

This module provides helpers for analyzing ReaxFF training-set output stored in fort.99 files, including error inspection, two-body ENERGY term parsing, and equation-of-state (EOS) analysis for bulk modulus extraction.

Typical use cases include:

  • inspecting QMโ€“FF energy differences for training targets
  • parsing pairwise ENERGY terms from fort.99 titles
  • constructing energyโ€“volume datasets using fort.74
  • computing bulk modulus via a Vinet equation-of-state fit

fort99_energy_vs_volume(fort99_handler, fort74_handler)

Construct an energyโ€“volume table from fort.99 and fort.74 data.

Pairwise ENERGY terms from fort.99 are matched with corresponding volumes extracted from fort.74 based on shared identifiers.

Works on

Fort99Handler + Fort74Handler โ€” fort.99 + fort.74

Parameters:

Name Type Description Default
fort99_handler TemplateHandler

Parsed fort.99 handler.

required
fort74_handler TemplateHandler

Parsed fort.74 handler providing volumes.

required

Returns:

Type Description
DataFrame

Table with columns: iden1, iden2, ffield_value, qm_value, V_iden2.

Examples:

>>> df = fort99_energy_vs_volume(f99, f74)

get_fort99_bulk_modulus(fort99_handler, fort74_handler, *, iden, source='ffield', shift_min_to_zero=True, flip_sign=False, dropna=True)

Compute the bulk modulus using a Vinet EOS fit to E(V) data.

Energyโ€“volume points are obtained from pairwise ENERGY terms in fort.99 and corresponding volumes from fort.74.

Works on

Fort99Handler + Fort74Handler โ€” fort.99 + fort.74

Parameters:

Name Type Description Default
fort99_handler TemplateHandler

Parsed fort.99 handler.

required
fort74_handler TemplateHandler

Parsed fort.74 handler.

required
iden str

Identifier (iden1) for which the EOS fit is performed.

required
source ('ffield', 'qm')

Energy source used for fitting.

"ffield"
shift_min_to_zero bool

Shift minimum energy to zero to improve numerical conditioning.

True
flip_sign bool

Flip the sign of energies before fitting.

False
dropna bool

Drop rows with NaN energy or volume values.

True

Returns:

Type Description
dict

Dictionary containing: iden, source, n_points, V0_A3, K0_eV_A3, K0_GPa, E0_eV, C, success.

Examples:

>>> res = get_fort99_bulk_modulus(
...     f99, f74, iden="bulk_0", source="ffield"
... )
>>> res["K0_GPa"]

get_fort99_data(handler, *, sortby='lineno', ascending=True)

Retrieve fort.99 data and compute QMโ€“FF energy differences.

A new column qm_ff_difference is added as: qm_value - ffield_value.

Works on

Fort99Handler โ€” fort.99

Parameters:

Name Type Description Default
handler TemplateHandler

Parsed fort.99 handler.

required
sortby str

Column name to sort by (e.g. error, lineno).

"lineno"
ascending bool

Sort order.

True

Returns:

Type Description
DataFrame

fort.99 table including the additional qm_ff_difference column.

Examples:

>>> df = get_fort99_data(h, sortby="error", ascending=False)

parse_fort99_two_body_energy_terms(handler)

Parse pairwise ENERGY terms from the ENERGY section of fort.99.

Only ENERGY titles containing exactly two / separators are kept, corresponding to two-body interaction terms.

Works on

Fort99Handler โ€” fort.99

Parameters:

Name Type Description Default
handler TemplateHandler

Parsed fort.99 handler.

required

Returns:

Type Description
DataFrame

ENERGY rows augmented with parsed columns: opt1, iden1, n1, opt2, iden2, n2.

Examples:

>>> df = parse_fort99_two_body_energy_terms(h)