HFSS log parser – pyedb.workflows.utilities.hfss_log_parser#
Top-level façade#
- class pyedb.workflows.utilities.hfss_log_parser.HFSSLogParser(log_path: str | Path)#
Bases:
objectHigh-level façade that orchestrates all block parsers.
Typical usage:
>>> log = HFSSLogParser("/tmp/project.aedt.batchinfo.1234/hfss.log") >>> data = log.parse() >>> data.is_converged() True
- parse() ParsedLog#
Execute all sub-parsers and return a unified object.
- Returns:
Structured representation of the entire log.
- Return type:
- Raises:
FileNotFoundError – If log_path does not exist.
ValueError – If a mandatory block cannot be parsed.
Aggregated result object#
- class pyedb.workflows.utilities.hfss_log_parser.ParsedLog(project: ProjectInfo, init_mesh: InitMesh, adaptive: List[AdaptivePass], sweep: Sweep | None)#
Bases:
objectRoot container returned by
HFSSLogParser.parse().- Variables:
project (ProjectInfo) – Project meta-data.
init_mesh (InitMesh) – Initial-mesh metrics.
adaptive (list[AdaptivePass]) – Adaptive passes in chronological order.
sweep (Sweep | None) – Frequency-sweep summary (
Noneif absent).
- adaptive_passes() List[AdaptivePass]#
Alias to keep API explicit.
- errors() List[str]#
Extract only error lines (warnings are ignored).
ANSYS marks errors with
[error]or*** ERROR ***.
- is_completed() bool#
Heuristic indicating a successful end-to-end solve.
A simulation is considered complete when both of the following conditions are satisfied:
At least one adaptive pass converged.
A frequency-sweep block exists with elapsed time greater than zero.
- Return type:
Data containers#
- class pyedb.workflows.utilities.hfss_log_parser.ProjectInfo(name: str, file: Path, design: str = '', user: str = '', cmd_line: str = '')#
Bases:
objectBasic meta-data extracted from the header of an HFSS batch log.
- class pyedb.workflows.utilities.hfss_log_parser.InitMesh(tetrahedra: int, memory_mb: float, real_time_sec: int, cpu_time_sec: int)#
Bases:
objectStatistics reported during the initial tetrahedral meshing phase.
- class pyedb.workflows.utilities.hfss_log_parser.AdaptivePass(pass_nr: int, freq_hz: float, tetrahedra: int, matrix_size: int, memory_mb: float, delta_s: float | None, converged: bool, elapsed_sec: int)#
Bases:
objectSingle adaptive solution pass (frequency, delta-S, memory, …).
- Variables:
pass_nr (int) – 1-based pass index.
freq_hz (float) – Target frequency in hertz.
tetrahedra (int) – Number of tetrahedra at end of pass.
matrix_size (int) – Order of the FEM matrix.
memory_mb (float) – Memory used in megabytes.
delta_s (float) – Maximum |ΔS| observed (
Noneuntil reported).converged (bool) –
Trueif this pass triggered convergence.elapsed_sec (int) – Wall time spent in this pass.
Block parsers (advanced usage)#
- class pyedb.workflows.utilities.hfss_log_parser.ProjectBlockParser(lines: List[str])#
Bases:
BlockParserExtract project meta-data from the log header.
Example:
>>> block = ProjectBlockParser(lines) >>> info = block.parse() >>> info.name 'Patch_Antenna'
- parse() ProjectInfo#
Parse the stored lines and return a
ProjectInfoinstance.- Returns:
Populated data object.
- Return type:
- Raises:
ValueError – If mandatory fields (project name or file path) cannot be located.
- class pyedb.workflows.utilities.hfss_log_parser.InitMeshBlockParser(lines: List[str])#
Bases:
BlockParser
- class pyedb.workflows.utilities.hfss_log_parser.AdaptiveBlockParser(lines: List[str])#
Bases:
BlockParserBuild a list of
AdaptivePassobjects from the adaptive section.- parse() List[AdaptivePass]#
Parse every adaptive pass and determine which one triggered convergence.
- Returns:
Ordered list of passes (pass_nr always increases).
- Return type:
- class pyedb.workflows.utilities.hfss_log_parser.SweepBlockParser(lines: List[str])#
Bases:
BlockParserExtract frequency-sweep summary (if present).
Base class#
Utility helpers#
The functions below are private by convention (leading underscore) but are exposed in the documentation for contributors and advanced users.
- pyedb.workflows.utilities.hfss_log_parser._to_hz(text: str) float#
Convert a human-readable frequency string to hertz.