pyedb 0.13.dev0__py3-none-any.whl → 0.14.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/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 +612 -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 +1 -16
- {pyedb-0.13.dev0.dist-info → pyedb-0.14.0.dist-info}/METADATA +2 -2
- {pyedb-0.13.dev0.dist-info → pyedb-0.14.0.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.0.dist-info}/LICENSE +0 -0
- {pyedb-0.13.dev0.dist-info → pyedb-0.14.0.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
|
|
@@ -118,7 +171,6 @@ class BaseSimulationSetup(object):
|
|
|
118
171
|
setup_utility = setup_type_mapping[self._setup_type]
|
|
119
172
|
return setup_utility(edb_setup_info)
|
|
120
173
|
|
|
121
|
-
@pyedb_function_handler()
|
|
122
174
|
def _update_setup(self):
|
|
123
175
|
"""Update setup in EDB."""
|
|
124
176
|
if self._setup_type == "kHFSS":
|
|
@@ -185,16 +237,15 @@ class BaseSimulationSetup(object):
|
|
|
185
237
|
else:
|
|
186
238
|
sweep_data_list = self.get_sim_setup_info.SweepDataList
|
|
187
239
|
for i in list(sweep_data_list):
|
|
188
|
-
temp[i.Name] =
|
|
240
|
+
temp[i.Name] = SweepData(self, None, i.Name, i)
|
|
189
241
|
return temp
|
|
190
242
|
|
|
191
|
-
@pyedb_function_handler
|
|
192
243
|
def _add_frequency_sweep(self, sweep_data):
|
|
193
244
|
"""Add a frequency sweep.
|
|
194
245
|
|
|
195
246
|
Parameters
|
|
196
247
|
----------
|
|
197
|
-
sweep_data:
|
|
248
|
+
sweep_data: SweepData
|
|
198
249
|
"""
|
|
199
250
|
self._sweep_list[sweep_data.name] = sweep_data
|
|
200
251
|
if self.setup_type in ["kRaptorX", "kHFSSPI"]:
|
|
@@ -209,7 +260,6 @@ class BaseSimulationSetup(object):
|
|
|
209
260
|
self._edb_object = self._set_edb_setup_info(edb_setup_info)
|
|
210
261
|
self._update_setup()
|
|
211
262
|
|
|
212
|
-
@pyedb_function_handler
|
|
213
263
|
def delete_frequency_sweep(self, sweep_data):
|
|
214
264
|
"""Delete a frequency sweep.
|
|
215
265
|
|
|
@@ -230,7 +280,6 @@ class BaseSimulationSetup(object):
|
|
|
230
280
|
self._update_setup()
|
|
231
281
|
return True if name in self.frequency_sweeps else False
|
|
232
282
|
|
|
233
|
-
@pyedb_function_handler()
|
|
234
283
|
def add_frequency_sweep(self, name=None, frequency_sweep=None):
|
|
235
284
|
"""Add frequency sweep.
|
|
236
285
|
|
|
@@ -264,501 +313,698 @@ class BaseSimulationSetup(object):
|
|
|
264
313
|
|
|
265
314
|
if not name:
|
|
266
315
|
name = generate_unique_name("sweep")
|
|
267
|
-
sweep =
|
|
316
|
+
sweep = SweepData(self, frequency_sweep, name)
|
|
268
317
|
self._add_frequency_sweep(sweep)
|
|
269
318
|
self._update_setup()
|
|
270
319
|
return sweep
|
|
271
320
|
|
|
272
321
|
|
|
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
|
-
"""
|
|
322
|
+
class HfssSimulationSetup(SimulationSetup):
|
|
323
|
+
"""Manages EDB methods for HFSS simulation setup."""
|
|
284
324
|
|
|
285
|
-
def __init__(self,
|
|
286
|
-
|
|
325
|
+
def __init__(self, pedb, edb_object=None):
|
|
326
|
+
super().__init__(pedb, edb_object)
|
|
327
|
+
self._setup_type = "kHFSS"
|
|
328
|
+
self._mesh_operations = {}
|
|
287
329
|
|
|
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)
|
|
330
|
+
def create(self, name=None):
|
|
331
|
+
"""Create an HFSS setup."""
|
|
332
|
+
self._name = name
|
|
333
|
+
self._create(name)
|
|
334
|
+
return self
|
|
298
335
|
|
|
299
336
|
@property
|
|
300
|
-
def
|
|
301
|
-
|
|
337
|
+
def get_sim_setup_info(self):
|
|
338
|
+
"""Get simulation setup information."""
|
|
339
|
+
return self._edb_object.GetSimSetupInfo()
|
|
302
340
|
|
|
303
341
|
@property
|
|
304
|
-
def
|
|
305
|
-
"""
|
|
306
|
-
|
|
342
|
+
def solver_slider_type(self):
|
|
343
|
+
"""Solver slider type.
|
|
344
|
+
Options are:
|
|
345
|
+
1 - ``kFast``.
|
|
346
|
+
2 - ``kMedium``.
|
|
347
|
+
3 - ``kAccurate``.
|
|
348
|
+
4 - ``kNumSliderTypes``.
|
|
307
349
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
self.
|
|
313
|
-
|
|
350
|
+
Returns
|
|
351
|
+
-------
|
|
352
|
+
str
|
|
353
|
+
"""
|
|
354
|
+
return self.get_sim_setup_info.SimulationSettings.TSolveSliderType.ToString()
|
|
355
|
+
|
|
356
|
+
@solver_slider_type.setter
|
|
357
|
+
def solver_slider_type(self, value):
|
|
358
|
+
"""Set solver slider type."""
|
|
359
|
+
solver_types = {
|
|
360
|
+
"kFast": self.get_sim_setup_info.SimulationSettings.TSolveSliderType.k25DViaWirebond,
|
|
361
|
+
"kMedium": self.get_sim_setup_info.SimulationSettings.TSolveSliderType.k25DViaRibbon,
|
|
362
|
+
"kAccurate": self.get_sim_setup_info.SimulationSettings.TSolveSliderType.k25DViaMesh,
|
|
363
|
+
"kNumSliderTypes": self.get_sim_setup_info.SimulationSettings.TSolveSliderType.k25DViaField,
|
|
364
|
+
}
|
|
365
|
+
self.get_sim_setup_info.SimulationSettings.TSolveSliderType = solver_types[value]
|
|
366
|
+
self._update_setup()
|
|
314
367
|
|
|
315
368
|
@property
|
|
316
|
-
def
|
|
317
|
-
"""
|
|
318
|
-
return self.
|
|
369
|
+
def is_auto_setup(self):
|
|
370
|
+
"""Flag indicating if automatic setup is enabled."""
|
|
371
|
+
return self.get_sim_setup_info.SimulationSettings.IsAutoSetup
|
|
319
372
|
|
|
320
|
-
@
|
|
321
|
-
def
|
|
322
|
-
self.
|
|
323
|
-
self.
|
|
373
|
+
@is_auto_setup.setter
|
|
374
|
+
def is_auto_setup(self, value):
|
|
375
|
+
self.get_sim_setup_info.SimulationSettings.IsAutoSetup = value
|
|
376
|
+
self._update_setup()
|
|
324
377
|
|
|
325
378
|
@property
|
|
326
|
-
def
|
|
327
|
-
"""
|
|
328
|
-
return
|
|
379
|
+
def hfss_solver_settings(self):
|
|
380
|
+
"""Manages EDB methods for HFSS solver settings.
|
|
329
381
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
382
|
+
Returns
|
|
383
|
+
-------
|
|
384
|
+
:class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.HfssSolverSettings`
|
|
385
|
+
|
|
386
|
+
"""
|
|
387
|
+
return HfssSolverSettings(self)
|
|
334
388
|
|
|
335
389
|
@property
|
|
336
|
-
def
|
|
337
|
-
"""
|
|
390
|
+
def adaptive_settings(self):
|
|
391
|
+
"""Adaptive Settings Class.
|
|
338
392
|
|
|
339
393
|
Returns
|
|
340
394
|
-------
|
|
341
|
-
|
|
342
|
-
|
|
395
|
+
:class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.AdaptiveSettings`
|
|
396
|
+
|
|
343
397
|
"""
|
|
344
|
-
return self
|
|
398
|
+
return AdaptiveSettings(self)
|
|
345
399
|
|
|
346
400
|
@property
|
|
347
|
-
def
|
|
348
|
-
"""
|
|
401
|
+
def defeature_settings(self):
|
|
402
|
+
"""Defeature settings Class.
|
|
349
403
|
|
|
350
404
|
Returns
|
|
351
405
|
-------
|
|
352
|
-
|
|
353
|
-
|
|
406
|
+
:class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.DefeatureSettings`
|
|
407
|
+
|
|
354
408
|
"""
|
|
355
|
-
return self
|
|
409
|
+
return DefeatureSettings(self)
|
|
356
410
|
|
|
357
411
|
@property
|
|
358
|
-
def
|
|
359
|
-
"""
|
|
360
|
-
return self._edb_sweep_data.ComputeDCPoint
|
|
412
|
+
def via_settings(self):
|
|
413
|
+
"""Via settings Class.
|
|
361
414
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
self._update_sweep()
|
|
415
|
+
Returns
|
|
416
|
+
-------
|
|
417
|
+
:class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.ViaSettings`
|
|
366
418
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
"""Flag indicating if Auto SMatrix only solve is turned on."""
|
|
370
|
-
return self._edb_sweep_data.AutoSMatOnlySolve
|
|
419
|
+
"""
|
|
420
|
+
return ViaSettings(self)
|
|
371
421
|
|
|
372
422
|
@property
|
|
373
|
-
def
|
|
374
|
-
"""
|
|
423
|
+
def advanced_mesh_settings(self):
|
|
424
|
+
"""Advanced mesh settings Class.
|
|
375
425
|
|
|
376
426
|
Returns
|
|
377
427
|
-------
|
|
378
|
-
|
|
379
|
-
|
|
428
|
+
:class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.AdvancedMeshSettings`
|
|
429
|
+
|
|
380
430
|
"""
|
|
381
|
-
return self
|
|
431
|
+
return AdvancedMeshSettings(self)
|
|
382
432
|
|
|
383
433
|
@property
|
|
384
|
-
def
|
|
385
|
-
"""
|
|
434
|
+
def curve_approx_settings(self):
|
|
435
|
+
"""Curve approximation settings Class.
|
|
386
436
|
|
|
387
437
|
Returns
|
|
388
438
|
-------
|
|
389
|
-
|
|
390
|
-
|
|
439
|
+
:class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.CurveApproxSettings`
|
|
440
|
+
|
|
391
441
|
"""
|
|
392
|
-
return self
|
|
442
|
+
return CurveApproxSettings(self)
|
|
393
443
|
|
|
394
444
|
@property
|
|
395
|
-
def
|
|
396
|
-
"""
|
|
445
|
+
def dcr_settings(self):
|
|
446
|
+
"""Dcr settings Class.
|
|
397
447
|
|
|
398
448
|
Returns
|
|
399
449
|
-------
|
|
400
|
-
|
|
401
|
-
|
|
450
|
+
:class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.DcrSettings`
|
|
451
|
+
|
|
402
452
|
"""
|
|
403
|
-
return self
|
|
453
|
+
return DcrSettings(self)
|
|
404
454
|
|
|
405
455
|
@property
|
|
406
|
-
def
|
|
407
|
-
"""
|
|
408
|
-
|
|
409
|
-
Options are:
|
|
410
|
-
- ``"kInterpolatingSweep"``
|
|
411
|
-
- ``"kDiscreteSweep"``
|
|
412
|
-
- ``"kBroadbandFastSweep"``
|
|
456
|
+
def hfss_port_settings(self):
|
|
457
|
+
"""HFSS port settings Class.
|
|
413
458
|
|
|
414
459
|
Returns
|
|
415
460
|
-------
|
|
416
|
-
|
|
417
|
-
|
|
461
|
+
:class:`pyedb.dotnet.edb_core.edb_data.hfss_simulation_setup_data.HfssPortSettings`
|
|
462
|
+
|
|
418
463
|
"""
|
|
419
|
-
return self
|
|
464
|
+
return HfssPortSettings(self)
|
|
420
465
|
|
|
421
466
|
@property
|
|
422
|
-
def
|
|
423
|
-
"""
|
|
467
|
+
def mesh_operations(self):
|
|
468
|
+
"""Mesh operations settings Class.
|
|
424
469
|
|
|
425
470
|
Returns
|
|
426
471
|
-------
|
|
427
|
-
|
|
428
|
-
|
|
472
|
+
List of :class:`dotnet.edb_core.edb_data.hfss_simulation_setup_data.MeshOperation`
|
|
473
|
+
|
|
429
474
|
"""
|
|
430
|
-
|
|
475
|
+
if self._mesh_operations:
|
|
476
|
+
return self._mesh_operations
|
|
477
|
+
settings = self.get_sim_setup_info.SimulationSettings.MeshOperations
|
|
478
|
+
self._mesh_operations = {}
|
|
479
|
+
for i in list(settings):
|
|
480
|
+
if i.MeshOpType == i.TMeshOpType.kMeshSetupLength:
|
|
481
|
+
self._mesh_operations[i.Name] = MeshOperationLength(self, i)
|
|
482
|
+
elif i.MeshOpType == i.TMeshOpType.kMeshSetupSkinDepth:
|
|
483
|
+
self._mesh_operations[i.Name] = MeshOperationSkinDepth(self, i)
|
|
484
|
+
elif i.MeshOpType == i.TMeshOpType.kMeshSetupBase:
|
|
485
|
+
self._mesh_operations[i.Name] = MeshOperationSkinDepth(self, i)
|
|
486
|
+
|
|
487
|
+
return self._mesh_operations
|
|
488
|
+
|
|
489
|
+
def add_length_mesh_operation(
|
|
490
|
+
self,
|
|
491
|
+
net_layer_list,
|
|
492
|
+
name=None,
|
|
493
|
+
max_elements=1000,
|
|
494
|
+
max_length="1mm",
|
|
495
|
+
restrict_elements=True,
|
|
496
|
+
restrict_length=True,
|
|
497
|
+
refine_inside=False,
|
|
498
|
+
mesh_region=None,
|
|
499
|
+
):
|
|
500
|
+
"""Add a mesh operation to the setup.
|
|
431
501
|
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
502
|
+
Parameters
|
|
503
|
+
----------
|
|
504
|
+
net_layer_list : dict
|
|
505
|
+
Dictionary containing nets and layers on which enable Mesh operation. Example ``{"A0_N": ["TOP", "PWR"]}``.
|
|
506
|
+
name : str, optional
|
|
507
|
+
Mesh operation name.
|
|
508
|
+
max_elements : int, optional
|
|
509
|
+
Maximum number of elements. Default is ``1000``.
|
|
510
|
+
max_length : str, optional
|
|
511
|
+
Maximum length of elements. Default is ``1mm``.
|
|
512
|
+
restrict_elements : bool, optional
|
|
513
|
+
Whether to restrict number of elements. Default is ``True``.
|
|
514
|
+
restrict_length : bool, optional
|
|
515
|
+
Whether to restrict length of elements. Default is ``True``.
|
|
516
|
+
mesh_region : str, optional
|
|
517
|
+
Mesh region name.
|
|
518
|
+
refine_inside : bool, optional
|
|
519
|
+
Whether to refine inside or not. Default is ``False``.
|
|
435
520
|
|
|
436
521
|
Returns
|
|
437
522
|
-------
|
|
438
|
-
|
|
439
|
-
``True`` if port impedance is used, ``False`` otherwise.
|
|
523
|
+
:class:`dotnet.edb_core.edb_data.hfss_simulation_setup_data.LengthMeshOperation`
|
|
440
524
|
"""
|
|
441
|
-
|
|
525
|
+
if not name:
|
|
526
|
+
name = generate_unique_name("skin")
|
|
527
|
+
mesh_operation = MeshOperationLength(self, self._pedb.simsetupdata.LengthMeshOperation())
|
|
528
|
+
mesh_operation.mesh_region = mesh_region
|
|
529
|
+
mesh_operation.name = name
|
|
530
|
+
mesh_operation.nets_layers_list = net_layer_list
|
|
531
|
+
mesh_operation.refine_inside = refine_inside
|
|
532
|
+
mesh_operation.max_elements = str(max_elements)
|
|
533
|
+
mesh_operation.max_length = max_length
|
|
534
|
+
mesh_operation.restrict_length = restrict_length
|
|
535
|
+
mesh_operation.restrict_max_elements = restrict_elements
|
|
536
|
+
self.mesh_operations[name] = mesh_operation
|
|
537
|
+
return mesh_operation if self._update_setup() else False
|
|
538
|
+
|
|
539
|
+
def add_skin_depth_mesh_operation(
|
|
540
|
+
self,
|
|
541
|
+
net_layer_list,
|
|
542
|
+
name=None,
|
|
543
|
+
max_elements=1000,
|
|
544
|
+
skin_depth="1um",
|
|
545
|
+
restrict_elements=True,
|
|
546
|
+
surface_triangle_length="1mm",
|
|
547
|
+
number_of_layers=2,
|
|
548
|
+
refine_inside=False,
|
|
549
|
+
mesh_region=None,
|
|
550
|
+
):
|
|
551
|
+
"""Add a mesh operation to the setup.
|
|
442
552
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
553
|
+
Parameters
|
|
554
|
+
----------
|
|
555
|
+
net_layer_list : dict
|
|
556
|
+
Dictionary containing nets and layers on which enable Mesh operation. Example ``{"A0_N": ["TOP", "PWR"]}``.
|
|
557
|
+
name : str, optional
|
|
558
|
+
Mesh operation name.
|
|
559
|
+
max_elements : int, optional
|
|
560
|
+
Maximum number of elements. Default is ``1000``.
|
|
561
|
+
skin_depth : str, optional
|
|
562
|
+
Skin Depth. Default is ``1um``.
|
|
563
|
+
restrict_elements : bool, optional
|
|
564
|
+
Whether to restrict number of elements. Default is ``True``.
|
|
565
|
+
surface_triangle_length : bool, optional
|
|
566
|
+
Surface Triangle length. Default is ``1mm``.
|
|
567
|
+
number_of_layers : int, str, optional
|
|
568
|
+
Number of layers. Default is ``2``.
|
|
569
|
+
mesh_region : str, optional
|
|
570
|
+
Mesh region name.
|
|
571
|
+
refine_inside : bool, optional
|
|
572
|
+
Whether to refine inside or not. Default is ``False``.
|
|
446
573
|
|
|
447
574
|
Returns
|
|
448
575
|
-------
|
|
449
|
-
|
|
450
|
-
``True`` if propagation constants are used, ``False`` otherwise.
|
|
576
|
+
:class:`dotnet.edb_core.edb_data.hfss_simulation_setup_data.LengthMeshOperation`
|
|
451
577
|
"""
|
|
452
|
-
|
|
578
|
+
if not name:
|
|
579
|
+
name = generate_unique_name("length")
|
|
580
|
+
mesh_operation = MeshOperationSkinDepth(self, self._pedb.simsetupdata.SkinDepthMeshOperation())
|
|
581
|
+
mesh_operation.mesh_region = mesh_region
|
|
582
|
+
mesh_operation.name = name
|
|
583
|
+
mesh_operation.nets_layers_list = net_layer_list
|
|
584
|
+
mesh_operation.refine_inside = refine_inside
|
|
585
|
+
mesh_operation.max_elements = max_elements
|
|
586
|
+
mesh_operation.skin_depth = skin_depth
|
|
587
|
+
mesh_operation.number_of_layer_elements = number_of_layers
|
|
588
|
+
mesh_operation.surface_triangle_length = surface_triangle_length
|
|
589
|
+
mesh_operation.restrict_max_elements = restrict_elements
|
|
590
|
+
self.mesh_operations[name] = mesh_operation
|
|
591
|
+
return mesh_operation if self._update_setup() else False
|
|
453
592
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
593
|
+
def add_frequency_sweep(self, name=None, frequency_sweep=None):
|
|
594
|
+
"""Add frequency sweep.
|
|
595
|
+
|
|
596
|
+
Parameters
|
|
597
|
+
----------
|
|
598
|
+
name : str, optional
|
|
599
|
+
Name of the frequency sweep.
|
|
600
|
+
frequency_sweep : list, optional
|
|
601
|
+
List of frequency points.
|
|
457
602
|
|
|
458
603
|
Returns
|
|
459
604
|
-------
|
|
460
|
-
|
|
461
|
-
|
|
605
|
+
:class:`pyedb.dotnet.edb_core.edb_data.simulation_setup.EdbFrequencySweep`
|
|
606
|
+
|
|
607
|
+
Examples
|
|
608
|
+
--------
|
|
609
|
+
>>> setup1 = edbapp.create_hfss_setup("setup1")
|
|
610
|
+
>>> setup1.add_frequency_sweep(frequency_sweep=[
|
|
611
|
+
... ["linear count", "0", "1kHz", 1],
|
|
612
|
+
... ["log scale", "1kHz", "0.1GHz", 10],
|
|
613
|
+
... ["linear scale", "0.1GHz", "10GHz", "0.1GHz"],
|
|
614
|
+
... ])
|
|
462
615
|
"""
|
|
463
|
-
|
|
616
|
+
if name in self.frequency_sweeps:
|
|
617
|
+
return False
|
|
618
|
+
if not name:
|
|
619
|
+
name = generate_unique_name("sweep")
|
|
620
|
+
return SweepData(self, frequency_sweep, name)
|
|
464
621
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
622
|
+
def set_solution_single_frequency(self, frequency="5GHz", max_num_passes=10, max_delta_s=0.02):
|
|
623
|
+
"""Set single-frequency solution.
|
|
624
|
+
|
|
625
|
+
Parameters
|
|
626
|
+
----------
|
|
627
|
+
frequency : str, float, optional
|
|
628
|
+
Adaptive frequency. The default is ``5GHz``.
|
|
629
|
+
max_num_passes : int, optional
|
|
630
|
+
Maximum number of passes. The default is ``10``.
|
|
631
|
+
max_delta_s : float, optional
|
|
632
|
+
Maximum delta S. The default is ``0.02``.
|
|
468
633
|
|
|
469
634
|
Returns
|
|
470
635
|
-------
|
|
471
|
-
|
|
636
|
+
bool
|
|
637
|
+
|
|
472
638
|
"""
|
|
473
|
-
|
|
639
|
+
self.adaptive_settings.adapt_type = "kSingle"
|
|
640
|
+
self.adaptive_settings.adaptive_settings.AdaptiveFrequencyDataList.Clear()
|
|
641
|
+
return self.adaptive_settings.add_adaptive_frequency_data(frequency, max_num_passes, max_delta_s)
|
|
474
642
|
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
643
|
+
def set_solution_multi_frequencies(self, frequencies=("5GHz", "10GHz"), max_num_passes=10, max_delta_s="0.02"):
|
|
644
|
+
"""Set multi-frequency solution.
|
|
645
|
+
|
|
646
|
+
Parameters
|
|
647
|
+
----------
|
|
648
|
+
frequencies : list, tuple, optional
|
|
649
|
+
List or tuple of adaptive frequencies. The default is ``5GHz``.
|
|
650
|
+
max_num_passes : int, optional
|
|
651
|
+
Maximum number of passes. Default is ``10``.
|
|
652
|
+
max_delta_s : float, optional
|
|
653
|
+
Maximum delta S. The default is ``0.02``.
|
|
478
654
|
|
|
479
655
|
Returns
|
|
480
656
|
-------
|
|
481
|
-
|
|
482
|
-
|
|
657
|
+
bool
|
|
658
|
+
|
|
483
659
|
"""
|
|
484
|
-
|
|
660
|
+
self.adaptive_settings.adapt_type = "kMultiFrequencies"
|
|
661
|
+
self.adaptive_settings.adaptive_settings.AdaptiveFrequencyDataList.Clear()
|
|
662
|
+
for i in frequencies:
|
|
663
|
+
if not self.adaptive_settings.add_adaptive_frequency_data(i, max_num_passes, max_delta_s):
|
|
664
|
+
return False
|
|
665
|
+
return True
|
|
485
666
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
667
|
+
def set_solution_broadband(
|
|
668
|
+
self, low_frequency="5GHz", high_frequency="10GHz", max_num_passes=10, max_delta_s="0.02"
|
|
669
|
+
):
|
|
670
|
+
"""Set broadband solution.
|
|
671
|
+
|
|
672
|
+
Parameters
|
|
673
|
+
----------
|
|
674
|
+
low_frequency : str, float, optional
|
|
675
|
+
Low frequency. The default is ``5GHz``.
|
|
676
|
+
high_frequency : str, float, optional
|
|
677
|
+
High frequency. The default is ``10GHz``.
|
|
678
|
+
max_num_passes : int, optional
|
|
679
|
+
Maximum number of passes. The default is ``10``.
|
|
680
|
+
max_delta_s : float, optional
|
|
681
|
+
Maximum Delta S. Default is ``0.02``.
|
|
489
682
|
|
|
490
683
|
Returns
|
|
491
684
|
-------
|
|
492
|
-
|
|
493
|
-
Frequency with units.
|
|
685
|
+
bool
|
|
494
686
|
"""
|
|
495
|
-
|
|
687
|
+
self.adaptive_settings.adapt_type = "kBroadband"
|
|
688
|
+
self.adaptive_settings.adaptive_settings.AdaptiveFrequencyDataList.Clear()
|
|
689
|
+
if not self.adaptive_settings.add_broadband_adaptive_frequency_data(
|
|
690
|
+
low_frequency, high_frequency, max_num_passes, max_delta_s
|
|
691
|
+
): # pragma no cover
|
|
692
|
+
return False
|
|
693
|
+
return True
|
|
496
694
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
695
|
+
|
|
696
|
+
class SiwaveSYZSimulationSetup(SimulationSetup):
|
|
697
|
+
"""Manages EDB methods for SIwave simulation setup.
|
|
698
|
+
|
|
699
|
+
Parameters
|
|
700
|
+
----------
|
|
701
|
+
pedb : :class:`pyedb.dotnet.edb.Edb`
|
|
702
|
+
Inherited AEDT object.
|
|
703
|
+
edb_setup : :class:`Ansys.Ansoft.Edb.Utility.SIWaveSimulationSetup`
|
|
704
|
+
Edb object.
|
|
705
|
+
"""
|
|
706
|
+
|
|
707
|
+
def __init__(self, pedb, edb_setup=None):
|
|
708
|
+
super().__init__(pedb, edb_setup)
|
|
709
|
+
self._edb = self._pedb
|
|
710
|
+
self._setup_type = "kSIwave"
|
|
711
|
+
self._sim_setup_info = None
|
|
712
|
+
|
|
713
|
+
def create(self, name=None):
|
|
714
|
+
"""Create a SIwave SYZ setup.
|
|
500
715
|
|
|
501
716
|
Returns
|
|
502
717
|
-------
|
|
503
|
-
|
|
718
|
+
:class:`SiwaveDCSimulationSetup`
|
|
504
719
|
"""
|
|
505
|
-
|
|
720
|
+
self._name = name
|
|
721
|
+
self._create(name)
|
|
722
|
+
self.si_slider_position = 1
|
|
506
723
|
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
724
|
+
return self
|
|
725
|
+
|
|
726
|
+
def get_configurations(self):
|
|
727
|
+
"""Get SIwave SYZ simulation settings.
|
|
510
728
|
|
|
511
729
|
Returns
|
|
512
730
|
-------
|
|
513
|
-
|
|
731
|
+
dict
|
|
732
|
+
Dictionary of SIwave SYZ simulation settings.
|
|
514
733
|
"""
|
|
515
|
-
return
|
|
734
|
+
return {
|
|
735
|
+
"pi_slider_position": self.pi_slider_position,
|
|
736
|
+
"si_slider_position": self.si_slider_position,
|
|
737
|
+
"use_custom_settings": self.use_si_settings,
|
|
738
|
+
"use_si_settings": self.use_si_settings,
|
|
739
|
+
"advanced_settings": self.advanced_settings.get_configurations(),
|
|
740
|
+
}
|
|
516
741
|
|
|
517
742
|
@property
|
|
518
|
-
def
|
|
519
|
-
"""
|
|
743
|
+
def advanced_settings(self):
|
|
744
|
+
"""SIwave advanced settings."""
|
|
745
|
+
return AdvancedSettings(self)
|
|
520
746
|
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
747
|
+
@property
|
|
748
|
+
def get_sim_setup_info(self):
|
|
749
|
+
"""Get simulation information from the setup."""
|
|
750
|
+
if self._sim_setup_info:
|
|
751
|
+
return self._sim_setup_info
|
|
752
|
+
|
|
753
|
+
edb_setup = self._edb_object
|
|
754
|
+
edb_sim_setup_info = self._pedb.simsetupdata.SimSetupInfo[self._setup_type_mapping[self._setup_type]]()
|
|
755
|
+
edb_sim_setup_info.Name = edb_setup.GetName()
|
|
756
|
+
|
|
757
|
+
string = edb_setup.ToString().replace("\t", "").split("\r\n")
|
|
758
|
+
|
|
759
|
+
if is_linux:
|
|
760
|
+
string = string[0].split("\n")
|
|
761
|
+
keys = [i.split("=")[0] for i in string if len(i.split("=")) == 2 and "SourceTermsToGround" not in i]
|
|
762
|
+
values = [i.split("=")[1] for i in string if len(i.split("=")) == 2 and "SourceTermsToGround" not in i]
|
|
763
|
+
for val in string:
|
|
764
|
+
if "SourceTermsToGround()" in val:
|
|
765
|
+
break
|
|
766
|
+
elif "SourceTermsToGround" in val:
|
|
767
|
+
sources = {}
|
|
768
|
+
val = val.replace("SourceTermsToGround(", "").replace(")", "").split(",")
|
|
769
|
+
for v in val:
|
|
770
|
+
source = v.split("=")
|
|
771
|
+
sources[source[0]] = int(source[1].replace("'", ""))
|
|
772
|
+
edb_sim_setup_info.SimulationSettings.DCIRSettings.SourceTermsToGround = convert_pydict_to_netdict(
|
|
773
|
+
sources
|
|
774
|
+
)
|
|
775
|
+
break
|
|
776
|
+
for k in keys:
|
|
777
|
+
value = _parse_value(values[keys.index(k)])
|
|
778
|
+
setter = None
|
|
779
|
+
if k in dir(edb_sim_setup_info.SimulationSettings):
|
|
780
|
+
setter = edb_sim_setup_info.SimulationSettings
|
|
781
|
+
elif k in dir(edb_sim_setup_info.SimulationSettings.AdvancedSettings):
|
|
782
|
+
setter = edb_sim_setup_info.SimulationSettings.AdvancedSettings
|
|
783
|
+
|
|
784
|
+
elif k in dir(edb_sim_setup_info.SimulationSettings.DCAdvancedSettings):
|
|
785
|
+
setter = edb_sim_setup_info.SimulationSettings.DCAdvancedSettings
|
|
786
|
+
elif "DCIRSettings" in dir(edb_sim_setup_info.SimulationSettings) and k in dir(
|
|
787
|
+
edb_sim_setup_info.SimulationSettings.DCIRSettings
|
|
788
|
+
):
|
|
789
|
+
setter = edb_sim_setup_info.SimulationSettings.DCIRSettings
|
|
790
|
+
elif k in dir(edb_sim_setup_info.SimulationSettings.DCSettings):
|
|
791
|
+
setter = edb_sim_setup_info.SimulationSettings.DCSettings
|
|
792
|
+
elif k in dir(edb_sim_setup_info.SimulationSettings.AdvancedSettings):
|
|
793
|
+
setter = edb_sim_setup_info.SimulationSettings.AdvancedSettings
|
|
794
|
+
if setter:
|
|
795
|
+
try:
|
|
796
|
+
setter.__setattr__(k, value)
|
|
797
|
+
except TypeError:
|
|
798
|
+
try:
|
|
799
|
+
setter.__setattr__(k, str(value))
|
|
800
|
+
except:
|
|
801
|
+
pass
|
|
802
|
+
|
|
803
|
+
return edb_sim_setup_info
|
|
804
|
+
|
|
805
|
+
def set_pi_slider(self, value):
|
|
806
|
+
"""Set SIwave PI simulation accuracy level.
|
|
807
|
+
Options are:
|
|
808
|
+
- ``0``: Optimal speed
|
|
809
|
+
- ``1``: Balanced
|
|
810
|
+
- ``2``: Optimal accuracy
|
|
811
|
+
|
|
812
|
+
.. deprecated:: 0.7.5
|
|
813
|
+
Use :property:`pi_slider_position` property instead.
|
|
814
|
+
|
|
815
|
+
"""
|
|
816
|
+
warnings.warn("`set_pi_slider` is deprecated. Use `pi_slider_position` property instead.", DeprecationWarning)
|
|
817
|
+
self.pi_slider_position = value
|
|
818
|
+
|
|
819
|
+
def set_si_slider(self, value):
|
|
820
|
+
"""Set SIwave SI simulation accuracy level.
|
|
821
|
+
|
|
822
|
+
Options are:
|
|
823
|
+
- ``0``: Optimal speed;
|
|
824
|
+
- ``1``: Balanced;
|
|
825
|
+
- ``2``: Optimal accuracy```.
|
|
525
826
|
"""
|
|
526
|
-
|
|
827
|
+
self.use_si_settings = True
|
|
828
|
+
self.use_custom_settings = False
|
|
829
|
+
self.si_slider_position = value
|
|
830
|
+
self.advanced_settings.set_si_slider(value)
|
|
831
|
+
|
|
832
|
+
@property
|
|
833
|
+
def pi_slider_position(self):
|
|
834
|
+
"""PI solider position. Values are from ``1`` to ``3``."""
|
|
835
|
+
return self.get_sim_setup_info.SimulationSettings.PISliderPos
|
|
836
|
+
|
|
837
|
+
@pi_slider_position.setter
|
|
838
|
+
def pi_slider_position(self, value):
|
|
839
|
+
edb_setup_info = self.get_sim_setup_info
|
|
840
|
+
edb_setup_info.SimulationSettings.PISliderPos = value
|
|
841
|
+
self._edb_object = self._set_edb_setup_info(edb_setup_info)
|
|
842
|
+
self._update_setup()
|
|
843
|
+
|
|
844
|
+
self.use_si_settings = False
|
|
845
|
+
self.use_custom_settings = False
|
|
846
|
+
self.advanced_settings.set_pi_slider(value)
|
|
527
847
|
|
|
528
848
|
@property
|
|
529
|
-
def
|
|
530
|
-
"""
|
|
849
|
+
def si_slider_position(self):
|
|
850
|
+
"""SI slider position. Values are from ``1`` to ``3``."""
|
|
851
|
+
return self.get_sim_setup_info.SimulationSettings.SISliderPos
|
|
852
|
+
|
|
853
|
+
@si_slider_position.setter
|
|
854
|
+
def si_slider_position(self, value):
|
|
855
|
+
edb_setup_info = self.get_sim_setup_info
|
|
856
|
+
edb_setup_info.SimulationSettings.SISliderPos = value
|
|
857
|
+
self._edb_object = self._set_edb_setup_info(edb_setup_info)
|
|
858
|
+
self._update_setup()
|
|
859
|
+
|
|
860
|
+
self.use_si_settings = True
|
|
861
|
+
self.use_custom_settings = False
|
|
862
|
+
self.advanced_settings.set_si_slider(value)
|
|
863
|
+
|
|
864
|
+
@property
|
|
865
|
+
def use_custom_settings(self):
|
|
866
|
+
"""Custom settings to use.
|
|
531
867
|
|
|
532
868
|
Returns
|
|
533
869
|
-------
|
|
534
870
|
bool
|
|
535
|
-
``True`` if save radiated field only is used, ``False`` otherwise.
|
|
536
871
|
"""
|
|
537
|
-
return self.
|
|
872
|
+
return self.get_sim_setup_info.SimulationSettings.UseCustomSettings
|
|
873
|
+
|
|
874
|
+
@use_custom_settings.setter
|
|
875
|
+
def use_custom_settings(self, value):
|
|
876
|
+
edb_setup_info = self.get_sim_setup_info
|
|
877
|
+
edb_setup_info.SimulationSettings.UseCustomSettings = value
|
|
878
|
+
self._edb_object = self._set_edb_setup_info(edb_setup_info)
|
|
879
|
+
self._update_setup()
|
|
538
880
|
|
|
539
881
|
@property
|
|
540
|
-
def
|
|
541
|
-
"""
|
|
882
|
+
def use_si_settings(self):
|
|
883
|
+
"""Whether to use SI Settings.
|
|
542
884
|
|
|
543
885
|
Returns
|
|
544
886
|
-------
|
|
545
887
|
bool
|
|
546
|
-
``True`` if Q3d for DC point is used, ``False`` otherwise.
|
|
547
888
|
"""
|
|
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.
|
|
889
|
+
return self.get_sim_setup_info.SimulationSettings.UseSISettings
|
|
661
890
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
891
|
+
@use_si_settings.setter
|
|
892
|
+
def use_si_settings(self, value):
|
|
893
|
+
edb_setup_info = self.get_sim_setup_info
|
|
894
|
+
edb_setup_info.SimulationSettings.UseSISettings = value
|
|
895
|
+
self._edb_object = self._set_edb_setup_info(edb_setup_info)
|
|
896
|
+
self._update_setup()
|
|
897
|
+
|
|
898
|
+
|
|
899
|
+
class SiwaveDCSimulationSetup(SiwaveSYZSimulationSetup):
|
|
900
|
+
"""Manages EDB methods for SIwave DC simulation setup.
|
|
901
|
+
|
|
902
|
+
Parameters
|
|
903
|
+
----------
|
|
904
|
+
pedb : :class:`pyedb.dotnet.edb.Edb`
|
|
905
|
+
Inherited AEDT object.
|
|
906
|
+
edb_setup : Ansys.Ansoft.Edb.Utility.SIWDCIRSimulationSettings
|
|
907
|
+
EDB object. The default is ``None``.
|
|
908
|
+
"""
|
|
909
|
+
|
|
910
|
+
def __init__(self, pedb, edb_object=None):
|
|
911
|
+
super().__init__(pedb, edb_object)
|
|
912
|
+
self._setup_type = "kSIwaveDCIR"
|
|
913
|
+
self._edb = pedb
|
|
914
|
+
self._mesh_operations = {}
|
|
915
|
+
|
|
916
|
+
def create(self, name=None):
|
|
917
|
+
"""Create a SIwave DCIR setup.
|
|
670
918
|
|
|
671
919
|
Returns
|
|
672
920
|
-------
|
|
673
|
-
|
|
674
|
-
``True`` if correctly executed, ``False`` otherwise.
|
|
921
|
+
:class:`SiwaveDCSimulationSetup`
|
|
675
922
|
"""
|
|
676
|
-
self.
|
|
677
|
-
|
|
923
|
+
self._name = name
|
|
924
|
+
self._create(name)
|
|
925
|
+
self.set_dc_slider(1)
|
|
926
|
+
return self
|
|
678
927
|
|
|
679
|
-
@
|
|
680
|
-
def
|
|
681
|
-
"""
|
|
928
|
+
@property
|
|
929
|
+
def dc_ir_settings(self):
|
|
930
|
+
"""DC IR settings."""
|
|
931
|
+
return SiwaveDCIRSettings(self)
|
|
682
932
|
|
|
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``.
|
|
933
|
+
def get_configurations(self):
|
|
934
|
+
"""Get SIwave DC simulation settings.
|
|
691
935
|
|
|
692
936
|
Returns
|
|
693
937
|
-------
|
|
694
|
-
|
|
695
|
-
|
|
938
|
+
dict
|
|
939
|
+
Dictionary of SIwave DC simulation settings.
|
|
696
940
|
"""
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
941
|
+
return {
|
|
942
|
+
"dc_settings": self.dc_settings.get_configurations(),
|
|
943
|
+
"dc_advanced_settings": self.dc_advanced_settings.get_configurations(),
|
|
944
|
+
}
|
|
701
945
|
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
"""Set a log-count frequency sweep.
|
|
946
|
+
def set_dc_slider(self, value):
|
|
947
|
+
"""Set DC simulation accuracy level.
|
|
705
948
|
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
949
|
+
Options are:
|
|
950
|
+
|
|
951
|
+
- ``0``: Optimal speed
|
|
952
|
+
- ``1``: Balanced
|
|
953
|
+
- ``2``: Optimal accuracy
|
|
954
|
+
"""
|
|
955
|
+
self.use_custom_settings = False
|
|
956
|
+
self.dc_settings.dc_slider_position = value
|
|
957
|
+
self.dc_advanced_settings.set_dc_slider(value)
|
|
958
|
+
|
|
959
|
+
@property
|
|
960
|
+
def dc_settings(self):
|
|
961
|
+
"""SIwave DC setting."""
|
|
962
|
+
return DCSettings(self)
|
|
963
|
+
|
|
964
|
+
@property
|
|
965
|
+
def dc_advanced_settings(self):
|
|
966
|
+
"""Siwave DC advanced settings.
|
|
714
967
|
|
|
715
968
|
Returns
|
|
716
969
|
-------
|
|
717
|
-
|
|
718
|
-
``True`` if correctly executed, ``False`` otherwise.
|
|
970
|
+
:class:`pyedb.dotnet.edb_core.edb_data.siwave_simulation_setup_data.SiwaveDCAdvancedSettings`
|
|
719
971
|
"""
|
|
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()
|
|
972
|
+
return DCAdvancedSettings(self)
|
|
724
973
|
|
|
725
|
-
@
|
|
726
|
-
def
|
|
727
|
-
"""
|
|
974
|
+
@property
|
|
975
|
+
def source_terms_to_ground(self):
|
|
976
|
+
"""Dictionary of grounded terminals.
|
|
977
|
+
|
|
978
|
+
Returns
|
|
979
|
+
-------
|
|
980
|
+
Dictionary
|
|
981
|
+
{str, int}, keys is source name, value int 0 unspecified, 1 negative node, 2 positive one.
|
|
982
|
+
|
|
983
|
+
"""
|
|
984
|
+
return convert_netdict_to_pydict(self.get_sim_setup_info.SimulationSettings.DCIRSettings.SourceTermsToGround)
|
|
985
|
+
|
|
986
|
+
def add_source_terminal_to_ground(self, source_name, terminal=0):
|
|
987
|
+
"""Add a source terminal to ground.
|
|
728
988
|
|
|
729
989
|
Parameters
|
|
730
990
|
----------
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
991
|
+
source_name : str,
|
|
992
|
+
Source name.
|
|
993
|
+
terminal : int, optional
|
|
994
|
+
Terminal to assign. Options are:
|
|
995
|
+
|
|
996
|
+
- 0=Unspecified
|
|
997
|
+
- 1=Negative node
|
|
998
|
+
- 2=Positive none
|
|
999
|
+
|
|
737
1000
|
Returns
|
|
738
1001
|
-------
|
|
739
1002
|
bool
|
|
740
|
-
|
|
1003
|
+
|
|
741
1004
|
"""
|
|
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()
|
|
1005
|
+
terminals = self.source_terms_to_ground
|
|
1006
|
+
terminals[source_name] = terminal
|
|
1007
|
+
self.get_sim_setup_info.SimulationSettings.DCIRSettings.SourceTermsToGround = convert_pydict_to_netdict(
|
|
1008
|
+
terminals
|
|
1009
|
+
)
|
|
1010
|
+
return self._update_setup()
|