-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAINT: integrate pyaedt PR 4002 changes
- Loading branch information
1 parent
08079f5
commit 38910f5
Showing
4 changed files
with
329 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions
71
examples/legacy/pyaedt_integration/14_edb_create_parametrized_design.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
""" | ||
EDB: parameterized design | ||
------------------------ | ||
This example shows how to | ||
1, Create an HFSS simulation project using SimulationConfiguration class. | ||
2, Create automatically parametrized design. | ||
""" | ||
###################################################################### | ||
# | ||
# Final expected project | ||
# ~~~~~~~~~~~~~~~~~~~~~~ | ||
# | ||
# .. image:: ../../_static/parametrized_design.png | ||
# :width: 600 | ||
# :alt: Fully automated parametrization. | ||
###################################################################### | ||
|
||
###################################################################### | ||
# Create HFSS simulatio project | ||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
# Load an existing EDB folder. | ||
###################################################################### | ||
|
||
from pyaedt import Hfss3dLayout | ||
|
||
import pyedb | ||
from pyedb.generic.general_methods import generate_unique_folder_name | ||
from pyedb.legacy.downloads import download_file | ||
|
||
project_path = generate_unique_folder_name() | ||
target_aedb = download_file("edb/ANSYS-HSD_V1.aedb", destination=project_path) | ||
print("Project folder will be", target_aedb) | ||
|
||
aedt_version = "2023.2" | ||
edb = pyedb.Edb(edbpath=target_aedb, edbversion=aedt_version) | ||
print("EDB is located at {}".format(target_aedb)) | ||
|
||
######################################################################## | ||
# Create SimulationConfiguration object and define simulation parameters | ||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
simulation_configuration = edb.new_simulation_configuration() | ||
simulation_configuration.signal_nets = ["PCIe_Gen4_RX0_P", "PCIe_Gen4_RX0_N", "PCIe_Gen4_RX1_P", "PCIe_Gen4_RX1_N"] | ||
simulation_configuration.power_nets = ["GND"] | ||
simulation_configuration.components = ["X1", "U1"] | ||
simulation_configuration.do_cutout_subdesign = True | ||
simulation_configuration.start_freq = "OGHz" | ||
simulation_configuration.stop_freq = "20GHz" | ||
simulation_configuration.step_freq = "10MHz" | ||
|
||
########################## | ||
# Build simulation project | ||
# ~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
edb.build_simulation_project(simulation_configuration) | ||
|
||
############################# | ||
# Generated design parameters | ||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
# | ||
|
||
edb.auto_parametrize_design(layers=True, materials=True, via_holes=True, pads=True, antipads=True, traces=True) | ||
edb.save_edb() | ||
edb.close_edb() | ||
|
||
###################### | ||
# Open project in AEDT | ||
# ~~~~~~~~~~~~~~~~~~~~ | ||
|
||
hfss = Hfss3dLayout(projectname=target_aedb, specified_version=aedt_version) | ||
hfss.release_desktop(False, False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters