pyedb 0.13.dev0__py3-none-any.whl → 0.14.1__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/configuration/cfg_common.py +0 -5
- pyedb/configuration/cfg_components.py +0 -2
- pyedb/configuration/cfg_operations.py +0 -2
- pyedb/configuration/cfg_package_definition.py +0 -2
- pyedb/configuration/cfg_ports_sources.py +14 -11
- pyedb/configuration/cfg_stackup.py +0 -7
- pyedb/configuration/configuration.py +0 -6
- pyedb/dotnet/application/Variables.py +4 -40
- pyedb/dotnet/edb.py +27 -82
- pyedb/dotnet/edb_core/{edb_data/components_data.py → cell/hierarchy/component.py} +13 -133
- pyedb/dotnet/edb_core/cell/hierarchy/model.py +0 -3
- pyedb/dotnet/edb_core/cell/hierarchy/netlist_model.py +30 -0
- pyedb/dotnet/edb_core/cell/hierarchy/pin_pair_model.py +105 -0
- pyedb/dotnet/edb_core/cell/hierarchy/s_parameter_model.py +34 -0
- pyedb/dotnet/edb_core/cell/hierarchy/spice_model.py +34 -0
- pyedb/dotnet/edb_core/cell/layout.py +137 -0
- pyedb/dotnet/edb_core/cell/layout_obj.py +2 -4
- pyedb/dotnet/edb_core/cell/primitive.py +199 -1
- pyedb/dotnet/edb_core/cell/terminal/bundle_terminal.py +52 -0
- pyedb/dotnet/edb_core/cell/terminal/edge_terminal.py +50 -0
- pyedb/dotnet/edb_core/cell/terminal/padstack_instance_terminal.py +88 -0
- pyedb/dotnet/edb_core/cell/terminal/pingroup_terminal.py +59 -0
- pyedb/dotnet/edb_core/cell/terminal/point_terminal.py +73 -0
- pyedb/dotnet/edb_core/{edb_data/terminals.py → cell/terminal/terminal.py} +33 -242
- pyedb/dotnet/edb_core/components.py +10 -56
- pyedb/dotnet/edb_core/definition/component_def.py +1 -8
- pyedb/dotnet/edb_core/definition/component_model.py +0 -2
- pyedb/dotnet/edb_core/definition/definitions.py +0 -2
- pyedb/dotnet/edb_core/definition/package_def.py +7 -5
- pyedb/dotnet/edb_core/edb_data/control_file.py +0 -3
- pyedb/dotnet/edb_core/edb_data/hfss_extent_info.py +0 -5
- pyedb/dotnet/edb_core/edb_data/hfss_pi_simulation_setup_data.py +4 -9
- pyedb/dotnet/edb_core/edb_data/layer_data.py +0 -7
- pyedb/dotnet/edb_core/edb_data/nets_data.py +2 -5
- pyedb/dotnet/edb_core/edb_data/padstacks_data.py +11 -29
- pyedb/dotnet/edb_core/edb_data/ports.py +4 -4
- pyedb/dotnet/edb_core/edb_data/primitives_data.py +3 -26
- pyedb/dotnet/edb_core/edb_data/raptor_x_simulation_setup_data.py +13 -20
- pyedb/dotnet/edb_core/edb_data/simulation_configuration.py +3 -11
- pyedb/dotnet/edb_core/edb_data/sources.py +12 -17
- pyedb/dotnet/edb_core/general.py +1 -6
- pyedb/dotnet/edb_core/geometry/polygon_data.py +0 -3
- pyedb/dotnet/edb_core/hfss.py +1 -33
- pyedb/dotnet/edb_core/layout.py +0 -35
- pyedb/dotnet/edb_core/layout_validation.py +1 -3
- pyedb/dotnet/edb_core/materials.py +1 -22
- pyedb/dotnet/edb_core/net_class.py +0 -8
- pyedb/dotnet/edb_core/nets.py +4 -29
- pyedb/dotnet/edb_core/padstack.py +76 -30
- pyedb/dotnet/edb_core/sim_setup_data/data/adaptive_frequency_data.py +72 -0
- pyedb/dotnet/edb_core/sim_setup_data/data/mesh_operation.py +287 -0
- pyedb/dotnet/edb_core/{edb_data/hfss_simulation_setup_data.py → sim_setup_data/data/settings.py} +174 -878
- pyedb/dotnet/edb_core/sim_setup_data/data/sweep_data.py +509 -0
- pyedb/dotnet/edb_core/sim_setup_data/io/__init__.py +0 -0
- pyedb/dotnet/edb_core/{edb_data/siwave_simulation_setup_data.py → sim_setup_data/io/siwave.py} +0 -341
- pyedb/dotnet/edb_core/siwave.py +5 -33
- pyedb/dotnet/edb_core/stackup.py +4 -51
- pyedb/dotnet/edb_core/utilities/simulation_setup.py +613 -366
- pyedb/generic/data_handlers.py +1 -9
- pyedb/generic/general_methods.py +3 -53
- pyedb/generic/plot.py +1 -2
- pyedb/ipc2581/ecad/cad_data/layer_feature.py +1 -7
- pyedb/ipc2581/ecad/cad_data/package.py +1 -4
- pyedb/ipc2581/ecad/cad_data/path.py +1 -3
- pyedb/ipc2581/ecad/cad_data/polygon.py +1 -6
- pyedb/ipc2581/ecad/cad_data/step.py +1 -10
- pyedb/ipc2581/ipc2581.py +8 -15
- pyedb/modeler/geometry_operators.py +164 -67
- pyedb/siwave.py +25 -32
- {pyedb-0.13.dev0.dist-info → pyedb-0.14.1.dist-info}/METADATA +2 -2
- {pyedb-0.13.dev0.dist-info → pyedb-0.14.1.dist-info}/RECORD +75 -61
- /pyedb/dotnet/edb_core/cell/{__init__.py → terminal/__init__.py} +0 -0
- {pyedb-0.13.dev0.dist-info → pyedb-0.14.1.dist-info}/LICENSE +0 -0
- {pyedb-0.13.dev0.dist-info → pyedb-0.14.1.dist-info}/WHEEL +0 -0
|
@@ -20,10 +20,67 @@
|
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
# SOFTWARE.
|
|
22
22
|
|
|
23
|
-
from pyedb.generic.general_methods import generate_unique_name, pyedb_function_handler
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
import warnings
|
|
25
|
+
|
|
26
|
+
from pyedb.dotnet.edb_core.general import (
|
|
27
|
+
convert_netdict_to_pydict,
|
|
28
|
+
convert_pydict_to_netdict,
|
|
29
|
+
)
|
|
30
|
+
from pyedb.dotnet.edb_core.sim_setup_data.data.mesh_operation import (
|
|
31
|
+
MeshOperationLength,
|
|
32
|
+
MeshOperationSkinDepth,
|
|
33
|
+
)
|
|
34
|
+
from pyedb.dotnet.edb_core.sim_setup_data.data.settings import (
|
|
35
|
+
AdaptiveSettings,
|
|
36
|
+
AdvancedMeshSettings,
|
|
37
|
+
CurveApproxSettings,
|
|
38
|
+
DcrSettings,
|
|
39
|
+
DefeatureSettings,
|
|
40
|
+
HfssPortSettings,
|
|
41
|
+
HfssSolverSettings,
|
|
42
|
+
ViaSettings,
|
|
43
|
+
)
|
|
44
|
+
from pyedb.dotnet.edb_core.sim_setup_data.data.siw_dc_ir_settings import (
|
|
45
|
+
SiwaveDCIRSettings,
|
|
46
|
+
)
|
|
47
|
+
from pyedb.dotnet.edb_core.sim_setup_data.data.sweep_data import SweepData
|
|
48
|
+
from pyedb.dotnet.edb_core.sim_setup_data.io.siwave import (
|
|
49
|
+
AdvancedSettings,
|
|
50
|
+
DCAdvancedSettings,
|
|
51
|
+
DCSettings,
|
|
52
|
+
)
|
|
53
|
+
from pyedb.generic.general_methods import generate_unique_name, is_linux
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _parse_value(v):
|
|
57
|
+
"""Parse value in C sharp format."""
|
|
58
|
+
# duck typing parse of the value 'v'
|
|
59
|
+
if v is None or v == "":
|
|
60
|
+
pv = v
|
|
61
|
+
elif v == "true":
|
|
62
|
+
pv = True
|
|
63
|
+
elif v == "false":
|
|
64
|
+
pv = False
|
|
65
|
+
else:
|
|
66
|
+
try:
|
|
67
|
+
pv = int(v)
|
|
68
|
+
except ValueError:
|
|
69
|
+
try:
|
|
70
|
+
pv = float(v)
|
|
71
|
+
except ValueError:
|
|
72
|
+
if isinstance(v, str) and v[0] == v[-1] == "'":
|
|
73
|
+
pv = v[1:-1]
|
|
74
|
+
else:
|
|
75
|
+
pv = v
|
|
76
|
+
return pv
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class AdaptiveType(object):
|
|
80
|
+
(SingleFrequency, MultiFrequency, BroadBand) = range(0, 3)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class SimulationSetup(object):
|
|
27
84
|
"""Provide base simulation setup.
|
|
28
85
|
|
|
29
86
|
Parameters
|
|
@@ -36,10 +93,9 @@ class BaseSimulationSetup(object):
|
|
|
36
93
|
EDB object.
|
|
37
94
|
"""
|
|
38
95
|
|
|
39
|
-
|
|
40
|
-
def __init__(self, pedb, edb_setup=None):
|
|
96
|
+
def __init__(self, pedb, edb_object=None):
|
|
41
97
|
self._pedb = pedb
|
|
42
|
-
self._edb_object =
|
|
98
|
+
self._edb_object = edb_object
|
|
43
99
|
self._setup_type = ""
|
|
44
100
|
self._setup_type_mapping = {
|
|
45
101
|
"kHFSS": self._pedb.simsetupdata.HFSSSimulationSettings,
|
|
@@ -59,7 +115,6 @@ class BaseSimulationSetup(object):
|
|
|
59
115
|
"kNumSetupTypes": None,
|
|
60
116
|
}
|
|
61
117
|
|
|
62
|
-
version = self._pedb.edbversion.split(".")
|
|
63
118
|
if float(self._pedb.edbversion) >= 2024.2:
|
|
64
119
|
self._setup_type_mapping.update(
|
|
65
120
|
{
|
|
@@ -72,7 +127,6 @@ class BaseSimulationSetup(object):
|
|
|
72
127
|
|
|
73
128
|
self._sweep_list = {}
|
|
74
129
|
|
|
75
|
-
@pyedb_function_handler
|
|
76
130
|
def _create(self, name=None):
|
|
77
131
|
"""Create a simulation setup."""
|
|
78
132
|
if not name:
|
|
@@ -90,7 +144,6 @@ class BaseSimulationSetup(object):
|
|
|
90
144
|
self._edb_object = self._set_edb_setup_info(edb_setup_info)
|
|
91
145
|
self._update_setup()
|
|
92
146
|
|
|
93
|
-
@pyedb_function_handler
|
|
94
147
|
def _set_edb_setup_info(self, edb_setup_info):
|
|
95
148
|
"""Create a setup object from a setup information object."""
|
|
96
149
|
utility = self._pedb._edb.Utility
|
|
@@ -115,10 +168,10 @@ class BaseSimulationSetup(object):
|
|
|
115
168
|
version = self._pedb.edbversion.split(".")
|
|
116
169
|
if int(version[0]) == 2024 and int(version[1]) == 2 or int(version[0]) > 2024:
|
|
117
170
|
setup_type_mapping["kRaptorX"] = utility.RaptorXSimulationSetup
|
|
171
|
+
setup_type_mapping["kHFSSPI"] = utility.HFSSPISimulationSetup
|
|
118
172
|
setup_utility = setup_type_mapping[self._setup_type]
|
|
119
173
|
return setup_utility(edb_setup_info)
|
|
120
174
|
|
|
121
|
-
@pyedb_function_handler()
|
|
122
175
|
def _update_setup(self):
|
|
123
176
|
"""Update setup in EDB."""
|
|
124
177
|
if self._setup_type == "kHFSS":
|
|
@@ -185,16 +238,15 @@ class BaseSimulationSetup(object):
|
|
|
185
238
|
else:
|
|
186
239
|
sweep_data_list = self.get_sim_setup_info.SweepDataList
|
|
187
240
|
for i in list(sweep_data_list):
|
|
188
|
-
temp[i.Name] =
|
|
241
|
+
temp[i.Name] = SweepData(self, None, i.Name, i)
|
|
189
242
|
return temp
|
|
190
243
|
|
|
191
|
-
@pyedb_function_handler
|
|
192
244
|
def _add_frequency_sweep(self, sweep_data):
|
|
193
245
|
"""Add a frequency sweep.
|
|
194
246
|
|
|
195
247
|
Parameters
|
|
196
248
|
----------
|
|
197
|
-
sweep_data:
|
|
249
|
+
sweep_data: SweepData
|
|
198
250
|
"""
|
|
199
251
|
self._sweep_list[sweep_data.name] = sweep_data
|
|
200
252
|
if self.setup_type in ["kRaptorX", "kHFSSPI"]:
|
|
@@ -209,7 +261,6 @@ class BaseSimulationSetup(object):
|
|
|
209
261
|
self._edb_object = self._set_edb_setup_info(edb_setup_info)
|
|
210
262
|
self._update_setup()
|
|
211
263
|
|
|
212
|
-
@pyedb_function_handler
|
|
213
264
|
def delete_frequency_sweep(self, sweep_data):
|
|
214
265
|
"""Delete a frequency sweep.
|
|
215
266
|
|
|
@@ -230,7 +281,6 @@ class BaseSimulationSetup(object):
|
|
|
230
281
|
self._update_setup()
|
|
231
282
|
return True if name in self.frequency_sweeps else False
|
|
232
283
|
|
|
233
|
-
@pyedb_function_handler()
|
|
234
284
|
def add_frequency_sweep(self, name=None, frequency_sweep=None):
|
|
235
285
|
"""Add frequency sweep.
|
|
236
286
|
|
|
@@ -264,501 +314,698 @@ class BaseSimulationSetup(object):
|
|
|
264
314
|
|
|
265
315
|
if not name:
|
|
266
316
|
name = generate_unique_name("sweep")
|
|
267
|
-
sweep =
|
|
317
|
+
sweep = SweepData(self, frequency_sweep, name)
|
|
268
318
|
self._add_frequency_sweep(sweep)
|
|
269
319
|
self._update_setup()
|
|
270
320
|
return sweep
|
|
271
321
|
|
|
272
322
|
|
|
273
|
-
class
|
|
274
|
-
"""Manages EDB methods for
|
|
275
|
-
|
|
276
|
-
Parameters
|
|
277
|
-
----------
|
|
278
|
-
sim_setup : :class:`pyedb.dotnet.edb_core.edb_data.siwave_simulation_setup_data.SiwaveSYZSimulationSetup`
|
|
279
|
-
name : str, optional
|
|
280
|
-
Name of the frequency sweep.
|
|
281
|
-
edb_sweep_data : :class:`Ansys.Ansoft.Edb.Utility.SIWDCIRSimulationSettings`, optional
|
|
282
|
-
EDB object. The default is ``None``.
|
|
283
|
-
"""
|
|
323
|
+
class HfssSimulationSetup(SimulationSetup):
|
|
324
|
+
"""Manages EDB methods for HFSS simulation setup."""
|
|
284
325
|
|
|
285
|
-
def __init__(self,
|
|
286
|
-
|
|
326
|
+
def __init__(self, pedb, edb_object=None):
|
|
327
|
+
super().__init__(pedb, edb_object)
|
|
328
|
+
self._setup_type = "kHFSS"
|
|
329
|
+
self._mesh_operations = {}
|
|
287
330
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
self._name = generate_unique_name("sweep")
|
|
294
|
-
else:
|
|
295
|
-
self._name = name
|
|
296
|
-
self._edb_sweep_data = self._pedb.simsetupdata.SweepData(self._name)
|
|
297
|
-
self.set_frequencies(frequency_sweep)
|
|
331
|
+
def create(self, name=None):
|
|
332
|
+
"""Create an HFSS setup."""
|
|
333
|
+
self._name = name
|
|
334
|
+
self._create(name)
|
|
335
|
+
return self
|
|
298
336
|
|
|
299
337
|
@property
|
|
300
|
-
def
|
|
301
|
-
|
|
338
|
+
def get_sim_setup_info(self):
|
|
339
|
+
"""Get simulation setup information."""
|
|
340
|
+
return self._edb_object.GetSimSetupInfo()
|
|
302
341
|
|
|
303
342
|
@property
|
|
304
|
-
def
|
|
305
|
-
"""
|
|
306
|
-
|
|
343
|
+
def solver_slider_type(self):
|
|
344
|
+
"""Solver slider type.
|
|
345
|
+
Options are:
|
|
346
|
+
1 - ``kFast``.
|
|
347
|
+
2 - ``kMedium``.
|
|
348
|
+
3 - ``kAccurate``.
|
|
349
|
+
4 - ``kNumSliderTypes``.
|
|
307
350
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
self.
|
|
313
|
-
|
|
351
|
+
Returns
|
|
352
|
+
-------
|
|
353
|
+
str
|
|
354
|
+
"""
|
|
355
|
+
return self.get_sim_setup_info.SimulationSettings.TSolveSliderType.ToString()
|
|
356
|
+
|
|
357
|
+
@solver_slider_type.setter
|
|
358
|
+
def solver_slider_type(self, value):
|
|
359
|
+
"""Set solver slider type."""
|
|
360
|
+
solver_types = {
|
|
361
|
+
"kFast": self.get_sim_setup_info.SimulationSettings.TSolveSliderType.k25DViaWirebond,
|
|
362
|
+
"kMedium": self.get_sim_setup_info.SimulationSettings.TSolveSliderType.k25DViaRibbon,
|
|
363
|
+
"kAccurate": self.get_sim_setup_info.SimulationSettings.TSolveSliderType.k25DViaMesh,
|
|
364
|
+
"kNumSliderTypes": self.get_sim_setup_info.SimulationSettings.TSolveSliderType.k25DViaField,
|
|
365
|
+
}
|
|
366
|
+
self.get_sim_setup_info.SimulationSettings.TSolveSliderType = solver_types[value]
|
|
367
|
+
self._update_setup()
|
|
314
368
|
|
|
315
369
|
@property
|
|
316
|
-
def
|
|
317
|
-
"""
|
|
318
|
-
return self.
|
|
370
|
+
def is_auto_setup(self):
|
|
371
|
+
"""Flag indicating if automatic setup is enabled."""
|
|
372
|
+
return self.get_sim_setup_info.SimulationSettings.IsAutoSetup
|
|
319
373
|
|
|
320
|
-
@
|
|
321
|
-
def
|
|
322
|
-
self.
|
|
323
|
-
self.
|
|
374
|
+
@is_auto_setup.setter
|
|
375
|
+
def is_auto_setup(self, value):
|
|
376
|
+
self.get_sim_setup_info.SimulationSettings.IsAutoSetup = value
|
|
377
|
+
self._update_setup()
|
|
324
378
|
|
|
325
379
|
@property
|
|
326
|
-
def
|
|
327
|
-
"""
|
|
328
|
-
return
|
|
380
|
+
def hfss_solver_settings(self):
|
|
381
|
+
"""Manages EDB methods for HFSS solver settings.
|
|
329
382
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
383
|
+
Returns
|
|
384
|
+
-------
|
|
385
|
+
:class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.HfssSolverSettings`
|
|
386
|
+
|
|
387
|
+
"""
|
|
388
|
+
return HfssSolverSettings(self)
|
|
334
389
|
|
|
335
390
|
@property
|
|
336
|
-
def
|
|
337
|
-
"""
|
|
391
|
+
def adaptive_settings(self):
|
|
392
|
+
"""Adaptive Settings Class.
|
|
338
393
|
|
|
339
394
|
Returns
|
|
340
395
|
-------
|
|
341
|
-
|
|
342
|
-
|
|
396
|
+
:class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.AdaptiveSettings`
|
|
397
|
+
|
|
343
398
|
"""
|
|
344
|
-
return self
|
|
399
|
+
return AdaptiveSettings(self)
|
|
345
400
|
|
|
346
401
|
@property
|
|
347
|
-
def
|
|
348
|
-
"""
|
|
402
|
+
def defeature_settings(self):
|
|
403
|
+
"""Defeature settings Class.
|
|
349
404
|
|
|
350
405
|
Returns
|
|
351
406
|
-------
|
|
352
|
-
|
|
353
|
-
|
|
407
|
+
:class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.DefeatureSettings`
|
|
408
|
+
|
|
354
409
|
"""
|
|
355
|
-
return self
|
|
410
|
+
return DefeatureSettings(self)
|
|
356
411
|
|
|
357
412
|
@property
|
|
358
|
-
def
|
|
359
|
-
"""
|
|
360
|
-
return self._edb_sweep_data.ComputeDCPoint
|
|
413
|
+
def via_settings(self):
|
|
414
|
+
"""Via settings Class.
|
|
361
415
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
self._update_sweep()
|
|
416
|
+
Returns
|
|
417
|
+
-------
|
|
418
|
+
:class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.ViaSettings`
|
|
366
419
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
"""Flag indicating if Auto SMatrix only solve is turned on."""
|
|
370
|
-
return self._edb_sweep_data.AutoSMatOnlySolve
|
|
420
|
+
"""
|
|
421
|
+
return ViaSettings(self)
|
|
371
422
|
|
|
372
423
|
@property
|
|
373
|
-
def
|
|
374
|
-
"""
|
|
424
|
+
def advanced_mesh_settings(self):
|
|
425
|
+
"""Advanced mesh settings Class.
|
|
375
426
|
|
|
376
427
|
Returns
|
|
377
428
|
-------
|
|
378
|
-
|
|
379
|
-
|
|
429
|
+
:class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.AdvancedMeshSettings`
|
|
430
|
+
|
|
380
431
|
"""
|
|
381
|
-
return self
|
|
432
|
+
return AdvancedMeshSettings(self)
|
|
382
433
|
|
|
383
434
|
@property
|
|
384
|
-
def
|
|
385
|
-
"""
|
|
435
|
+
def curve_approx_settings(self):
|
|
436
|
+
"""Curve approximation settings Class.
|
|
386
437
|
|
|
387
438
|
Returns
|
|
388
439
|
-------
|
|
389
|
-
|
|
390
|
-
|
|
440
|
+
:class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.CurveApproxSettings`
|
|
441
|
+
|
|
391
442
|
"""
|
|
392
|
-
return self
|
|
443
|
+
return CurveApproxSettings(self)
|
|
393
444
|
|
|
394
445
|
@property
|
|
395
|
-
def
|
|
396
|
-
"""
|
|
446
|
+
def dcr_settings(self):
|
|
447
|
+
"""Dcr settings Class.
|
|
397
448
|
|
|
398
449
|
Returns
|
|
399
450
|
-------
|
|
400
|
-
|
|
401
|
-
|
|
451
|
+
:class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.DcrSettings`
|
|
452
|
+
|
|
402
453
|
"""
|
|
403
|
-
return self
|
|
454
|
+
return DcrSettings(self)
|
|
404
455
|
|
|
405
456
|
@property
|
|
406
|
-
def
|
|
407
|
-
"""
|
|
408
|
-
|
|
409
|
-
Options are:
|
|
410
|
-
- ``"kInterpolatingSweep"``
|
|
411
|
-
- ``"kDiscreteSweep"``
|
|
412
|
-
- ``"kBroadbandFastSweep"``
|
|
457
|
+
def hfss_port_settings(self):
|
|
458
|
+
"""HFSS port settings Class.
|
|
413
459
|
|
|
414
460
|
Returns
|
|
415
461
|
-------
|
|
416
|
-
|
|
417
|
-
|
|
462
|
+
:class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.HfssPortSettings`
|
|
463
|
+
|
|
418
464
|
"""
|
|
419
|
-
return self
|
|
465
|
+
return HfssPortSettings(self)
|
|
420
466
|
|
|
421
467
|
@property
|
|
422
|
-
def
|
|
423
|
-
"""
|
|
468
|
+
def mesh_operations(self):
|
|
469
|
+
"""Mesh operations settings Class.
|
|
424
470
|
|
|
425
471
|
Returns
|
|
426
472
|
-------
|
|
427
|
-
|
|
428
|
-
|
|
473
|
+
List of :class:`dotnet.edb_core.edb_data.hfss_simulation_setup_data.MeshOperation`
|
|
474
|
+
|
|
429
475
|
"""
|
|
430
|
-
|
|
476
|
+
if self._mesh_operations:
|
|
477
|
+
return self._mesh_operations
|
|
478
|
+
settings = self.get_sim_setup_info.SimulationSettings.MeshOperations
|
|
479
|
+
self._mesh_operations = {}
|
|
480
|
+
for i in list(settings):
|
|
481
|
+
if i.MeshOpType == i.TMeshOpType.kMeshSetupLength:
|
|
482
|
+
self._mesh_operations[i.Name] = MeshOperationLength(self, i)
|
|
483
|
+
elif i.MeshOpType == i.TMeshOpType.kMeshSetupSkinDepth:
|
|
484
|
+
self._mesh_operations[i.Name] = MeshOperationSkinDepth(self, i)
|
|
485
|
+
elif i.MeshOpType == i.TMeshOpType.kMeshSetupBase:
|
|
486
|
+
self._mesh_operations[i.Name] = MeshOperationSkinDepth(self, i)
|
|
487
|
+
|
|
488
|
+
return self._mesh_operations
|
|
489
|
+
|
|
490
|
+
def add_length_mesh_operation(
|
|
491
|
+
self,
|
|
492
|
+
net_layer_list,
|
|
493
|
+
name=None,
|
|
494
|
+
max_elements=1000,
|
|
495
|
+
max_length="1mm",
|
|
496
|
+
restrict_elements=True,
|
|
497
|
+
restrict_length=True,
|
|
498
|
+
refine_inside=False,
|
|
499
|
+
mesh_region=None,
|
|
500
|
+
):
|
|
501
|
+
"""Add a mesh operation to the setup.
|
|
431
502
|
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
503
|
+
Parameters
|
|
504
|
+
----------
|
|
505
|
+
net_layer_list : dict
|
|
506
|
+
Dictionary containing nets and layers on which enable Mesh operation. Example ``{"A0_N": ["TOP", "PWR"]}``.
|
|
507
|
+
name : str, optional
|
|
508
|
+
Mesh operation name.
|
|
509
|
+
max_elements : int, optional
|
|
510
|
+
Maximum number of elements. Default is ``1000``.
|
|
511
|
+
max_length : str, optional
|
|
512
|
+
Maximum length of elements. Default is ``1mm``.
|
|
513
|
+
restrict_elements : bool, optional
|
|
514
|
+
Whether to restrict number of elements. Default is ``True``.
|
|
515
|
+
restrict_length : bool, optional
|
|
516
|
+
Whether to restrict length of elements. Default is ``True``.
|
|
517
|
+
mesh_region : str, optional
|
|
518
|
+
Mesh region name.
|
|
519
|
+
refine_inside : bool, optional
|
|
520
|
+
Whether to refine inside or not. Default is ``False``.
|
|
435
521
|
|
|
436
522
|
Returns
|
|
437
523
|
-------
|
|
438
|
-
|
|
439
|
-
``True`` if port impedance is used, ``False`` otherwise.
|
|
524
|
+
:class:`dotnet.edb_core.edb_data.hfss_simulation_setup_data.LengthMeshOperation`
|
|
440
525
|
"""
|
|
441
|
-
|
|
526
|
+
if not name:
|
|
527
|
+
name = generate_unique_name("skin")
|
|
528
|
+
mesh_operation = MeshOperationLength(self, self._pedb.simsetupdata.LengthMeshOperation())
|
|
529
|
+
mesh_operation.mesh_region = mesh_region
|
|
530
|
+
mesh_operation.name = name
|
|
531
|
+
mesh_operation.nets_layers_list = net_layer_list
|
|
532
|
+
mesh_operation.refine_inside = refine_inside
|
|
533
|
+
mesh_operation.max_elements = str(max_elements)
|
|
534
|
+
mesh_operation.max_length = max_length
|
|
535
|
+
mesh_operation.restrict_length = restrict_length
|
|
536
|
+
mesh_operation.restrict_max_elements = restrict_elements
|
|
537
|
+
self.mesh_operations[name] = mesh_operation
|
|
538
|
+
return mesh_operation if self._update_setup() else False
|
|
539
|
+
|
|
540
|
+
def add_skin_depth_mesh_operation(
|
|
541
|
+
self,
|
|
542
|
+
net_layer_list,
|
|
543
|
+
name=None,
|
|
544
|
+
max_elements=1000,
|
|
545
|
+
skin_depth="1um",
|
|
546
|
+
restrict_elements=True,
|
|
547
|
+
surface_triangle_length="1mm",
|
|
548
|
+
number_of_layers=2,
|
|
549
|
+
refine_inside=False,
|
|
550
|
+
mesh_region=None,
|
|
551
|
+
):
|
|
552
|
+
"""Add a mesh operation to the setup.
|
|
442
553
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
554
|
+
Parameters
|
|
555
|
+
----------
|
|
556
|
+
net_layer_list : dict
|
|
557
|
+
Dictionary containing nets and layers on which enable Mesh operation. Example ``{"A0_N": ["TOP", "PWR"]}``.
|
|
558
|
+
name : str, optional
|
|
559
|
+
Mesh operation name.
|
|
560
|
+
max_elements : int, optional
|
|
561
|
+
Maximum number of elements. Default is ``1000``.
|
|
562
|
+
skin_depth : str, optional
|
|
563
|
+
Skin Depth. Default is ``1um``.
|
|
564
|
+
restrict_elements : bool, optional
|
|
565
|
+
Whether to restrict number of elements. Default is ``True``.
|
|
566
|
+
surface_triangle_length : bool, optional
|
|
567
|
+
Surface Triangle length. Default is ``1mm``.
|
|
568
|
+
number_of_layers : int, str, optional
|
|
569
|
+
Number of layers. Default is ``2``.
|
|
570
|
+
mesh_region : str, optional
|
|
571
|
+
Mesh region name.
|
|
572
|
+
refine_inside : bool, optional
|
|
573
|
+
Whether to refine inside or not. Default is ``False``.
|
|
446
574
|
|
|
447
575
|
Returns
|
|
448
576
|
-------
|
|
449
|
-
|
|
450
|
-
``True`` if propagation constants are used, ``False`` otherwise.
|
|
577
|
+
:class:`dotnet.edb_core.edb_data.hfss_simulation_setup_data.LengthMeshOperation`
|
|
451
578
|
"""
|
|
452
|
-
|
|
579
|
+
if not name:
|
|
580
|
+
name = generate_unique_name("length")
|
|
581
|
+
mesh_operation = MeshOperationSkinDepth(self, self._pedb.simsetupdata.SkinDepthMeshOperation())
|
|
582
|
+
mesh_operation.mesh_region = mesh_region
|
|
583
|
+
mesh_operation.name = name
|
|
584
|
+
mesh_operation.nets_layers_list = net_layer_list
|
|
585
|
+
mesh_operation.refine_inside = refine_inside
|
|
586
|
+
mesh_operation.max_elements = max_elements
|
|
587
|
+
mesh_operation.skin_depth = skin_depth
|
|
588
|
+
mesh_operation.number_of_layer_elements = number_of_layers
|
|
589
|
+
mesh_operation.surface_triangle_length = surface_triangle_length
|
|
590
|
+
mesh_operation.restrict_max_elements = restrict_elements
|
|
591
|
+
self.mesh_operations[name] = mesh_operation
|
|
592
|
+
return mesh_operation if self._update_setup() else False
|
|
453
593
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
594
|
+
def add_frequency_sweep(self, name=None, frequency_sweep=None):
|
|
595
|
+
"""Add frequency sweep.
|
|
596
|
+
|
|
597
|
+
Parameters
|
|
598
|
+
----------
|
|
599
|
+
name : str, optional
|
|
600
|
+
Name of the frequency sweep.
|
|
601
|
+
frequency_sweep : list, optional
|
|
602
|
+
List of frequency points.
|
|
457
603
|
|
|
458
604
|
Returns
|
|
459
605
|
-------
|
|
460
|
-
|
|
461
|
-
|
|
606
|
+
:class:`pyedb.dotnet.edb_core.edb_data.simulation_setup.EdbFrequencySweep`
|
|
607
|
+
|
|
608
|
+
Examples
|
|
609
|
+
--------
|
|
610
|
+
>>> setup1 = edbapp.create_hfss_setup("setup1")
|
|
611
|
+
>>> setup1.add_frequency_sweep(frequency_sweep=[
|
|
612
|
+
... ["linear count", "0", "1kHz", 1],
|
|
613
|
+
... ["log scale", "1kHz", "0.1GHz", 10],
|
|
614
|
+
... ["linear scale", "0.1GHz", "10GHz", "0.1GHz"],
|
|
615
|
+
... ])
|
|
462
616
|
"""
|
|
463
|
-
|
|
617
|
+
if name in self.frequency_sweeps:
|
|
618
|
+
return False
|
|
619
|
+
if not name:
|
|
620
|
+
name = generate_unique_name("sweep")
|
|
621
|
+
return SweepData(self, frequency_sweep, name)
|
|
464
622
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
623
|
+
def set_solution_single_frequency(self, frequency="5GHz", max_num_passes=10, max_delta_s=0.02):
|
|
624
|
+
"""Set single-frequency solution.
|
|
625
|
+
|
|
626
|
+
Parameters
|
|
627
|
+
----------
|
|
628
|
+
frequency : str, float, optional
|
|
629
|
+
Adaptive frequency. The default is ``5GHz``.
|
|
630
|
+
max_num_passes : int, optional
|
|
631
|
+
Maximum number of passes. The default is ``10``.
|
|
632
|
+
max_delta_s : float, optional
|
|
633
|
+
Maximum delta S. The default is ``0.02``.
|
|
468
634
|
|
|
469
635
|
Returns
|
|
470
636
|
-------
|
|
471
|
-
|
|
637
|
+
bool
|
|
638
|
+
|
|
472
639
|
"""
|
|
473
|
-
|
|
640
|
+
self.adaptive_settings.adapt_type = "kSingle"
|
|
641
|
+
self.adaptive_settings.adaptive_settings.AdaptiveFrequencyDataList.Clear()
|
|
642
|
+
return self.adaptive_settings.add_adaptive_frequency_data(frequency, max_num_passes, max_delta_s)
|
|
474
643
|
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
644
|
+
def set_solution_multi_frequencies(self, frequencies=("5GHz", "10GHz"), max_num_passes=10, max_delta_s="0.02"):
|
|
645
|
+
"""Set multi-frequency solution.
|
|
646
|
+
|
|
647
|
+
Parameters
|
|
648
|
+
----------
|
|
649
|
+
frequencies : list, tuple, optional
|
|
650
|
+
List or tuple of adaptive frequencies. The default is ``5GHz``.
|
|
651
|
+
max_num_passes : int, optional
|
|
652
|
+
Maximum number of passes. Default is ``10``.
|
|
653
|
+
max_delta_s : float, optional
|
|
654
|
+
Maximum delta S. The default is ``0.02``.
|
|
478
655
|
|
|
479
656
|
Returns
|
|
480
657
|
-------
|
|
481
|
-
|
|
482
|
-
|
|
658
|
+
bool
|
|
659
|
+
|
|
483
660
|
"""
|
|
484
|
-
|
|
661
|
+
self.adaptive_settings.adapt_type = "kMultiFrequencies"
|
|
662
|
+
self.adaptive_settings.adaptive_settings.AdaptiveFrequencyDataList.Clear()
|
|
663
|
+
for i in frequencies:
|
|
664
|
+
if not self.adaptive_settings.add_adaptive_frequency_data(i, max_num_passes, max_delta_s):
|
|
665
|
+
return False
|
|
666
|
+
return True
|
|
485
667
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
668
|
+
def set_solution_broadband(
|
|
669
|
+
self, low_frequency="5GHz", high_frequency="10GHz", max_num_passes=10, max_delta_s="0.02"
|
|
670
|
+
):
|
|
671
|
+
"""Set broadband solution.
|
|
672
|
+
|
|
673
|
+
Parameters
|
|
674
|
+
----------
|
|
675
|
+
low_frequency : str, float, optional
|
|
676
|
+
Low frequency. The default is ``5GHz``.
|
|
677
|
+
high_frequency : str, float, optional
|
|
678
|
+
High frequency. The default is ``10GHz``.
|
|
679
|
+
max_num_passes : int, optional
|
|
680
|
+
Maximum number of passes. The default is ``10``.
|
|
681
|
+
max_delta_s : float, optional
|
|
682
|
+
Maximum Delta S. Default is ``0.02``.
|
|
489
683
|
|
|
490
684
|
Returns
|
|
491
685
|
-------
|
|
492
|
-
|
|
493
|
-
Frequency with units.
|
|
686
|
+
bool
|
|
494
687
|
"""
|
|
495
|
-
|
|
688
|
+
self.adaptive_settings.adapt_type = "kBroadband"
|
|
689
|
+
self.adaptive_settings.adaptive_settings.AdaptiveFrequencyDataList.Clear()
|
|
690
|
+
if not self.adaptive_settings.add_broadband_adaptive_frequency_data(
|
|
691
|
+
low_frequency, high_frequency, max_num_passes, max_delta_s
|
|
692
|
+
): # pragma no cover
|
|
693
|
+
return False
|
|
694
|
+
return True
|
|
496
695
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
696
|
+
|
|
697
|
+
class SiwaveSYZSimulationSetup(SimulationSetup):
|
|
698
|
+
"""Manages EDB methods for SIwave simulation setup.
|
|
699
|
+
|
|
700
|
+
Parameters
|
|
701
|
+
----------
|
|
702
|
+
pedb : :class:`pyedb.dotnet.edb.Edb`
|
|
703
|
+
Inherited AEDT object.
|
|
704
|
+
edb_setup : :class:`Ansys.Ansoft.Edb.Utility.SIWaveSimulationSetup`
|
|
705
|
+
Edb object.
|
|
706
|
+
"""
|
|
707
|
+
|
|
708
|
+
def __init__(self, pedb, edb_setup=None):
|
|
709
|
+
super().__init__(pedb, edb_setup)
|
|
710
|
+
self._edb = self._pedb
|
|
711
|
+
self._setup_type = "kSIwave"
|
|
712
|
+
self._sim_setup_info = None
|
|
713
|
+
|
|
714
|
+
def create(self, name=None):
|
|
715
|
+
"""Create a SIwave SYZ setup.
|
|
500
716
|
|
|
501
717
|
Returns
|
|
502
718
|
-------
|
|
503
|
-
|
|
719
|
+
:class:`SiwaveDCSimulationSetup`
|
|
504
720
|
"""
|
|
505
|
-
|
|
721
|
+
self._name = name
|
|
722
|
+
self._create(name)
|
|
723
|
+
self.si_slider_position = 1
|
|
506
724
|
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
725
|
+
return self
|
|
726
|
+
|
|
727
|
+
def get_configurations(self):
|
|
728
|
+
"""Get SIwave SYZ simulation settings.
|
|
510
729
|
|
|
511
730
|
Returns
|
|
512
731
|
-------
|
|
513
|
-
|
|
732
|
+
dict
|
|
733
|
+
Dictionary of SIwave SYZ simulation settings.
|
|
514
734
|
"""
|
|
515
|
-
return
|
|
735
|
+
return {
|
|
736
|
+
"pi_slider_position": self.pi_slider_position,
|
|
737
|
+
"si_slider_position": self.si_slider_position,
|
|
738
|
+
"use_custom_settings": self.use_si_settings,
|
|
739
|
+
"use_si_settings": self.use_si_settings,
|
|
740
|
+
"advanced_settings": self.advanced_settings.get_configurations(),
|
|
741
|
+
}
|
|
516
742
|
|
|
517
743
|
@property
|
|
518
|
-
def
|
|
519
|
-
"""
|
|
744
|
+
def advanced_settings(self):
|
|
745
|
+
"""SIwave advanced settings."""
|
|
746
|
+
return AdvancedSettings(self)
|
|
520
747
|
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
748
|
+
@property
|
|
749
|
+
def get_sim_setup_info(self):
|
|
750
|
+
"""Get simulation information from the setup."""
|
|
751
|
+
if self._sim_setup_info:
|
|
752
|
+
return self._sim_setup_info
|
|
753
|
+
|
|
754
|
+
edb_setup = self._edb_object
|
|
755
|
+
edb_sim_setup_info = self._pedb.simsetupdata.SimSetupInfo[self._setup_type_mapping[self._setup_type]]()
|
|
756
|
+
edb_sim_setup_info.Name = edb_setup.GetName()
|
|
757
|
+
|
|
758
|
+
string = edb_setup.ToString().replace("\t", "").split("\r\n")
|
|
759
|
+
|
|
760
|
+
if is_linux:
|
|
761
|
+
string = string[0].split("\n")
|
|
762
|
+
keys = [i.split("=")[0] for i in string if len(i.split("=")) == 2 and "SourceTermsToGround" not in i]
|
|
763
|
+
values = [i.split("=")[1] for i in string if len(i.split("=")) == 2 and "SourceTermsToGround" not in i]
|
|
764
|
+
for val in string:
|
|
765
|
+
if "SourceTermsToGround()" in val:
|
|
766
|
+
break
|
|
767
|
+
elif "SourceTermsToGround" in val:
|
|
768
|
+
sources = {}
|
|
769
|
+
val = val.replace("SourceTermsToGround(", "").replace(")", "").split(",")
|
|
770
|
+
for v in val:
|
|
771
|
+
source = v.split("=")
|
|
772
|
+
sources[source[0]] = int(source[1].replace("'", ""))
|
|
773
|
+
edb_sim_setup_info.SimulationSettings.DCIRSettings.SourceTermsToGround = convert_pydict_to_netdict(
|
|
774
|
+
sources
|
|
775
|
+
)
|
|
776
|
+
break
|
|
777
|
+
for k in keys:
|
|
778
|
+
value = _parse_value(values[keys.index(k)])
|
|
779
|
+
setter = None
|
|
780
|
+
if k in dir(edb_sim_setup_info.SimulationSettings):
|
|
781
|
+
setter = edb_sim_setup_info.SimulationSettings
|
|
782
|
+
elif k in dir(edb_sim_setup_info.SimulationSettings.AdvancedSettings):
|
|
783
|
+
setter = edb_sim_setup_info.SimulationSettings.AdvancedSettings
|
|
784
|
+
|
|
785
|
+
elif k in dir(edb_sim_setup_info.SimulationSettings.DCAdvancedSettings):
|
|
786
|
+
setter = edb_sim_setup_info.SimulationSettings.DCAdvancedSettings
|
|
787
|
+
elif "DCIRSettings" in dir(edb_sim_setup_info.SimulationSettings) and k in dir(
|
|
788
|
+
edb_sim_setup_info.SimulationSettings.DCIRSettings
|
|
789
|
+
):
|
|
790
|
+
setter = edb_sim_setup_info.SimulationSettings.DCIRSettings
|
|
791
|
+
elif k in dir(edb_sim_setup_info.SimulationSettings.DCSettings):
|
|
792
|
+
setter = edb_sim_setup_info.SimulationSettings.DCSettings
|
|
793
|
+
elif k in dir(edb_sim_setup_info.SimulationSettings.AdvancedSettings):
|
|
794
|
+
setter = edb_sim_setup_info.SimulationSettings.AdvancedSettings
|
|
795
|
+
if setter:
|
|
796
|
+
try:
|
|
797
|
+
setter.__setattr__(k, value)
|
|
798
|
+
except TypeError:
|
|
799
|
+
try:
|
|
800
|
+
setter.__setattr__(k, str(value))
|
|
801
|
+
except:
|
|
802
|
+
pass
|
|
803
|
+
|
|
804
|
+
return edb_sim_setup_info
|
|
805
|
+
|
|
806
|
+
def set_pi_slider(self, value):
|
|
807
|
+
"""Set SIwave PI simulation accuracy level.
|
|
808
|
+
Options are:
|
|
809
|
+
- ``0``: Optimal speed
|
|
810
|
+
- ``1``: Balanced
|
|
811
|
+
- ``2``: Optimal accuracy
|
|
812
|
+
|
|
813
|
+
.. deprecated:: 0.7.5
|
|
814
|
+
Use :property:`pi_slider_position` property instead.
|
|
815
|
+
|
|
816
|
+
"""
|
|
817
|
+
warnings.warn("`set_pi_slider` is deprecated. Use `pi_slider_position` property instead.", DeprecationWarning)
|
|
818
|
+
self.pi_slider_position = value
|
|
819
|
+
|
|
820
|
+
def set_si_slider(self, value):
|
|
821
|
+
"""Set SIwave SI simulation accuracy level.
|
|
822
|
+
|
|
823
|
+
Options are:
|
|
824
|
+
- ``0``: Optimal speed;
|
|
825
|
+
- ``1``: Balanced;
|
|
826
|
+
- ``2``: Optimal accuracy```.
|
|
525
827
|
"""
|
|
526
|
-
|
|
828
|
+
self.use_si_settings = True
|
|
829
|
+
self.use_custom_settings = False
|
|
830
|
+
self.si_slider_position = value
|
|
831
|
+
self.advanced_settings.set_si_slider(value)
|
|
832
|
+
|
|
833
|
+
@property
|
|
834
|
+
def pi_slider_position(self):
|
|
835
|
+
"""PI solider position. Values are from ``1`` to ``3``."""
|
|
836
|
+
return self.get_sim_setup_info.SimulationSettings.PISliderPos
|
|
837
|
+
|
|
838
|
+
@pi_slider_position.setter
|
|
839
|
+
def pi_slider_position(self, value):
|
|
840
|
+
edb_setup_info = self.get_sim_setup_info
|
|
841
|
+
edb_setup_info.SimulationSettings.PISliderPos = value
|
|
842
|
+
self._edb_object = self._set_edb_setup_info(edb_setup_info)
|
|
843
|
+
self._update_setup()
|
|
844
|
+
|
|
845
|
+
self.use_si_settings = False
|
|
846
|
+
self.use_custom_settings = False
|
|
847
|
+
self.advanced_settings.set_pi_slider(value)
|
|
527
848
|
|
|
528
849
|
@property
|
|
529
|
-
def
|
|
530
|
-
"""
|
|
850
|
+
def si_slider_position(self):
|
|
851
|
+
"""SI slider position. Values are from ``1`` to ``3``."""
|
|
852
|
+
return self.get_sim_setup_info.SimulationSettings.SISliderPos
|
|
853
|
+
|
|
854
|
+
@si_slider_position.setter
|
|
855
|
+
def si_slider_position(self, value):
|
|
856
|
+
edb_setup_info = self.get_sim_setup_info
|
|
857
|
+
edb_setup_info.SimulationSettings.SISliderPos = value
|
|
858
|
+
self._edb_object = self._set_edb_setup_info(edb_setup_info)
|
|
859
|
+
self._update_setup()
|
|
860
|
+
|
|
861
|
+
self.use_si_settings = True
|
|
862
|
+
self.use_custom_settings = False
|
|
863
|
+
self.advanced_settings.set_si_slider(value)
|
|
864
|
+
|
|
865
|
+
@property
|
|
866
|
+
def use_custom_settings(self):
|
|
867
|
+
"""Custom settings to use.
|
|
531
868
|
|
|
532
869
|
Returns
|
|
533
870
|
-------
|
|
534
871
|
bool
|
|
535
|
-
``True`` if save radiated field only is used, ``False`` otherwise.
|
|
536
872
|
"""
|
|
537
|
-
return self.
|
|
873
|
+
return self.get_sim_setup_info.SimulationSettings.UseCustomSettings
|
|
874
|
+
|
|
875
|
+
@use_custom_settings.setter
|
|
876
|
+
def use_custom_settings(self, value):
|
|
877
|
+
edb_setup_info = self.get_sim_setup_info
|
|
878
|
+
edb_setup_info.SimulationSettings.UseCustomSettings = value
|
|
879
|
+
self._edb_object = self._set_edb_setup_info(edb_setup_info)
|
|
880
|
+
self._update_setup()
|
|
538
881
|
|
|
539
882
|
@property
|
|
540
|
-
def
|
|
541
|
-
"""
|
|
883
|
+
def use_si_settings(self):
|
|
884
|
+
"""Whether to use SI Settings.
|
|
542
885
|
|
|
543
886
|
Returns
|
|
544
887
|
-------
|
|
545
888
|
bool
|
|
546
|
-
``True`` if Q3d for DC point is used, ``False`` otherwise.
|
|
547
889
|
"""
|
|
548
|
-
return self.
|
|
549
|
-
|
|
550
|
-
@adaptive_sampling.setter
|
|
551
|
-
def adaptive_sampling(self, value):
|
|
552
|
-
self._edb_sweep_data.AdaptiveSampling = value
|
|
553
|
-
self._update_sweep()
|
|
554
|
-
|
|
555
|
-
@adv_dc_extrapolation.setter
|
|
556
|
-
def adv_dc_extrapolation(self, value):
|
|
557
|
-
self._edb_sweep_data.AdvDCExtrapolation = value
|
|
558
|
-
self._update_sweep()
|
|
559
|
-
|
|
560
|
-
@auto_s_mat_only_solve.setter
|
|
561
|
-
def auto_s_mat_only_solve(self, value):
|
|
562
|
-
self._edb_sweep_data.AutoSMatOnlySolve = value
|
|
563
|
-
self._update_sweep()
|
|
564
|
-
|
|
565
|
-
@enforce_causality.setter
|
|
566
|
-
def enforce_causality(self, value):
|
|
567
|
-
self._edb_sweep_data.EnforceCausality = value
|
|
568
|
-
self._update_sweep()
|
|
569
|
-
|
|
570
|
-
@enforce_dc_and_causality.setter
|
|
571
|
-
def enforce_dc_and_causality(self, value):
|
|
572
|
-
self._edb_sweep_data.EnforceDCAndCausality = value
|
|
573
|
-
self._update_sweep()
|
|
574
|
-
|
|
575
|
-
@enforce_passivity.setter
|
|
576
|
-
def enforce_passivity(self, value):
|
|
577
|
-
self._edb_sweep_data.EnforcePassivity = value
|
|
578
|
-
self._update_sweep()
|
|
579
|
-
|
|
580
|
-
@freq_sweep_type.setter
|
|
581
|
-
def freq_sweep_type(self, value):
|
|
582
|
-
edb_freq_sweep_type = self._edb_sweep_data.TFreqSweepType
|
|
583
|
-
if value in [0, "kInterpolatingSweep"]:
|
|
584
|
-
self._edb_sweep_data.FreqSweepType = edb_freq_sweep_type.kInterpolatingSweep
|
|
585
|
-
elif value in [1, "kDiscreteSweep"]:
|
|
586
|
-
self._edb_sweep_data.FreqSweepType = edb_freq_sweep_type.kDiscreteSweep
|
|
587
|
-
elif value in [2, "kBroadbandFastSweep"]:
|
|
588
|
-
self._edb_sweep_data.FreqSweepType = edb_freq_sweep_type.kBroadbandFastSweep
|
|
589
|
-
elif value in [3, "kNumSweepTypes"]:
|
|
590
|
-
self._edb_sweep_data.FreqSweepType = edb_freq_sweep_type.kNumSweepTypes
|
|
591
|
-
self._edb_sweep_data.FreqSweepType.ToString()
|
|
592
|
-
|
|
593
|
-
@interpolation_use_full_basis.setter
|
|
594
|
-
def interpolation_use_full_basis(self, value):
|
|
595
|
-
self._edb_sweep_data.InterpUseFullBasis = value
|
|
596
|
-
self._update_sweep()
|
|
597
|
-
|
|
598
|
-
@interpolation_use_port_impedance.setter
|
|
599
|
-
def interpolation_use_port_impedance(self, value):
|
|
600
|
-
self._edb_sweep_data.InterpUsePortImpedance = value
|
|
601
|
-
self._update_sweep()
|
|
602
|
-
|
|
603
|
-
@interpolation_use_prop_const.setter
|
|
604
|
-
def interpolation_use_prop_const(self, value):
|
|
605
|
-
self._edb_sweep_data.InterpUsePropConst = value
|
|
606
|
-
self._update_sweep()
|
|
607
|
-
|
|
608
|
-
@interpolation_use_s_matrix.setter
|
|
609
|
-
def interpolation_use_s_matrix(self, value):
|
|
610
|
-
self._edb_sweep_data.InterpUseSMatrix = value
|
|
611
|
-
self._update_sweep()
|
|
612
|
-
|
|
613
|
-
@max_solutions.setter
|
|
614
|
-
def max_solutions(self, value):
|
|
615
|
-
self._edb_sweep_data.MaxSolutions = value
|
|
616
|
-
self._update_sweep()
|
|
617
|
-
|
|
618
|
-
@min_freq_s_mat_only_solve.setter
|
|
619
|
-
def min_freq_s_mat_only_solve(self, value):
|
|
620
|
-
self._edb_sweep_data.MinFreqSMatOnlySolve = value
|
|
621
|
-
self._update_sweep()
|
|
622
|
-
|
|
623
|
-
@min_solved_freq.setter
|
|
624
|
-
def min_solved_freq(self, value):
|
|
625
|
-
self._edb_sweep_data.MinSolvedFreq = value
|
|
626
|
-
self._update_sweep()
|
|
627
|
-
|
|
628
|
-
@passivity_tolerance.setter
|
|
629
|
-
def passivity_tolerance(self, value):
|
|
630
|
-
self._edb_sweep_data.PassivityTolerance = value
|
|
631
|
-
self._update_sweep()
|
|
632
|
-
|
|
633
|
-
@relative_s_error.setter
|
|
634
|
-
def relative_s_error(self, value):
|
|
635
|
-
self._edb_sweep_data.RelativeSError = value
|
|
636
|
-
self._update_sweep()
|
|
637
|
-
|
|
638
|
-
@save_fields.setter
|
|
639
|
-
def save_fields(self, value):
|
|
640
|
-
self._edb_sweep_data.SaveFields = value
|
|
641
|
-
self._update_sweep()
|
|
642
|
-
|
|
643
|
-
@save_rad_fields_only.setter
|
|
644
|
-
def save_rad_fields_only(self, value):
|
|
645
|
-
self._edb_sweep_data.SaveRadFieldsOnly = value
|
|
646
|
-
self._update_sweep()
|
|
647
|
-
|
|
648
|
-
@use_q3d_for_dc.setter
|
|
649
|
-
def use_q3d_for_dc(self, value):
|
|
650
|
-
self._edb_sweep_data.UseQ3DForDC = value
|
|
651
|
-
self._update_sweep()
|
|
652
|
-
|
|
653
|
-
@pyedb_function_handler()
|
|
654
|
-
def _set_frequencies(self, freq_sweep_string="Linear Step: 0GHz to 20GHz, step=0.05GHz"):
|
|
655
|
-
self._edb_sweep_data.SetFrequencies(freq_sweep_string)
|
|
656
|
-
self._update_sweep()
|
|
657
|
-
|
|
658
|
-
@pyedb_function_handler()
|
|
659
|
-
def set_frequencies_linear_scale(self, start="0.1GHz", stop="20GHz", step="50MHz"):
|
|
660
|
-
"""Set a linear scale frequency sweep.
|
|
890
|
+
return self.get_sim_setup_info.SimulationSettings.UseSISettings
|
|
661
891
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
892
|
+
@use_si_settings.setter
|
|
893
|
+
def use_si_settings(self, value):
|
|
894
|
+
edb_setup_info = self.get_sim_setup_info
|
|
895
|
+
edb_setup_info.SimulationSettings.UseSISettings = value
|
|
896
|
+
self._edb_object = self._set_edb_setup_info(edb_setup_info)
|
|
897
|
+
self._update_setup()
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
class SiwaveDCSimulationSetup(SiwaveSYZSimulationSetup):
|
|
901
|
+
"""Manages EDB methods for SIwave DC simulation setup.
|
|
902
|
+
|
|
903
|
+
Parameters
|
|
904
|
+
----------
|
|
905
|
+
pedb : :class:`pyedb.dotnet.edb.Edb`
|
|
906
|
+
Inherited AEDT object.
|
|
907
|
+
edb_setup : Ansys.Ansoft.Edb.Utility.SIWDCIRSimulationSettings
|
|
908
|
+
EDB object. The default is ``None``.
|
|
909
|
+
"""
|
|
910
|
+
|
|
911
|
+
def __init__(self, pedb, edb_object=None):
|
|
912
|
+
super().__init__(pedb, edb_object)
|
|
913
|
+
self._setup_type = "kSIwaveDCIR"
|
|
914
|
+
self._edb = pedb
|
|
915
|
+
self._mesh_operations = {}
|
|
916
|
+
|
|
917
|
+
def create(self, name=None):
|
|
918
|
+
"""Create a SIwave DCIR setup.
|
|
670
919
|
|
|
671
920
|
Returns
|
|
672
921
|
-------
|
|
673
|
-
|
|
674
|
-
``True`` if correctly executed, ``False`` otherwise.
|
|
922
|
+
:class:`SiwaveDCSimulationSetup`
|
|
675
923
|
"""
|
|
676
|
-
self.
|
|
677
|
-
|
|
924
|
+
self._name = name
|
|
925
|
+
self._create(name)
|
|
926
|
+
self.set_dc_slider(1)
|
|
927
|
+
return self
|
|
678
928
|
|
|
679
|
-
@
|
|
680
|
-
def
|
|
681
|
-
"""
|
|
929
|
+
@property
|
|
930
|
+
def dc_ir_settings(self):
|
|
931
|
+
"""DC IR settings."""
|
|
932
|
+
return SiwaveDCIRSettings(self)
|
|
682
933
|
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
start : str, float, optional
|
|
686
|
-
Start frequency. The default is ``"1kHz"``.
|
|
687
|
-
stop : str, float, optional
|
|
688
|
-
Stop frequency. The default is ``"0.1GHz"``.
|
|
689
|
-
count : int, optional
|
|
690
|
-
Step frequency. The default is ``10``.
|
|
934
|
+
def get_configurations(self):
|
|
935
|
+
"""Get SIwave DC simulation settings.
|
|
691
936
|
|
|
692
937
|
Returns
|
|
693
938
|
-------
|
|
694
|
-
|
|
695
|
-
|
|
939
|
+
dict
|
|
940
|
+
Dictionary of SIwave DC simulation settings.
|
|
696
941
|
"""
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
942
|
+
return {
|
|
943
|
+
"dc_settings": self.dc_settings.get_configurations(),
|
|
944
|
+
"dc_advanced_settings": self.dc_advanced_settings.get_configurations(),
|
|
945
|
+
}
|
|
701
946
|
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
"""Set a log-count frequency sweep.
|
|
947
|
+
def set_dc_slider(self, value):
|
|
948
|
+
"""Set DC simulation accuracy level.
|
|
705
949
|
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
950
|
+
Options are:
|
|
951
|
+
|
|
952
|
+
- ``0``: Optimal speed
|
|
953
|
+
- ``1``: Balanced
|
|
954
|
+
- ``2``: Optimal accuracy
|
|
955
|
+
"""
|
|
956
|
+
self.use_custom_settings = False
|
|
957
|
+
self.dc_settings.dc_slider_position = value
|
|
958
|
+
self.dc_advanced_settings.set_dc_slider(value)
|
|
959
|
+
|
|
960
|
+
@property
|
|
961
|
+
def dc_settings(self):
|
|
962
|
+
"""SIwave DC setting."""
|
|
963
|
+
return DCSettings(self)
|
|
964
|
+
|
|
965
|
+
@property
|
|
966
|
+
def dc_advanced_settings(self):
|
|
967
|
+
"""Siwave DC advanced settings.
|
|
714
968
|
|
|
715
969
|
Returns
|
|
716
970
|
-------
|
|
717
|
-
|
|
718
|
-
``True`` if correctly executed, ``False`` otherwise.
|
|
971
|
+
:class:`pyedb.dotnet.edb_core.edb_data.siwave_simulation_setup_data.SiwaveDCAdvancedSettings`
|
|
719
972
|
"""
|
|
720
|
-
|
|
721
|
-
stop = self._sim_setup._pedb.arg_to_dim(stop, "Hz")
|
|
722
|
-
self._edb_sweep_data.Frequencies = self._edb_sweep_data.SetLogFrequencies(start, stop, samples)
|
|
723
|
-
return self._update_sweep()
|
|
973
|
+
return DCAdvancedSettings(self)
|
|
724
974
|
|
|
725
|
-
@
|
|
726
|
-
def
|
|
727
|
-
"""
|
|
975
|
+
@property
|
|
976
|
+
def source_terms_to_ground(self):
|
|
977
|
+
"""Dictionary of grounded terminals.
|
|
978
|
+
|
|
979
|
+
Returns
|
|
980
|
+
-------
|
|
981
|
+
Dictionary
|
|
982
|
+
{str, int}, keys is source name, value int 0 unspecified, 1 negative node, 2 positive one.
|
|
983
|
+
|
|
984
|
+
"""
|
|
985
|
+
return convert_netdict_to_pydict(self.get_sim_setup_info.SimulationSettings.DCIRSettings.SourceTermsToGround)
|
|
986
|
+
|
|
987
|
+
def add_source_terminal_to_ground(self, source_name, terminal=0):
|
|
988
|
+
"""Add a source terminal to ground.
|
|
728
989
|
|
|
729
990
|
Parameters
|
|
730
991
|
----------
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
992
|
+
source_name : str,
|
|
993
|
+
Source name.
|
|
994
|
+
terminal : int, optional
|
|
995
|
+
Terminal to assign. Options are:
|
|
996
|
+
|
|
997
|
+
- 0=Unspecified
|
|
998
|
+
- 1=Negative node
|
|
999
|
+
- 2=Positive none
|
|
1000
|
+
|
|
737
1001
|
Returns
|
|
738
1002
|
-------
|
|
739
1003
|
bool
|
|
740
|
-
|
|
1004
|
+
|
|
741
1005
|
"""
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
temp = []
|
|
749
|
-
if isinstance(frequency_list, list) and not isinstance(frequency_list[0], list):
|
|
750
|
-
frequency_list = [frequency_list]
|
|
751
|
-
for i in frequency_list:
|
|
752
|
-
if i[0] == "linear count":
|
|
753
|
-
temp.extend(list(self._edb_sweep_data.SetFrequencies(i[1], i[2], i[3])))
|
|
754
|
-
elif i[0] == "linear scale":
|
|
755
|
-
temp.extend(list(self._edb_sweep_data.SetFrequencies(i[1], i[2], i[3])))
|
|
756
|
-
elif i[0] == "log scale":
|
|
757
|
-
temp.extend(list(self._edb_sweep_data.SetLogFrequencies(i[1], i[2], i[3])))
|
|
758
|
-
else:
|
|
759
|
-
return False
|
|
760
|
-
self._edb_sweep_data.Frequencies.Clear()
|
|
761
|
-
for i in temp:
|
|
762
|
-
self._edb_sweep_data.Frequencies.Add(i)
|
|
763
|
-
if update:
|
|
764
|
-
return self._update_sweep()
|
|
1006
|
+
terminals = self.source_terms_to_ground
|
|
1007
|
+
terminals[source_name] = terminal
|
|
1008
|
+
self.get_sim_setup_info.SimulationSettings.DCIRSettings.SourceTermsToGround = convert_pydict_to_netdict(
|
|
1009
|
+
terminals
|
|
1010
|
+
)
|
|
1011
|
+
return self._update_setup()
|