Skip to content

Commit

Permalink
fixed method arguments in Q3d (#4544)
Browse files Browse the repository at this point in the history
Co-authored-by: maxcapodi78 <Shark78>
  • Loading branch information
maxcapodi78 authored Apr 19, 2024
1 parent 6451c98 commit 151097e
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 200 deletions.
4 changes: 2 additions & 2 deletions _unittest/test_30_Q2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ def test_06a_create_setup(self):
def test_07_single_signal_line(self):
udp = self.aedtapp.modeler.Position(0, 0, 0)
o = self.aedtapp.modeler.create_rectangle(udp, [5, 3], name="Rectangle1")
assert self.aedtapp.assign_single_conductor(target_objects=o, solve_option="SolveOnBoundary")
assert self.aedtapp.assign_single_conductor(assignment=o, solve_option="SolveOnBoundary")

def test_08_assign_huray_finitecond_to_edges(self):
o = self.aedtapp.create_rectangle([6, 6], [5, 3], name="Rectangle1", material="Copper")
self.aedtapp.assign_single_conductor(target_objects=o, solve_option="SolveOnBoundary")
self.aedtapp.assign_single_conductor(assignment=o, solve_option="SolveOnBoundary")
assert self.aedtapp.assign_huray_finitecond_to_edges(o.edges, radius=0.5, ratio=2.9)

def test_09_auto_assign(self):
Expand Down
11 changes: 5 additions & 6 deletions _unittest_solvers/test_31_Q3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ def test_06c_autoidentify(self):
assert self.aedtapp.auto_identify_nets()

def test_07_create_source_sinks(self):
source = self.aedtapp.source("MyCylinder", axisdir=0, name="Source1")
sink = self.aedtapp.sink("MyCylinder", axisdir=3, name="Sink1")
source = self.aedtapp.source("MyCylinder", direction=0, name="Source1")
sink = self.aedtapp.sink("MyCylinder", direction=3, name="Sink1")
assert source.name == "Source1"
assert sink.name == "Sink1"
assert len(self.aedtapp.excitations) > 0
Expand Down Expand Up @@ -166,7 +166,7 @@ def test_07B_create_source_tosheet(self):
self.aedtapp.modeler.create_circle(self.aedtapp.PLANE.XY, [0, 0, 0], 4, name="Source1")
self.aedtapp.modeler.create_circle(self.aedtapp.PLANE.XY, [10, 10, 10], 4, name="Sink1")

source = self.aedtapp.source(["Source1", "Sink1"], net_name="GND", name="Cylinder1")
source = self.aedtapp.source(["Source1", "Sink1"], name="Cylinder1", net_name="GND")
source.props["Objects"] = ["Source1"]
sink = self.aedtapp.sink("Sink1", net_name="GND")
assert source
Expand Down Expand Up @@ -241,9 +241,8 @@ def test_13_matrix_reduction(self, add_app):
assert q3d.insert_reduced_matrix("JoinParallel", ["Box1", "Box1_1"], "JointTest2")
assert q3d.matrices[2].name == "JointTest2"
assert q3d.matrices[2].delete()
assert q3d.insert_reduced_matrix(
"JoinParallel", ["Box1", "Box1_1"], "JointTest2", "New_net", "New_source", "New_sink"
)
assert q3d.insert_reduced_matrix("JoinParallel", ["Box1", "Box1_1"], "JointTest2", "New_net", "New_source",
"New_sink")
assert "New_net" in q3d.matrices[2].sources()
assert q3d.matrices[2].add_operation(q3d.MATRIXOPERATIONS.JoinParallel, ["Box1_2", "New_net"])
assert len(q3d.matrices[2].operations) == 2
Expand Down
4 changes: 2 additions & 2 deletions examples/05-Q3D/Q2D_Armoured_Cable.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

obj = [q2d.modeler.get_object_from_name(i) for i in cond_names]
[q2d.assign_single_conductor(name='C1' + str(obj.index(i) + 1), target_objects=i, conductor_type='SignalLine') for i
[q2d.assign_single_conductor(assignment=i, name='C1' + str(obj.index(i) + 1), conductor_type='SignalLine') for i
in obj]
obj = [q2d.modeler.get_object_from_name(i) for i in arm_strand_names]
q2d.assign_single_conductor(name="gnd", target_objects=obj, conductor_type="ReferenceGround")
q2d.assign_single_conductor(assignment=obj, name="gnd", conductor_type="ReferenceGround")
mod2D.fit_all()

##########################################################
Expand Down
10 changes: 4 additions & 6 deletions examples/05-Q3D/Q2D_Example_CPWG.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,19 +161,17 @@
# Assign a conductor to the signal.

obj = q.modeler.get_object_from_name("signal")
q.assign_single_conductor(
name=obj.name, target_objects=[obj], conductor_type="SignalLine", solve_option="SolveOnBoundary", unit="mm"
)
q.assign_single_conductor(assignment=[obj], name=obj.name, conductor_type="SignalLine", solve_option="SolveOnBoundary",
units="mm")

###############################################################################
# Create reference ground
# ~~~~~~~~~~~~~~~~~~~~~~~
# Create a reference ground.

obj = [q.modeler.get_object_from_name(i) for i in ["co_gnd_left", "co_gnd_right", "ref_gnd"]]
q.assign_single_conductor(
name="gnd", target_objects=obj, conductor_type="ReferenceGround", solve_option="SolveOnBoundary", unit="mm"
)
q.assign_single_conductor(assignment=obj, name="gnd", conductor_type="ReferenceGround", solve_option="SolveOnBoundary",
units="mm")

###############################################################################
# Assign Huray model on signal
Expand Down
19 changes: 8 additions & 11 deletions examples/05-Q3D/Q2D_Example_Stripline.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,24 +151,21 @@
# Assign conductors to the signal.

obj = q.modeler.get_object_from_name("signal_p")
q.assign_single_conductor(
name=obj.name, target_objects=[obj], conductor_type="SignalLine", solve_option="SolveOnBoundary", unit="mm"
)
q.assign_single_conductor(assignment=[obj], name=obj.name, conductor_type="SignalLine", solve_option="SolveOnBoundary",
units="mm")

obj = q.modeler.get_object_from_name("signal_n")
q.assign_single_conductor(
name=obj.name, target_objects=[obj], conductor_type="SignalLine", solve_option="SolveOnBoundary", unit="mm"
)
q.assign_single_conductor(assignment=[obj], name=obj.name, conductor_type="SignalLine", solve_option="SolveOnBoundary",
units="mm")

###############################################################################
# Create reference ground
# ~~~~~~~~~~~~~~~~~~~~~~~
# Create a reference ground.

obj = [q.modeler.get_object_from_name(i) for i in ["co_gnd_left", "co_gnd_right", "ref_gnd_u", "ref_gnd_l"]]
q.assign_single_conductor(
name="gnd", target_objects=obj, conductor_type="ReferenceGround", solve_option="SolveOnBoundary", unit="mm"
)
q.assign_single_conductor(assignment=obj, name="gnd", conductor_type="ReferenceGround", solve_option="SolveOnBoundary",
units="mm")

###############################################################################
# Assign Huray model on signals
Expand All @@ -186,8 +183,8 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~
# Define the differential pair.

matrix = q.insert_reduced_matrix(operation_name=q.MATRIXOPERATIONS.DiffPair, source_names=["signal_p", "signal_n"],
rm_name="diff_pair")
matrix = q.insert_reduced_matrix(operation_name=q.MATRIXOPERATIONS.DiffPair, assignment=["signal_p", "signal_n"],
reduced_matrix="diff_pair")

###############################################################################
# Create setup, analyze, and plot
Expand Down
12 changes: 6 additions & 6 deletions examples/05-Q3D/Q3D_Example.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@

q.auto_identify_nets()

q.source("Bar1", axisdir=q.AxisDir.XPos, name="Source1")
q.sink("Bar1", axisdir=q.AxisDir.XNeg, name="Sink1")
q.source("Bar1", direction=q.AxisDir.XPos, name="Source1")
q.sink("Bar1", direction=q.AxisDir.XNeg, name="Sink1")

q.source("Bar2", axisdir=q.AxisDir.XPos, name="Source2")
q.sink("Bar2", axisdir=q.AxisDir.XNeg, name="Sink2")
q.source("Bar3", axisdir=q.AxisDir.XPos, name="Source3")
bar3_sink = q.sink("Bar3", axisdir=q.AxisDir.YPos)
q.source("Bar2", direction=q.AxisDir.XPos, name="Source2")
q.sink("Bar2", direction=q.AxisDir.XNeg, name="Sink2")
q.source("Bar3", direction=q.AxisDir.XPos, name="Source3")
bar3_sink = q.sink("Bar3", direction=q.AxisDir.YPos)
bar3_sink.name = "Sink3"

###############################################################################
Expand Down
Loading

0 comments on commit 151097e

Please sign in to comment.