Results and visualization¶
Result anatomy¶
A run directory can contain:
Artifact |
Role |
|---|---|
|
Saved input or resolved configuration. |
|
Run, mesh, device, and provenance metadata when written. |
|
Artifact-oriented manifest; older runs may use metadata. |
CSV histories |
Scalar response, energy, telemetry, or timing rows. |
|
One file per run with the fields, the load history, the mesh, the materials and the resolved input; opens in ParaView. The YAML runner writes it by default for single-material two-dimensional phase-field runs; the multi-material route does not write it. See Result files. |
HDF5 trajectory |
Default reloadable field snapshots in |
Zarr trajectory |
Directory-based trajectory format, available by explicit selection. |
PNG/VTU/MP4 and visual manifest |
Human-facing visual outputs and their descriptions. |
The exact contents depend on the configuration and execution route. An output request is not a guarantee that an unsupported field or postprocessor will be created.
Reload numerical state¶
import phast
result = phast.load_result("runs/notched_plate")
print(result.field_names())
print(result.history_names())
if result.has_field("damage"):
final_damage = result.field("damage", step=-1)
For a run directory that contains result.vtkhdf, load_result reads that file in preference to the trajectory stores, and a path to a .vtkhdf file works as well. In that case step is the index of a stored step (0, 1, 2, …, with -1 the last), not the label of a step in training_data.h5; history/step_index maps each solver step to its stored step. Result files describes the additional methods (steps(), times(), mesh_arrays(), materials(), history_columns() and others) that need this file.
field() reads a stored raw field from the trajectory store or the result file and returns a NumPy array. It does not derive stress, strain, or other quantities that were not stored. history() reads CSV-backed history rows. metadata(), manifest(), and mesh() provide run context and provenance.
Visualization¶
Set supported output options such as plots, gif, or trajectory/VTU output in YAML, or invoke python -m phast postprocess <run_dir> for an existing run where the postprocessor has the required source data. visuals() lists files already present; it does not generate them.
Visualization is an inspection product, not reloadable state. A plot can show a field without preserving the mesh coordinates, field ordering, configuration, or all time steps needed to reproduce numerical analysis. Conversely, a trajectory can be reloadable without a rendered image.