Control Analyzer Analysis
Control file analysis utilities.
This module provides helper functions for querying and retrieving
parameters from a parsed ReaxFF control file via ControlHandler.
Typical use cases include:
- discovering available parameter sections
- listing available control keys
- retrieving parameter values with safe defaults
get_control_data(handler, key, section=None, default=None)
Retrieve a control-file parameter value by key, optionally restricted to a section.
Works on
ControlHandler (control)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
handler
|
ControlHandler
|
Parsed control file handler. |
required |
key
|
str
|
Parameter name (case-insensitive). |
required |
section
|
str
|
Section to search (one of: "general", "md", "mm", "ff", "outdated"). If None, all sections are searched in order. |
None
|
default
|
any
|
Value to return if the key is not found. |
None
|
Returns:
| Type | Description |
|---|---|
any
|
The parameter value if found; otherwise |
Examples:
>>> from reaxkit.io.handlers.control_handler import ControlHandler
>>> from reaxkit.analysis.per_file.control_analyzer import get_control_data
>>> h = ControlHandler("control")
>>> tstep = get_control_data(h, "tstep", section="md", default=None)