VTKHDFResultReader
VTKHDFResultReader
Bases: ResultReader
Read one OpenSees VTKHDF partition using lazy HDF5 history access.
Prefer open_results() for ordinary use and for multiple MPI partitions. Direct access is useful for extracting a field at one recorded sample.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Union[str, Path]
|
Existing VTKHDF file containing VTKHDF/Points and Steps/Values. |
required |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
The file does not exist. |
ResultFormatError
|
Required VTKHDF layout entries are missing. |
OSError
|
HDF5 cannot open the file. Wait for the solver to close it; do not bypass file locks to read an active recorder. |
Example
Note
Names are the stored field names: displacement, velocity, acceleration, force3D, and localForce3D are typical OpenSees outputs. No alias rewriting, unit conversion, acceleration conversion, or force interpretation occurs. Only fields present in both data and per-step offsets are advertised. Unsupported element responses may be stored as zeros by the solver.
Attributes
capabilities
property
Available mesh, history, and frame operations based on stored fields.
number_of_steps
property
Number of stored samples, not necessarily the solver step count.
number_of_points
property
Point count for the first mesh, excluding repeated transient counts.
number_of_cells
property
Cell count for the first mesh, excluding repeated transient counts.
available_point_responses
property
Names with both point data and per-step offsets in this file.
available_cell_responses
property
Names with both cell data and per-step offsets in this file.
mesh
property
Cached PyVista mesh; copy it before modifying coordinates or arrays.
Methods:
point_history
Read one local point over all samples.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response
|
str
|
Stored point field name. |
required |
point_index
|
int
|
Zero-based mesh-point index, not a node tag. |
required |
component
|
Component
|
None for all components, an integer, or x/y/z. |
None
|
Returns:
| Type | Description |
|---|---|
ndarray
|
NumPy array of samples, with a component dimension unless selected |
ndarray
|
explicitly or the stored field is scalar. |
Raises:
| Type | Description |
|---|---|
KeyError
|
Field data or its per-step offsets are absent. |
IndexError
|
Point or component index is outside the stored array. |
cell_history
Read one local cell's recorded history.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response
|
str
|
Stored cell field name, such as force3D. |
required |
cell_index
|
int
|
Zero-based mesh-cell index, not an element tag. |
required |
component
|
Component
|
None for all components, or an integer component index. |
None
|
Returns:
| Type | Description |
|---|---|
ndarray
|
NumPy array of samples and, when applicable, components. |
Raises:
| Type | Description |
|---|---|
KeyError
|
Field data or offsets are absent. |
IndexError
|
Cell or component index is out of range. |
point_frame
Read all points at one recorded sample, without deforming the mesh.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response
|
str
|
Stored point field name. |
required |
step
|
int
|
Zero-based sample index; -1 selects the last sample. |
required |
component
|
Component
|
None for every component, an integer, or x/y/z. |
None
|
Returns:
| Type | Description |
|---|---|
ndarray
|
Array shaped (points, components), or (points,) for a scalar/selected |
ndarray
|
component. Translational/rotational components are not separated. |
Raises:
| Type | Description |
|---|---|
KeyError
|
Requested field is unavailable. |
IndexError
|
Sample index is out of range. |
cell_frame
Read all cells at one recorded sample.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response
|
str
|
Stored cell field name, such as force3D. |
required |
step
|
int
|
Zero-based sample index; negative indices count from the end. |
required |
component
|
Component
|
None for all components, or an integer component index. |
None
|
Returns:
| Type | Description |
|---|---|
ndarray
|
Array shaped (cells, components), or (cells,) for scalar/selected data. |
Raises:
| Type | Description |
|---|---|
KeyError
|
Requested field is unavailable. |
IndexError
|
Sample index is out of range. |