Skip to content

Commit 0327d79

Browse files
FIX: bug in Transient Analysis which prevented to add Sweep Definition (#6831)
Co-authored-by: pyansys-ci-bot <[email protected]>
1 parent 8d8e574 commit 0327d79

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

doc/changelog.d/6831.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Bug in Transient Analysis which prevented to add Sweep Definition

src/ansys/aedt/core/modules/setup_templates.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq):
627627
"TransientData": ["0.1ns", "10ns"],
628628
"TransientNoiseData": [False, "", "", 0, 1, 0, False, 1],
629629
"TransientOtherData": ["default"],
630+
"SweepDefinition": SweepDefinition,
630631
}
631632
)
632633
"""Nexxim transient setup properties and default values."""

src/ansys/aedt/core/modules/solve_setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,6 +1438,10 @@ def add_sweep_step(
14381438

14391439
@pyaedt_function_handler()
14401440
def _add_sweep(self, sweep_variable, equation, override_existing_sweep):
1441+
if "SweepDefinition" not in self.props:
1442+
self.props["SweepDefinition"] = dict(
1443+
{"Variable": "Freq", "Data": "LINC 1GHz 5GHz 501", "OffsetF1": False, "Synchronize": 0}
1444+
)
14411445
if isinstance(self.props["SweepDefinition"], list):
14421446
for sw in self.props["SweepDefinition"]:
14431447
if sw["Variable"] == sweep_variable:

tests/system/general/test_21_Circuit.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,10 @@ def test_19b_create_eye_setups(self, aedtapp):
296296
setup_name = "Dom_Quick"
297297
assert aedtapp.create_setup(setup_name, "NexximQuickEye")
298298
setup_name = "Dom_AMI"
299-
assert aedtapp.create_setup(setup_name, "NexximAMI")
299+
setup = aedtapp.create_setup(setup_name, "NexximAMI")
300+
assert setup
301+
setup.add_sweep_step("Freq", 1, 2, 0.01, "GHz", override_existing_sweep=True)
302+
assert setup.props["SweepDefinition"]["Data"] == "LIN 1GHz 2GHz 0.01GHz"
300303

301304
@pytest.mark.skipif(
302305
is_linux and config["desktopVersion"] == "2024.1",

0 commit comments

Comments
 (0)