Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Kathy Pippert <[email protected]>
  • Loading branch information
SMoraisAnsys and PipKat authored Feb 1, 2024
1 parent 1e0f3aa commit 3233439
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
36 changes: 18 additions & 18 deletions examples/00-EDB/03_5G_antenna_example_parametrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

non_graphical = False

# ## Creating data classes
# ## Create data classes
#
# Data classes are useful to do calculations and store variables.
# We create 3 Data classes for Patch, Line and Array
# There are three data classes: ``Patch``, ``Line``, and ``Array``.

# +
class Patch:
Expand Down Expand Up @@ -138,7 +138,7 @@ def points(self):

edb.modeler.create_polygon(linear_array.points, "GND", net_name="GND")

# Add connector pin that will be used to assign the port.
# Add the connector pin to use to assign the port.

edb.padstacks.create(padstackname="Connector_pin", holediam="100um", paddiam="0", antipaddiam="200um")
con_pin = edb.padstacks.place(
Expand Down Expand Up @@ -199,7 +199,7 @@ def points(self):
edb.close_edb()
print("EDB saved correctly to {}. You can import in AEDT.".format(aedb_path))

# ## 3D Component in HFSS
# ## 3D component in HFSS
#
# First create an instance of the ``pyaedt.Hfss`` class. If you set
# > ``non_graphical = False
Expand All @@ -216,20 +216,20 @@ def points(self):
close_on_exit=True,
solution_type="Terminal")

# Set units to mm.
# Set units to ``mm``.

h3d.modeler.model_units = "mm"

# ## Import the EDB as a 3D Component
# ## Import the EDB as a 3D component
#
# One or more layout components can be imported into HFSS. The combination of layout data and 3D CAD data helps streamline
# model creation and setup.

component = h3d.modeler.insert_layout_component(aedb_path, parameter_mapping=True)

# ## Expose the Component Paramers
# ## Expose the component parameters
#
# If a layout component is parametric, parameters can be exposed and changed in HFSS
# If a layout component is parametric, you can expose and change parameters in HFSS

# +
component.parameters
Expand All @@ -254,9 +254,9 @@ def points(self):
h3d.assign_radiation_boundary_to_objects("Region")
# -

# ### Analysis Setup
# ### Set up analysis
#
# The finite element mesh is adapted iteratively. The maximum number of adaptive passes is set using the ``MaximumPasses`` property. This model will converge such that the $S_{11}$ will be independent of the mesh. The default accuracy setting is:
# The finite element mesh is adapted iteratively. The maximum number of adaptive passes is set using the ``MaximumPasses`` property. This model converges such that the $S_{11}$ is independent of the mesh. The default accuracy setting is:
# $$ \max(|\Delta S|) < 0.02 $$

setup = h3d.create_setup()
Expand All @@ -282,9 +282,9 @@ def points(self):
solution = h3d.post.get_solution_data(trace[0])
solution.plot()

# ## Plot Far Fields in AEDT
# ## Plot far fields in AEDT
#
# Plot Radiation patterns in AEDT.
# Plot radiation patterns in AEDT.

# +
variations = {}
Expand All @@ -299,24 +299,24 @@ def points(self):
new_report.create("Realized2D")
# -

# ## Plot Far Fields in AEDT
# ## Plot far fields in AEDT
#
# Plot Radiation patterns in AEDT.
# Plot radiation patterns in AEDT

new_report.report_type = "3D Polar Plot"
new_report.secondary_sweep = "Phi"
new_report.create("Realized3D")

# ## Plot Far Fields outside AEDT
# ## Plot far fields outside AEDT
#
# Plot Radiation patterns outside AEDT.
# Plot radiation patterns outside AEDT

solutions_custom = new_report.get_solution_data()
solutions_custom.plot_3d()

# ## Plot E Field on nets and layers
#
# Plot E Field on nets and layers in AEDT.
# Plot E Field on nets and layers in AEDT

h3d.post.create_fieldplot_layers_nets(
[["TOP","Array_antenna"]],
Expand All @@ -334,7 +334,7 @@ def points(self):
h3d.save_project(os.path.join(temp_dir, "test_layout.aedt"))
h3d.release_desktop()

# ### Temp Directory Cleanup
# ### Clean up the temporary directory
#
# The following command removes the project and the temporary directory. If you'd like to save this project, save it to a folder of your choice prior to running the following cell.

Expand Down
14 changes: 7 additions & 7 deletions examples/00-EDB/04_edb_parametrized_design.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

# ## Set non-graphical mode
#
# Set non-graphical mode. The default is ``False`` in order to open
# the AEDT user interface.
# Set non-graphical mode. The default is ``False``, which opens
# the AEDT UI.

non_graphical = False

Expand Down Expand Up @@ -57,8 +57,8 @@
{"name": "diel_1", "layer_type": "dielectric", "thickness": "275um", "material": "FR4_epoxy"},
{"name": "top", "layer_type": "signal", "thickness": "35um", "material": "copper"}]

# Create EDB stackup.
# Bottom layer
# Create the EDB stackup.
# Define the bottom layer

prev = None
for layer in layers:
Expand Down Expand Up @@ -247,7 +247,7 @@
edb.save_edb()
edb.close_edb()

# Open the project in AEDT 3D Layout.
# Open the project in HFSS 3D Layout.

h3d = pyaedt.Hfss3dLayout(projectname=aedb_path, specified_version="2023.2",
non_graphical=non_graphical, new_desktop_session=True)
Expand Down Expand Up @@ -275,7 +275,7 @@
)
# -

# Define the differential pairs to be used to calculte differential and common mode
# Define the differential pairs to used to calculate differential and common mode
# s-parameters.

h3d.set_differential_pair(diff_name="In", positive_terminal="wave_port_1:T1", negative_terminal="wave_port_1:T2")
Expand All @@ -285,7 +285,7 @@

h3d.analyze()

# Plot the results and shut down the Electronics Desktop.
# Plot the results and shut down AEDT.

solutions = h3d.post.get_solution_data(["dB(S(In,In))", "dB(S(In,Out))"], context="Differential Pairs")
solutions.plot()
Expand Down

0 comments on commit 3233439

Please sign in to comment.