Skip to content

Commit 0bb4fd4

Browse files
maxcapodi78maxcapodi78
maxcapodi78
authored and
maxcapodi78
committed
fixed methods
1 parent 40d657d commit 0bb4fd4

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

pyaedt/application/Design.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,10 @@ def boundaries(self):
360360

361361
current_boundaries = bb[::2]
362362
current_types = bb[1::2]
363-
363+
check_boundaries = current_boundaries[:] + self.ports[:] + self.excitations[:]
364+
for k in list(self._boundaries.keys())[:]:
365+
if k not in check_boundaries:
366+
del self._boundaries[k]
364367
for boundary, boundarytype in zip(current_boundaries, current_types):
365368
if boundary in self._boundaries:
366369
continue

pyaedt/generic/configurations.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ def _update_boundaries(self, name, props):
906906
bound.props["Modes"] = BoundaryProps(bound, modes)
907907
bound.auto_update = True
908908
if bound.create():
909-
self._app.boundaries.append(bound)
909+
self._app._boundaries[bound.name] = bound
910910
if props["BoundType"] in ["Coil Terminal", "Coil", "CoilTerminal"]:
911911
winding_name = ""
912912
for b in self._app.boundaries:

pyaedt/hfss3dlayout.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,8 @@ def create_wave_port_from_two_conductors(self, primivitivenames=[""], edgenumber
356356
if len(a) > 0:
357357
bound = self._update_port_info(a[0])
358358
if bound:
359-
self.boundaries.append(bound)
360-
return self.boundaries[-1]
359+
self._boundaries[bound.name] = bound
360+
return bound
361361
else:
362362
return False
363363
else:
@@ -451,8 +451,8 @@ def create_differential_port(self, via_signal, via_reference, port_name, deembed
451451
)
452452
bound = self._update_port_info(port_name)
453453
if bound:
454-
self.boundaries.append(bound)
455-
return self.boundaries[-1]
454+
self._boundaries[bound.name] = bound
455+
return bound
456456
else:
457457
return False
458458
else:

pyaedt/modules/Boundary.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,7 @@ def delete(self):
9595
self._app.o_maxwell_parameters.DeleteParameters([self.name])
9696
else:
9797
self._app.oboundary.DeleteBoundaries([self.name])
98-
for el in self._app.boundaries[:]:
99-
if el.name == self.name:
100-
del self._app._boundaries[el.name]
98+
self._app.boundaries
10199
return True
102100

103101
def _get_boundary_data(self, ds):
@@ -4319,7 +4317,7 @@ def update(self):
43194317
self.delete()
43204318
try:
43214319
self.create()
4322-
self._app.boundaries.append(self)
4320+
self._app._boundaries[self.name] = self
43234321
return True
43244322
except Exception: # pragma : no cover
43254323
self._app.odesign.Undo()

pyaedt/twinbuilder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ def add_q3d_dynamic_component(
447447
if not is_number(value) and not unit:
448448
raise TypeError("Model depth must be provided as a string with value and unit.")
449449
design_type = "Q2D"
450-
signal_list = [e.name for e in app.excitation_objects if e.type == "SignalLine"]
450+
signal_list = [k for k, v in app.excitation_objects.items() if v.type == "SignalLine"]
451451
for signal in signal_list:
452452
port_info_list_A.append("OnePortInfo:=")
453453
port_info_list_B.append("OnePortInfo:=")

0 commit comments

Comments
 (0)