ansys/pyaedt

Improve efficiency of hfss.edit_sources()

Closed this issue · 1 comments

Description of the current limitations

This method sets individually and sequentially all phases and amplitudes to 0 and then starts applying the given sources. That means, for example, that for a model with 12 sources, the fields are recalculated 12X4 = 48 times during the source values change (phase and amplitude), instead of doing it in a single update.

Code sample expected

No response

Useful links and references

No response

Hi @mmendezSENER,

Which PyAEDT version are you using?

This method should update all excitations in one single call:

https://github.com/ansys/pyaedt/blob/main/src/ansys/aedt/core/hfss.py#L3488

For instance this call will update the 2 ports at the same sime:

aedtapp.edit_sources(
{"sheet1_Port" + ":1": "10W", "sheet2_Port:1": ("20W", "20deg")},
include_port_post_processing=True,
max_available_power="40W",
)

If you check the code, you can see, there is one single call to the AEDT API: self.osolution.EditSources(args)