Feat/farfield from aedtresults binary#7835
Open
apham-simutech wants to merge 4 commits into
Open
Conversation
…tresults Add ansys/aedt/core/visualization/advanced/farfield_binary.py, which obtains an antenna far field directly from the binary surface fields HFSS stores in .aedtresults, without making the solver re-export an .ffd. HFSS writes the tangential E/H on the radiation boundary as a small triangle mesh (current.sf_msh) plus one complex field file per driven source (fields.sf_fld_<k>). The new RadiationSurface class decodes those files and a near-field-to-far-field (Stratton-Chu / Love) transform reconstructs the pattern; far_field_data_from_aedtresults writes a standard .ffd plus a pyaedt_antenna_metadata.json and returns an FfdSolutionData, so the existing reader and plotting code consume the result unchanged. Validated offline against AEDT's own far field (0.999 pattern correlation for a single patch). Multi-source helpers (combined_field, element_positions, steering_weights) cover explicit and FA-DDM arrays; the FA-DDM "_D0" unit-cell suffix is auto-detected. Component-array DDM (CA-DDM) designs persist no surface fields, so callers must fall back to the regular export there (documented in the module). Unit tests run without a live AEDT session using a small synthetic surface fixture. A follow-up can wire this into Hfss.get_antenna_data(use_existing_binary) and emit one .ffd per element so FfdSolutionData's interactive array scanning applies. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…rray output Build on the binary radiation-surface reader with the two integration pieces. Hfss.get_antenna_data(use_existing_binary=True): locate the radiation-surface folder for the requested frequency (find_radiation_surface_folder) and return an FfdSolutionData reconstructed from the stored surface fields, skipping the solver export. When no surface fields exist (for example a CA-DDM design) it falls back to the regular export. Verified end to end on a solved single-patch project: the reconstructed peak matches AEDT's far-field report. Per-element array output (far_field_data_from_aedtresults(per_element=True)): write one de-embedded element-pattern .ffd per source, referenced to its regular lattice site, plus array metadata (array_dimension, lattice_vector, cell names), so FfdSolutionData superposes and steers the array itself. Validated against a direct reconstruction for a 1x5 explicit array and a 4x4 FA-DDM array at scan angles up to 45 deg (correlation 1.0 with a fresh reader per scan). The NF2FF inner loop is factored into a shared _spherical_basis, and element_far_fields reuses the per-direction phase across sources. Four unit tests added (grid fit, per-element emission, folder discovery); all run without a live AEDT session. Note: combine_farfield mutates each element's stored phase on every call, so a fresh FfdSolutionData (or a phase reset) is needed between scan angles. A system-level test needs a CI example project that stores surface fields. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…the API Bring the new module in line with the PyAnsys developer guide and PyAEDT contribution standards: - Docstrings pass the repository numpydoc validation (tool.numpydoc_validation): method summaries start with an infinitive verb (SS05), return descriptions are capitalised and terminated (RT04/RT05), and the section order is correct. Added Parameters/Returns to element_positions and steering_weights. - Documented the public API (RadiationSurface, far_field_data_from_aedtresults, find_radiation_surface_folder, parse_surface_mesh_header) under the Farfield section of doc/source/API/visualization/advanced.rst, with usage examples matching the surrounding style. ruff (check + format), codespell, blacken-docs and numpydoc validation all pass on the changed files; the unit tests remain green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
All Contributor License Agreement (CLA) signatures have been captured successfully. Thanks for contributing! |
Member
|
Hi @apham-simutech , thank you for your cotribution! This is high level! Please could you sign the CLA? Then I will review the code and cherry pick it. Thank you! |
Contributor
Author
|
@cla-bot rerun |
Contributor
Author
|
@Samuelopez-ansys I filled out the CLA. I'm not sure why it is still failing. |
Member
|
@SMoraisAnsys @MaxJPRey, Do you know why the CLA is failing? @apham-simutech filled out it. |
Collaborator
|
I'm working on a fix |
Collaborator
|
@cla-bot rerun |
1 similar comment
Collaborator
|
@cla-bot rerun |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FEAT: Get far field from binary ffd in aedtresults (#7574)
Description
Reconstruct an antenna far field directly from the binary radiation-surface data
that HFSS already stores in
.aedtresults, instead of making the solverre-export an
.ffdfile.HFSS writes the tangential E/H on the radiation boundary as a small triangle
mesh (
current.sf_msh) plus one complex field file per driven source(
fields.sf_fld_<k>). This PR addsansys/aedt/core/visualization/advanced/farfield_binary.py, which decodes thosefiles and applies a near-field-to-far-field (Stratton–Chu / Love) transform,
returning a standard
FfdSolutionData(via a generated.ffd+pyaedt_antenna_metadata.json) that the existing reader and plotting code consumeunchanged.
Highlights:
Hfss.get_antenna_data(use_existing_binary=True)— locates theradiation-surface folder for the requested frequency and reconstructs the far
field with no solver round-trip; falls back to the regular export when a
design stores no surface fields (for example a CA-DDM / 3D-component design).
far_field_data_from_aedtresults(per_element=True))— writes one de-embedded element-pattern
.ffdper source on the fittedlattice, so
FfdSolutionDatasuperposes and steers the array itself.Component-array DDM is detected and routed to the normal export path.
Validation (offline, against AEDT's own far field): single patch 0.999 pattern
correlation; a 1×5 explicit array and a 4×4 FA-DDM array reconstructed to corr
1.0 at scan angles up to 45°; and end-to-end via
get_antenna_data(use_existing_binary=True)on a solved single-patch project(reconstructed peak matches the far-field report). The reader is pure file parsing
(no AEDT backend calls), so it needs no minimum-version gating.
Application: hfss
AEDT-Version: 26.1
Platform: windows
Issue linked
Closes #7574 — "Get farfield from binary ffd": consume the binary far-field data
already present in
.aedtresultsinstead of exporting a new.ffdon eachget_antenna_datacall.Checklist