pyedb 0.38.0__py3-none-any.whl → 0.39.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pyedb might be problematic. Click here for more details.
- pyedb/__init__.py +1 -1
- pyedb/common/nets.py +53 -139
- pyedb/configuration/cfg_components.py +1 -1
- pyedb/configuration/cfg_general.py +4 -2
- pyedb/configuration/cfg_modeler.py +1 -1
- pyedb/configuration/cfg_package_definition.py +1 -1
- pyedb/configuration/cfg_padstacks.py +1 -1
- pyedb/configuration/cfg_ports_sources.py +56 -23
- pyedb/configuration/configuration.py +18 -1
- pyedb/dotnet/{application → database}/Variables.py +21 -21
- pyedb/dotnet/{edb_core → database}/cell/connectable.py +5 -5
- pyedb/dotnet/{edb_core → database}/cell/hierarchy/component.py +11 -11
- pyedb/dotnet/{edb_core → database}/cell/hierarchy/hierarchy_obj.py +1 -1
- pyedb/dotnet/{edb_core → database}/cell/hierarchy/model.py +1 -1
- pyedb/dotnet/{edb_core → database}/cell/layout.py +17 -17
- pyedb/dotnet/{edb_core → database}/cell/layout_obj.py +3 -3
- pyedb/dotnet/{edb_core → database}/cell/primitive/bondwire.py +1 -1
- pyedb/dotnet/{edb_core → database}/cell/primitive/path.py +4 -4
- pyedb/dotnet/{edb_core → database}/cell/primitive/primitive.py +14 -14
- pyedb/dotnet/{edb_core → database}/cell/terminal/bundle_terminal.py +2 -2
- pyedb/dotnet/{edb_core → database}/cell/terminal/edge_terminal.py +4 -4
- pyedb/dotnet/{edb_core → database}/cell/terminal/padstack_instance_terminal.py +2 -2
- pyedb/dotnet/{edb_core → database}/cell/terminal/pingroup_terminal.py +2 -2
- pyedb/dotnet/{edb_core → database}/cell/terminal/point_terminal.py +2 -2
- pyedb/dotnet/{edb_core → database}/cell/terminal/terminal.py +11 -11
- pyedb/dotnet/{edb_core → database}/cell/voltage_regulator.py +2 -2
- pyedb/dotnet/{edb_core → database}/components.py +101 -124
- pyedb/dotnet/{edb_core → database}/definition/component_def.py +5 -5
- pyedb/dotnet/{edb_core → database}/definition/component_model.py +1 -1
- pyedb/dotnet/{edb_core → database}/definition/definition_obj.py +1 -1
- pyedb/dotnet/{edb_core → database}/definition/definitions.py +2 -2
- pyedb/dotnet/{edb_core → database}/definition/package_def.py +4 -4
- pyedb/dotnet/{edb_core → database}/dotnet/database.py +8 -8
- pyedb/dotnet/{edb_core → database}/dotnet/primitive.py +9 -9
- pyedb/dotnet/{edb_core → database}/edb_data/control_file.py +12 -12
- pyedb/dotnet/{edb_core → database}/edb_data/hfss_extent_info.py +7 -7
- pyedb/dotnet/{edb_core → database}/edb_data/nets_data.py +10 -13
- pyedb/dotnet/{edb_core → database}/edb_data/padstacks_data.py +16 -16
- pyedb/dotnet/{edb_core → database}/edb_data/ports.py +4 -4
- pyedb/dotnet/{edb_core → database}/edb_data/primitives_data.py +5 -5
- pyedb/dotnet/{edb_core → database}/edb_data/raptor_x_simulation_setup_data.py +4 -4
- pyedb/dotnet/{edb_core → database}/edb_data/simulation_configuration.py +10 -10
- pyedb/dotnet/{edb_core → database}/edb_data/sources.py +4 -4
- pyedb/dotnet/{edb_core → database}/edb_data/variables.py +1 -1
- pyedb/dotnet/{edb_core → database}/geometry/polygon_data.py +4 -4
- pyedb/dotnet/{edb_core → database}/hfss.py +8 -8
- pyedb/dotnet/{edb_core → database}/layout_obj_instance.py +1 -1
- pyedb/dotnet/{edb_core → database}/layout_validation.py +2 -2
- pyedb/dotnet/{edb_core → database}/materials.py +23 -8
- pyedb/dotnet/{edb_core → database}/modeler.py +27 -27
- pyedb/dotnet/{edb_core → database}/net_class.py +8 -8
- pyedb/dotnet/{edb_core → database}/nets.py +12 -12
- pyedb/dotnet/{edb_core → database}/padstack.py +15 -15
- pyedb/dotnet/{edb_core → database}/sim_setup_data/data/mesh_operation.py +1 -1
- pyedb/dotnet/{edb_core → database}/sim_setup_data/data/settings.py +3 -3
- pyedb/dotnet/{edb_core → database}/sim_setup_data/data/sim_setup_info.py +2 -2
- pyedb/dotnet/{edb_core → database}/sim_setup_data/data/simulation_settings.py +1 -1
- pyedb/dotnet/{edb_core → database}/sim_setup_data/data/siw_dc_ir_settings.py +1 -1
- pyedb/dotnet/{edb_core → database}/sim_setup_data/data/sweep_data.py +1 -1
- pyedb/dotnet/{edb_core → database}/siwave.py +10 -10
- pyedb/dotnet/{edb_core → database}/stackup.py +12 -12
- pyedb/dotnet/{edb_core → database}/utilities/hfss_simulation_setup.py +15 -15
- pyedb/dotnet/{edb_core → database}/utilities/obj_base.py +1 -1
- pyedb/dotnet/{edb_core → database}/utilities/simulation_setup.py +3 -3
- pyedb/dotnet/{edb_core → database}/utilities/siwave_simulation_setup.py +6 -6
- pyedb/dotnet/edb.py +117 -112
- pyedb/generic/design_types.py +26 -19
- pyedb/generic/general_methods.py +1 -1
- pyedb/generic/plot.py +0 -2
- pyedb/grpc/database/__init__.py +1 -0
- pyedb/grpc/database/components.py +2354 -0
- pyedb/grpc/database/control_file.py +1277 -0
- pyedb/grpc/database/definition/component_def.py +218 -0
- pyedb/grpc/database/definition/component_model.py +39 -0
- pyedb/grpc/database/definition/component_pin.py +32 -0
- pyedb/grpc/database/definition/materials.py +1207 -0
- pyedb/grpc/database/definition/n_port_component_model.py +34 -0
- pyedb/grpc/database/definition/package_def.py +227 -0
- pyedb/grpc/database/definition/padstack_def.py +842 -0
- pyedb/grpc/database/definitions.py +70 -0
- pyedb/grpc/database/general.py +43 -0
- pyedb/grpc/database/geometry/__init__.py +0 -0
- pyedb/grpc/database/geometry/arc_data.py +93 -0
- pyedb/grpc/database/geometry/point_3d_data.py +79 -0
- pyedb/grpc/database/geometry/point_data.py +30 -0
- pyedb/grpc/database/geometry/polygon_data.py +133 -0
- pyedb/grpc/database/hfss.py +1279 -0
- pyedb/grpc/database/hierarchy/__init__.py +0 -0
- pyedb/grpc/database/hierarchy/component.py +1301 -0
- pyedb/grpc/database/hierarchy/model.py +31 -0
- pyedb/grpc/database/hierarchy/netlist_model.py +30 -0
- pyedb/grpc/database/hierarchy/pin_pair_model.py +128 -0
- pyedb/grpc/database/hierarchy/pingroup.py +245 -0
- pyedb/grpc/database/hierarchy/s_parameter_model.py +33 -0
- pyedb/grpc/database/hierarchy/spice_model.py +48 -0
- pyedb/grpc/database/layers/__init__.py +0 -0
- pyedb/grpc/database/layers/layer.py +57 -0
- pyedb/grpc/database/layers/stackup_layer.py +410 -0
- pyedb/grpc/database/layout/__init__.py +0 -0
- pyedb/grpc/database/layout/cell.py +30 -0
- pyedb/grpc/database/layout/layout.py +196 -0
- pyedb/grpc/database/layout/voltage_regulator.py +149 -0
- pyedb/grpc/database/layout_validation.py +319 -0
- pyedb/grpc/database/modeler.py +1468 -0
- pyedb/grpc/database/net/__init__.py +0 -0
- pyedb/grpc/database/net/differential_pair.py +138 -0
- pyedb/grpc/database/net/extended_net.py +340 -0
- pyedb/grpc/database/net/net.py +198 -0
- pyedb/grpc/database/net/net_class.py +93 -0
- pyedb/grpc/database/nets.py +633 -0
- pyedb/grpc/database/padstacks.py +1500 -0
- pyedb/grpc/database/ports/__init__.py +0 -0
- pyedb/grpc/database/ports/ports.py +396 -0
- pyedb/grpc/database/primitive/__init__.py +3 -0
- pyedb/grpc/database/primitive/bondwire.py +181 -0
- pyedb/grpc/database/primitive/circle.py +75 -0
- pyedb/grpc/database/primitive/padstack_instance.py +1116 -0
- pyedb/grpc/database/primitive/path.py +346 -0
- pyedb/grpc/database/primitive/polygon.py +276 -0
- pyedb/grpc/database/primitive/primitive.py +739 -0
- pyedb/grpc/database/primitive/rectangle.py +146 -0
- pyedb/grpc/database/simulation_setup/__init__.py +0 -0
- pyedb/grpc/database/simulation_setup/adaptive_frequency.py +33 -0
- pyedb/grpc/database/simulation_setup/hfss_advanced_meshing_settings.py +32 -0
- pyedb/grpc/database/simulation_setup/hfss_advanced_settings.py +59 -0
- pyedb/grpc/database/simulation_setup/hfss_dcr_settings.py +35 -0
- pyedb/grpc/database/simulation_setup/hfss_general_settings.py +61 -0
- pyedb/grpc/database/simulation_setup/hfss_settings_options.py +78 -0
- pyedb/grpc/database/simulation_setup/hfss_simulation_settings.py +118 -0
- pyedb/grpc/database/simulation_setup/hfss_simulation_setup.py +355 -0
- pyedb/grpc/database/simulation_setup/hfss_solver_settings.py +34 -0
- pyedb/grpc/database/simulation_setup/mesh_operation.py +34 -0
- pyedb/grpc/database/simulation_setup/raptor_x_advanced_settings.py +34 -0
- pyedb/grpc/database/simulation_setup/raptor_x_general_settings.py +33 -0
- pyedb/grpc/database/simulation_setup/raptor_x_simulation_settings.py +64 -0
- pyedb/grpc/database/simulation_setup/raptor_x_simulation_setup.py +125 -0
- pyedb/grpc/database/simulation_setup/siwave_dcir_simulation_setup.py +34 -0
- pyedb/grpc/database/simulation_setup/siwave_simulation_setup.py +119 -0
- pyedb/grpc/database/simulation_setup/sweep_data.py +32 -0
- pyedb/grpc/database/siwave.py +1023 -0
- pyedb/grpc/database/source_excitations.py +2572 -0
- pyedb/grpc/database/stackup.py +2574 -0
- pyedb/grpc/database/terminal/__init__.py +0 -0
- pyedb/grpc/database/terminal/bundle_terminal.py +218 -0
- pyedb/grpc/database/terminal/edge_terminal.py +51 -0
- pyedb/grpc/database/terminal/padstack_instance_terminal.py +171 -0
- pyedb/grpc/database/terminal/pingroup_terminal.py +162 -0
- pyedb/grpc/database/terminal/point_terminal.py +99 -0
- pyedb/grpc/database/terminal/terminal.py +470 -0
- pyedb/grpc/database/utility/__init__.py +3 -0
- pyedb/grpc/database/utility/constants.py +25 -0
- pyedb/grpc/database/utility/heat_sink.py +124 -0
- pyedb/grpc/database/utility/hfss_extent_info.py +448 -0
- pyedb/grpc/database/utility/layout_statistics.py +277 -0
- pyedb/grpc/database/utility/rlc.py +80 -0
- pyedb/grpc/database/utility/simulation_configuration.py +3305 -0
- pyedb/grpc/database/utility/sources.py +388 -0
- pyedb/grpc/database/utility/sweep_data_distribution.py +83 -0
- pyedb/grpc/database/utility/xml_control_file.py +1277 -0
- pyedb/grpc/edb.py +4151 -0
- pyedb/grpc/edb_init.py +481 -0
- pyedb/grpc/rpc_session.py +177 -0
- pyedb/ipc2581/ecad/cad_data/assembly_drawing.py +3 -2
- pyedb/ipc2581/ecad/cad_data/feature.py +4 -3
- pyedb/ipc2581/ecad/cad_data/layer_feature.py +32 -20
- pyedb/ipc2581/ecad/cad_data/outline.py +3 -2
- pyedb/ipc2581/ecad/cad_data/package.py +4 -3
- pyedb/ipc2581/ecad/cad_data/path.py +82 -31
- pyedb/ipc2581/ecad/cad_data/polygon.py +122 -60
- pyedb/ipc2581/ecad/cad_data/profile.py +13 -12
- pyedb/ipc2581/ecad/cad_data/step.py +53 -21
- pyedb/ipc2581/ipc2581.py +47 -49
- pyedb/modeler/geometry_operators.py +1 -1
- {pyedb-0.38.0.dist-info → pyedb-0.39.0.dist-info}/METADATA +5 -2
- pyedb-0.39.0.dist-info/RECORD +288 -0
- pyedb-0.38.0.dist-info/RECORD +0 -195
- /pyedb/dotnet/{edb_core → database}/__init__.py +0 -0
- /pyedb/dotnet/{application → database/cell}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core/cell → database/cell/hierarchy}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core → database}/cell/hierarchy/netlist_model.py +0 -0
- /pyedb/dotnet/{edb_core → database}/cell/hierarchy/pin_pair_model.py +0 -0
- /pyedb/dotnet/{edb_core → database}/cell/hierarchy/s_parameter_model.py +0 -0
- /pyedb/dotnet/{edb_core → database}/cell/hierarchy/spice_model.py +0 -0
- /pyedb/dotnet/{edb_core → database}/cell/primitive/__init__.py +0 -0
- /pyedb/dotnet/{edb_core/cell/hierarchy → database/cell/terminal}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core/cell/terminal → database/definition}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core/definition → database/dotnet}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core/dotnet → database/edb_data}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core → database}/edb_data/design_options.py +0 -0
- /pyedb/dotnet/{edb_core → database}/edb_data/edbvalue.py +0 -0
- /pyedb/dotnet/{edb_core → database}/edb_data/layer_data.py +0 -0
- /pyedb/dotnet/{edb_core → database}/edb_data/utilities.py +0 -0
- /pyedb/dotnet/{edb_core → database}/general.py +0 -0
- /pyedb/dotnet/{edb_core/edb_data → database/geometry}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core → database}/geometry/point_data.py +0 -0
- /pyedb/dotnet/{edb_core → database}/sim_setup_data/__init__.py +0 -0
- /pyedb/dotnet/{edb_core → database}/sim_setup_data/data/__init__.py +0 -0
- /pyedb/dotnet/{edb_core → database}/sim_setup_data/data/adaptive_frequency_data.py +0 -0
- /pyedb/dotnet/{edb_core/geometry → database/sim_setup_data/io}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core → database}/sim_setup_data/io/siwave.py +0 -0
- /pyedb/dotnet/{edb_core → database}/utilities/__init__.py +0 -0
- /pyedb/dotnet/{edb_core → database}/utilities/heatsink.py +0 -0
- /pyedb/{dotnet/edb_core/sim_setup_data/io → grpc/database/definition}/__init__.py +0 -0
- {pyedb-0.38.0.dist-info → pyedb-0.39.0.dist-info}/LICENSE +0 -0
- {pyedb-0.38.0.dist-info → pyedb-0.39.0.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
# Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
#
|
|
4
|
+
#
|
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
# furnished to do so, subject to the following conditions:
|
|
11
|
+
#
|
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
# copies or substantial portions of the Software.
|
|
14
|
+
#
|
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
# SOFTWARE.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
from ansys.edb.core.simulation_setup.adaptive_solutions import (
|
|
25
|
+
AdaptiveFrequency as GrpcAdaptiveFrequency,
|
|
26
|
+
)
|
|
27
|
+
from ansys.edb.core.simulation_setup.hfss_simulation_settings import (
|
|
28
|
+
AdaptType as GrpcAdaptType,
|
|
29
|
+
)
|
|
30
|
+
from ansys.edb.core.simulation_setup.hfss_simulation_setup import (
|
|
31
|
+
HfssSimulationSetup as GrpcHfssSimulationSetup,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
from pyedb.generic.general_methods import generate_unique_name
|
|
35
|
+
from pyedb.grpc.database.simulation_setup.sweep_data import SweepData
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class HfssSimulationSetup(GrpcHfssSimulationSetup):
|
|
39
|
+
"""HFSS simulation setup class."""
|
|
40
|
+
|
|
41
|
+
def __init__(self, pedb, edb_object, name: str = None):
|
|
42
|
+
super().__init__(edb_object.msg)
|
|
43
|
+
self._pedb = pedb
|
|
44
|
+
self._name = name
|
|
45
|
+
|
|
46
|
+
def set_solution_single_frequency(self, frequency="5GHz", max_num_passes=10, max_delta_s=0.02):
|
|
47
|
+
"""Set HFSS single frequency solution.
|
|
48
|
+
Parameters
|
|
49
|
+
----------
|
|
50
|
+
frequency : str, optional
|
|
51
|
+
Adaptive frequency.
|
|
52
|
+
max_num_passes : int, optional
|
|
53
|
+
Maxmímum passes number. Default value `10`.
|
|
54
|
+
max_delta_s : float, optional
|
|
55
|
+
Maximum delta S value. Default value `0.02`,
|
|
56
|
+
|
|
57
|
+
Returns
|
|
58
|
+
-------
|
|
59
|
+
bool.
|
|
60
|
+
|
|
61
|
+
"""
|
|
62
|
+
try:
|
|
63
|
+
self.settings.general.adaptive_solution_type = GrpcAdaptType.SINGLE
|
|
64
|
+
sfs = self.settings.general.single_frequency_adaptive_solution
|
|
65
|
+
sfs.adaptive_frequency = frequency
|
|
66
|
+
sfs.max_passes = max_num_passes
|
|
67
|
+
sfs.max_delta = str(max_delta_s)
|
|
68
|
+
self.settings.general.single_frequency_adaptive_solution = sfs
|
|
69
|
+
return True
|
|
70
|
+
except:
|
|
71
|
+
return False
|
|
72
|
+
|
|
73
|
+
def set_solution_multi_frequencies(self, frequencies="5GHz", max_delta_s=0.02):
|
|
74
|
+
"""Set HFSS setup multi frequencies adaptive.
|
|
75
|
+
|
|
76
|
+
Parameters
|
|
77
|
+
----------
|
|
78
|
+
frequencies : str, List[str].
|
|
79
|
+
Adaptive frequencies.
|
|
80
|
+
max_delta_s : float, List[float].
|
|
81
|
+
Max delta S values.
|
|
82
|
+
|
|
83
|
+
Returns
|
|
84
|
+
-------
|
|
85
|
+
bool.
|
|
86
|
+
|
|
87
|
+
"""
|
|
88
|
+
try:
|
|
89
|
+
self.settings.general.adaptive_solution_type = GrpcAdaptType.MULTI_FREQUENCIES
|
|
90
|
+
if not isinstance(frequencies, list):
|
|
91
|
+
frequencies = [frequencies]
|
|
92
|
+
if not isinstance(max_delta_s, list):
|
|
93
|
+
max_delta_s = [max_delta_s]
|
|
94
|
+
if len(max_delta_s) < len(frequencies):
|
|
95
|
+
for _ in frequencies[len(max_delta_s) :]:
|
|
96
|
+
max_delta_s.append(max_delta_s[-1])
|
|
97
|
+
adapt_frequencies = [
|
|
98
|
+
GrpcAdaptiveFrequency(frequencies[ind], str(max_delta_s[ind])) for ind in range(len(frequencies))
|
|
99
|
+
]
|
|
100
|
+
self.settings.general.multi_frequency_adaptive_solution.adaptive_frequencies = adapt_frequencies
|
|
101
|
+
return True
|
|
102
|
+
except:
|
|
103
|
+
return False
|
|
104
|
+
|
|
105
|
+
def set_solution_broadband(self, low_frequency="1GHz", high_frequency="10GHz", max_delta_s=0.02, max_num_passes=10):
|
|
106
|
+
"""Set solution to broadband.
|
|
107
|
+
|
|
108
|
+
Parameters
|
|
109
|
+
----------
|
|
110
|
+
low_frequency : str
|
|
111
|
+
Low frequency value.
|
|
112
|
+
high_frequency : str
|
|
113
|
+
High frequency value.
|
|
114
|
+
max_delta_s : float
|
|
115
|
+
Max delta S value.
|
|
116
|
+
max_num_passes : int
|
|
117
|
+
Maximum number of passes.
|
|
118
|
+
|
|
119
|
+
Returns
|
|
120
|
+
-------
|
|
121
|
+
bool.
|
|
122
|
+
|
|
123
|
+
"""
|
|
124
|
+
try:
|
|
125
|
+
self.settings.general.adaptive_solution_type = GrpcAdaptType.BROADBAND
|
|
126
|
+
bfs = self.settings.general.broadband_adaptive_solution
|
|
127
|
+
bfs.low_frequency = low_frequency
|
|
128
|
+
bfs.high_frequency = high_frequency
|
|
129
|
+
bfs.max_delta = str(max_delta_s)
|
|
130
|
+
bfs.max_num_passes = max_num_passes
|
|
131
|
+
self.settings.general.broadband_adaptive_solution = bfs
|
|
132
|
+
return True
|
|
133
|
+
except:
|
|
134
|
+
return False
|
|
135
|
+
|
|
136
|
+
def add_adaptive_frequency_data(self, frequency="5GHz", max_delta_s="0.01"):
|
|
137
|
+
"""Add adaptive frequency data to simulation setup.
|
|
138
|
+
|
|
139
|
+
Parameters
|
|
140
|
+
----------
|
|
141
|
+
frequency : str
|
|
142
|
+
Adaptive frequency value.
|
|
143
|
+
|
|
144
|
+
max_delta_s : str
|
|
145
|
+
Maximum delta S value.
|
|
146
|
+
|
|
147
|
+
Returns
|
|
148
|
+
-------
|
|
149
|
+
bool.
|
|
150
|
+
|
|
151
|
+
"""
|
|
152
|
+
try:
|
|
153
|
+
adapt_frequencies = self.settings.general.multi_frequency_adaptive_solution.adaptive_frequencies
|
|
154
|
+
adapt_frequencies.append(GrpcAdaptiveFrequency(frequency, str(max_delta_s)))
|
|
155
|
+
self.settings.general.multi_frequency_adaptive_solution.adaptive_frequencies = adapt_frequencies
|
|
156
|
+
return True
|
|
157
|
+
except:
|
|
158
|
+
return False
|
|
159
|
+
|
|
160
|
+
def add_length_mesh_operation(
|
|
161
|
+
self,
|
|
162
|
+
net_layer_list,
|
|
163
|
+
name=None,
|
|
164
|
+
max_elements=1000,
|
|
165
|
+
max_length="1mm",
|
|
166
|
+
restrict_elements=True,
|
|
167
|
+
restrict_length=True,
|
|
168
|
+
refine_inside=False,
|
|
169
|
+
mesh_region=None,
|
|
170
|
+
):
|
|
171
|
+
"""Add a mesh operation to the setup.
|
|
172
|
+
|
|
173
|
+
Parameters
|
|
174
|
+
----------
|
|
175
|
+
net_layer_list : dict
|
|
176
|
+
Dictionary containing nets and layers on which enable Mesh operation. Example ``{"A0_N": ["TOP", "PWR"]}``.
|
|
177
|
+
name : str, optional
|
|
178
|
+
Mesh operation name.
|
|
179
|
+
max_elements : int, optional
|
|
180
|
+
Maximum number of elements. Default is ``1000``.
|
|
181
|
+
max_length : str, optional
|
|
182
|
+
Maximum length of elements. Default is ``1mm``.
|
|
183
|
+
restrict_elements : bool, optional
|
|
184
|
+
Whether to restrict number of elements. Default is ``True``.
|
|
185
|
+
restrict_length : bool, optional
|
|
186
|
+
Whether to restrict length of elements. Default is ``True``.
|
|
187
|
+
mesh_region : str, optional
|
|
188
|
+
Mesh region name.
|
|
189
|
+
refine_inside : bool, optional
|
|
190
|
+
Whether to refine inside or not. Default is ``False``.
|
|
191
|
+
|
|
192
|
+
Returns
|
|
193
|
+
-------
|
|
194
|
+
:class:`LengthMeshOperation <ansys.edb.core.simulation_setup.mesh_operation.LengthMeshOperation>`
|
|
195
|
+
|
|
196
|
+
"""
|
|
197
|
+
from ansys.edb.core.simulation_setup.mesh_operation import (
|
|
198
|
+
LengthMeshOperation as GrpcLengthMeshOperation,
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
if not name:
|
|
202
|
+
name = generate_unique_name("skin")
|
|
203
|
+
net_layer_op = []
|
|
204
|
+
if net_layer_list:
|
|
205
|
+
for net, layers in net_layer_list.items():
|
|
206
|
+
if not isinstance(layers, list):
|
|
207
|
+
layers = [layers]
|
|
208
|
+
for layer in layers:
|
|
209
|
+
net_layer_op.append((net, layer, True))
|
|
210
|
+
|
|
211
|
+
mop = GrpcLengthMeshOperation(
|
|
212
|
+
name=name,
|
|
213
|
+
net_layer_info=net_layer_op,
|
|
214
|
+
refine_inside=refine_inside,
|
|
215
|
+
mesh_region=str(net_layer_op),
|
|
216
|
+
max_length=str(max_length),
|
|
217
|
+
restrict_max_length=restrict_length,
|
|
218
|
+
restrict_max_elements=restrict_elements,
|
|
219
|
+
max_elements=str(max_elements),
|
|
220
|
+
)
|
|
221
|
+
mesh_ops = self.mesh_operations
|
|
222
|
+
mesh_ops.append(mop)
|
|
223
|
+
self.mesh_operations = mesh_ops
|
|
224
|
+
return mop
|
|
225
|
+
|
|
226
|
+
def add_skin_depth_mesh_operation(
|
|
227
|
+
self,
|
|
228
|
+
net_layer_list,
|
|
229
|
+
name=None,
|
|
230
|
+
max_elements=1000,
|
|
231
|
+
skin_depth="1um",
|
|
232
|
+
restrict_elements=True,
|
|
233
|
+
surface_triangle_length="1mm",
|
|
234
|
+
number_of_layers=2,
|
|
235
|
+
refine_inside=False,
|
|
236
|
+
mesh_region=None,
|
|
237
|
+
):
|
|
238
|
+
"""Add a mesh operation to the setup.
|
|
239
|
+
|
|
240
|
+
Parameters
|
|
241
|
+
----------
|
|
242
|
+
net_layer_list : dict
|
|
243
|
+
Dictionary containing nets and layers on which enable Mesh operation. Example ``{"A0_N": ["TOP", "PWR"]}``.
|
|
244
|
+
name : str, optional
|
|
245
|
+
Mesh operation name.
|
|
246
|
+
max_elements : int, optional
|
|
247
|
+
Maximum number of elements. Default is ``1000``.
|
|
248
|
+
skin_depth : str, optional
|
|
249
|
+
Skin Depth. Default is ``1um``.
|
|
250
|
+
restrict_elements : bool, optional
|
|
251
|
+
Whether to restrict number of elements. Default is ``True``.
|
|
252
|
+
surface_triangle_length : bool, optional
|
|
253
|
+
Surface Triangle length. Default is ``1mm``.
|
|
254
|
+
number_of_layers : int, str, optional
|
|
255
|
+
Number of layers. Default is ``2``.
|
|
256
|
+
mesh_region : str, optional
|
|
257
|
+
Mesh region name.
|
|
258
|
+
refine_inside : bool, optional
|
|
259
|
+
Whether to refine inside or not. Default is ``False``.
|
|
260
|
+
|
|
261
|
+
Returns
|
|
262
|
+
-------
|
|
263
|
+
:class:`LengthMeshOperation <ansys.edb.core.simulation_setup.mesh_operation.LengthMeshOperation>`
|
|
264
|
+
|
|
265
|
+
"""
|
|
266
|
+
if not name:
|
|
267
|
+
name = generate_unique_name("length")
|
|
268
|
+
net_layer_op = []
|
|
269
|
+
if net_layer_list:
|
|
270
|
+
for net, layers in net_layer_list.items():
|
|
271
|
+
if not isinstance(layers, list):
|
|
272
|
+
layers = [layers]
|
|
273
|
+
for layer in layers:
|
|
274
|
+
net_layer_op.append((net, layer, True))
|
|
275
|
+
from ansys.edb.core.simulation_setup.mesh_operation import (
|
|
276
|
+
SkinDepthMeshOperation as GrpcSkinDepthMeshOperation,
|
|
277
|
+
)
|
|
278
|
+
|
|
279
|
+
mesh_operation = GrpcSkinDepthMeshOperation(
|
|
280
|
+
name=name,
|
|
281
|
+
net_layer_info=net_layer_op,
|
|
282
|
+
refine_inside=refine_inside,
|
|
283
|
+
mesh_region=mesh_region,
|
|
284
|
+
skin_depth=str(skin_depth),
|
|
285
|
+
surface_triangle_length=str(surface_triangle_length),
|
|
286
|
+
restrict_max_elements=restrict_elements,
|
|
287
|
+
max_elements=str(max_elements),
|
|
288
|
+
num_layers=str(number_of_layers),
|
|
289
|
+
)
|
|
290
|
+
mesh_ops = self.mesh_operations
|
|
291
|
+
mesh_ops.append(mesh_operation)
|
|
292
|
+
self.mesh_operations = mesh_ops
|
|
293
|
+
return mesh_operation
|
|
294
|
+
|
|
295
|
+
def add_sweep(
|
|
296
|
+
self, name=None, distribution="linear", start_freq="0GHz", stop_freq="20GHz", step="10MHz", discrete=False
|
|
297
|
+
):
|
|
298
|
+
"""Add a HFSS frequency sweep.
|
|
299
|
+
|
|
300
|
+
Parameters
|
|
301
|
+
----------
|
|
302
|
+
name : str, optional
|
|
303
|
+
Sweep name.
|
|
304
|
+
distribution : str, optional
|
|
305
|
+
Type of the sweep. The default is `"linear"`. Options are:
|
|
306
|
+
- `"linear"`
|
|
307
|
+
- `"linear_count"`
|
|
308
|
+
- `"decade_count"`
|
|
309
|
+
- `"octave_count"`
|
|
310
|
+
- `"exponential"`
|
|
311
|
+
start_freq : str, float, optional
|
|
312
|
+
Starting frequency. The default is ``1``.
|
|
313
|
+
stop_freq : str, float, optional
|
|
314
|
+
Stopping frequency. The default is ``1e9``.
|
|
315
|
+
step : str, float, int, optional
|
|
316
|
+
Frequency step. The default is ``1e6``. or used for `"decade_count"`, "linear_count"`, "octave_count"`
|
|
317
|
+
distribution. Must be integer in that case.
|
|
318
|
+
discrete : bool, optional
|
|
319
|
+
Whether the sweep is discrete. The default is ``False``.
|
|
320
|
+
|
|
321
|
+
Returns
|
|
322
|
+
-------
|
|
323
|
+
bool
|
|
324
|
+
"""
|
|
325
|
+
init_sweep_count = len(self.sweep_data)
|
|
326
|
+
start_freq = self._pedb.number_with_units(start_freq, "Hz")
|
|
327
|
+
stop_freq = self._pedb.number_with_units(stop_freq, "Hz")
|
|
328
|
+
step = str(step)
|
|
329
|
+
if distribution.lower() == "linear":
|
|
330
|
+
distribution = "LIN"
|
|
331
|
+
elif distribution.lower() == "linear_count":
|
|
332
|
+
distribution = "LINC"
|
|
333
|
+
elif distribution.lower() == "exponential":
|
|
334
|
+
distribution = "ESTP"
|
|
335
|
+
elif distribution.lower() == "decade_count":
|
|
336
|
+
distribution = "DEC"
|
|
337
|
+
elif distribution.lower() == "octave_count":
|
|
338
|
+
distribution = "OCT"
|
|
339
|
+
else:
|
|
340
|
+
distribution = "LIN"
|
|
341
|
+
if not name:
|
|
342
|
+
name = f"sweep_{init_sweep_count + 1}"
|
|
343
|
+
sweep_data = [
|
|
344
|
+
SweepData(self._pedb, name=name, distribution=distribution, start_f=start_freq, end_f=stop_freq, step=step)
|
|
345
|
+
]
|
|
346
|
+
if discrete:
|
|
347
|
+
sweep_data[0].type = sweep_data[0].type.DISCRETE_SWEEP
|
|
348
|
+
for sweep in self.sweep_data:
|
|
349
|
+
sweep_data.append(sweep)
|
|
350
|
+
self.sweep_data = sweep_data
|
|
351
|
+
if len(self.sweep_data) == init_sweep_count + 1:
|
|
352
|
+
return True
|
|
353
|
+
else:
|
|
354
|
+
self._pedb.logger.error("Failed to add frequency sweep data")
|
|
355
|
+
return False
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
#
|
|
4
|
+
#
|
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
# furnished to do so, subject to the following conditions:
|
|
11
|
+
#
|
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
# copies or substantial portions of the Software.
|
|
14
|
+
#
|
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
# SOFTWARE.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
from ansys.edb.core.simulation_setup.hfss_simulation_settings import (
|
|
25
|
+
HFSSSolverSettings as GrpcHFSSSolverSettings,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class HFSSSolverSettings(GrpcHFSSSolverSettings):
|
|
30
|
+
"""HFSS solver settings class."""
|
|
31
|
+
|
|
32
|
+
def __init__(self, pedb, edb_object):
|
|
33
|
+
super().__init__(edb_object)
|
|
34
|
+
self._pedb = pedb
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
#
|
|
4
|
+
#
|
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
# furnished to do so, subject to the following conditions:
|
|
11
|
+
#
|
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
# copies or substantial portions of the Software.
|
|
14
|
+
#
|
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
# FITNE SS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
# SOFTWARE.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
from ansys.edb.core.simulation_setup.mesh_operation import (
|
|
25
|
+
MeshOperation as GrpcMeshOperation,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class MeshOperation(GrpcMeshOperation):
|
|
30
|
+
"""Mesh operation class."""
|
|
31
|
+
|
|
32
|
+
def __init__(self, pedb, edb_object):
|
|
33
|
+
super().__init__(edb_object)
|
|
34
|
+
self._pedb = pedb
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
#
|
|
4
|
+
#
|
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
# furnished to do so, subject to the following conditions:
|
|
11
|
+
#
|
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
# copies or substantial portions of the Software.
|
|
14
|
+
#
|
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
# FITNE SS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
# SOFTWARE.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
from ansys.edb.core.simulation_setup.raptor_x_simulation_settings import (
|
|
25
|
+
RaptorXAdvancedSettings as GrpcRaptorXAdvancedSettings,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class RaptorXAdvancedSettings(GrpcRaptorXAdvancedSettings):
|
|
30
|
+
"""Raptor X advanced settings class."""
|
|
31
|
+
|
|
32
|
+
def __init__(self, pedb, edb_object):
|
|
33
|
+
super().__init__(edb_object)
|
|
34
|
+
self._pedb = pedb
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
#
|
|
4
|
+
#
|
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
# furnished to do so, subject to the following conditions:
|
|
11
|
+
#
|
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
# copies or substantial portions of the Software.
|
|
14
|
+
#
|
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
# FITNE SS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
# SOFTWARE.
|
|
22
|
+
|
|
23
|
+
from ansys.edb.core.simulation_setup.raptor_x_simulation_settings import (
|
|
24
|
+
RaptorXGeneralSettings as GrpcRaptorXGeneralSettings,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class RaptorXGeneralSettings(GrpcRaptorXGeneralSettings):
|
|
29
|
+
"""Raptor X general settings class."""
|
|
30
|
+
|
|
31
|
+
def __init__(self, pedb, edb_object):
|
|
32
|
+
super().__init__(edb_object)
|
|
33
|
+
self._pedb = pedb
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
#
|
|
4
|
+
#
|
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
# furnished to do so, subject to the following conditions:
|
|
11
|
+
#
|
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
# copies or substantial portions of the Software.
|
|
14
|
+
#
|
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
# FITNE SS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
# SOFTWARE.
|
|
22
|
+
|
|
23
|
+
from ansys.edb.core.simulation_setup.raptor_x_simulation_setup import (
|
|
24
|
+
RaptorXSimulationSettings as GrpcRaptorXSimulationSettings,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
from pyedb.grpc.database.simulation_setup.raptor_x_advanced_settings import (
|
|
28
|
+
RaptorXAdvancedSettings,
|
|
29
|
+
)
|
|
30
|
+
from pyedb.grpc.database.simulation_setup.raptor_x_general_settings import (
|
|
31
|
+
RaptorXGeneralSettings,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class RaptorXSimulationSettings(GrpcRaptorXSimulationSettings):
|
|
36
|
+
"""Raptor X simulation settings class."""
|
|
37
|
+
|
|
38
|
+
def __init__(self, pedb, edb_object):
|
|
39
|
+
super().__init__(edb_object)
|
|
40
|
+
self._pedb = pedb
|
|
41
|
+
|
|
42
|
+
@property
|
|
43
|
+
def advanced(self):
|
|
44
|
+
"""Advanced class.
|
|
45
|
+
|
|
46
|
+
Returns
|
|
47
|
+
-------
|
|
48
|
+
:class:`RaptorXAdvancedSettings <pyedb.grpc.database.simulation_setup.
|
|
49
|
+
raptor_x_advanced_settings.RaptorXAdvancedSettings>`
|
|
50
|
+
|
|
51
|
+
"""
|
|
52
|
+
return RaptorXAdvancedSettings(self._pedb, self.advanced)
|
|
53
|
+
|
|
54
|
+
@property
|
|
55
|
+
def general(self):
|
|
56
|
+
"""General settings class.
|
|
57
|
+
|
|
58
|
+
Returns
|
|
59
|
+
-------
|
|
60
|
+
:class:`RaptorXGeneralSettings <pyedb.grpc.database.simulation_setup.
|
|
61
|
+
raptor_x_general_settings.RaptorXGeneralSettings>`
|
|
62
|
+
|
|
63
|
+
"""
|
|
64
|
+
RaptorXGeneralSettings(self._pedb, self.general)
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
#
|
|
4
|
+
#
|
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
# furnished to do so, subject to the following conditions:
|
|
11
|
+
#
|
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
# copies or substantial portions of the Software.
|
|
14
|
+
#
|
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
# FITNE SS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
# SOFTWARE.
|
|
22
|
+
|
|
23
|
+
import warnings
|
|
24
|
+
|
|
25
|
+
from ansys.edb.core.simulation_setup.raptor_x_simulation_setup import (
|
|
26
|
+
RaptorXSimulationSetup as GrpcRaptorXSimulationSetup,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
from pyedb.grpc.database.simulation_setup.sweep_data import SweepData
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class RaptorXSimulationSetup(GrpcRaptorXSimulationSetup):
|
|
33
|
+
"""RaptorX simulation setup."""
|
|
34
|
+
|
|
35
|
+
def __init__(self, pedb, edb_object):
|
|
36
|
+
super().__init__(edb_object.msg)
|
|
37
|
+
self._pedb = pedb
|
|
38
|
+
|
|
39
|
+
@property
|
|
40
|
+
def frequency_sweeps(self):
|
|
41
|
+
"""Returns Frequency sweeps
|
|
42
|
+
. deprecated:: use sweep_data instead
|
|
43
|
+
"""
|
|
44
|
+
warnings.warn(
|
|
45
|
+
"`frequency_sweeps` is deprecated use `sweep_data` instead.",
|
|
46
|
+
DeprecationWarning,
|
|
47
|
+
)
|
|
48
|
+
return self.sweep_data
|
|
49
|
+
|
|
50
|
+
def add_frequency_sweep(
|
|
51
|
+
self, name=None, distribution="linear", start_freq="0GHz", stop_freq="20GHz", step="10MHz", discrete=False
|
|
52
|
+
):
|
|
53
|
+
"""Add frequency sweep.
|
|
54
|
+
|
|
55
|
+
. deprecated:: pyedb 0.31.0
|
|
56
|
+
Use :func:`add sweep` instead.
|
|
57
|
+
|
|
58
|
+
"""
|
|
59
|
+
warnings.warn(
|
|
60
|
+
"`add_frequency_sweep` is deprecated use `add_sweep` instead.",
|
|
61
|
+
DeprecationWarning,
|
|
62
|
+
)
|
|
63
|
+
return self.add_sweep(name, distribution, start_freq, stop_freq, step, discrete)
|
|
64
|
+
|
|
65
|
+
def add_sweep(
|
|
66
|
+
self, name=None, distribution="linear", start_freq="0GHz", stop_freq="20GHz", step="10MHz", discrete=False
|
|
67
|
+
):
|
|
68
|
+
"""Add a HFSS frequency sweep.
|
|
69
|
+
|
|
70
|
+
Parameters
|
|
71
|
+
----------
|
|
72
|
+
name : str, optional
|
|
73
|
+
Sweep name.
|
|
74
|
+
distribution : str, optional
|
|
75
|
+
Type of the sweep. The default is `"linear"`. Options are:
|
|
76
|
+
- `"linear"`
|
|
77
|
+
- `"linear_count"`
|
|
78
|
+
- `"decade_count"`
|
|
79
|
+
- `"octave_count"`
|
|
80
|
+
- `"exponential"`
|
|
81
|
+
start_freq : str, float, optional
|
|
82
|
+
Starting frequency. The default is ``1``.
|
|
83
|
+
stop_freq : str, float, optional
|
|
84
|
+
Stopping frequency. The default is ``1e9``.
|
|
85
|
+
step : str, float, int, optional
|
|
86
|
+
Frequency step. The default is ``1e6``. or used for `"decade_count"`, "linear_count"`, "octave_count"`
|
|
87
|
+
distribution. Must be integer in that case.
|
|
88
|
+
discrete : bool, optional
|
|
89
|
+
Whether the sweep is discrete. The default is ``False``.
|
|
90
|
+
|
|
91
|
+
Returns
|
|
92
|
+
-------
|
|
93
|
+
bool
|
|
94
|
+
"""
|
|
95
|
+
init_sweep_count = len(self.sweep_data)
|
|
96
|
+
start_freq = self._pedb.number_with_units(start_freq, "Hz")
|
|
97
|
+
stop_freq = self._pedb.number_with_units(stop_freq, "Hz")
|
|
98
|
+
step = str(step)
|
|
99
|
+
if distribution.lower() == "linear":
|
|
100
|
+
distribution = "LIN"
|
|
101
|
+
elif distribution.lower() == "linear_count":
|
|
102
|
+
distribution = "LINC"
|
|
103
|
+
elif distribution.lower() == "exponential":
|
|
104
|
+
distribution = "ESTP"
|
|
105
|
+
elif distribution.lower() == "decade_count":
|
|
106
|
+
distribution = "DEC"
|
|
107
|
+
elif distribution.lower() == "octave_count":
|
|
108
|
+
distribution = "OCT"
|
|
109
|
+
else:
|
|
110
|
+
distribution = "LIN"
|
|
111
|
+
if not name:
|
|
112
|
+
name = f"sweep_{init_sweep_count + 1}"
|
|
113
|
+
sweep_data = [
|
|
114
|
+
SweepData(self._pedb, name=name, distribution=distribution, start_f=start_freq, end_f=stop_freq, step=step)
|
|
115
|
+
]
|
|
116
|
+
if discrete:
|
|
117
|
+
sweep_data[0].type = sweep_data[0].type.DISCRETE_SWEEP
|
|
118
|
+
for sweep in self.sweep_data:
|
|
119
|
+
sweep_data.append(sweep)
|
|
120
|
+
self.sweep_data = sweep_data
|
|
121
|
+
if len(self.sweep_data) == init_sweep_count + 1:
|
|
122
|
+
return True
|
|
123
|
+
else:
|
|
124
|
+
self._pedb.logger.error("Failed to add frequency sweep data")
|
|
125
|
+
return False
|