|
1 | 1 | """HFSS extent information."""
|
| 2 | +from __future__ import annotations |
| 3 | + |
| 4 | +from typing import TYPE_CHECKING, Tuple |
| 5 | + |
| 6 | +if TYPE_CHECKING: |
| 7 | + from ansys.edb.core.typing import ValueLike |
| 8 | + from ansys.edb.core.primitive.primitive import Primitive |
2 | 9 |
|
3 | 10 | from enum import Enum
|
4 | 11 |
|
|
8 | 15 | from ansys.edb.core.utility.value import Value
|
9 | 16 |
|
10 | 17 |
|
| 18 | +class HFSSExtentInfoType(Enum): |
| 19 | + """Provides an enum representing available HFSS extent information types.""" |
| 20 | + |
| 21 | + BOUNDING_BOX = edb_defs_pb2.HFSS_EXTENT_BOUNDING_BOX |
| 22 | + CONFORMING = edb_defs_pb2.HFSS_EXTENT_CONFIRMING |
| 23 | + CONVEX_HUL = edb_defs_pb2.HFSS_EXTENT_CONVEX_HULL |
| 24 | + POLYGON = edb_defs_pb2.HFSS_EXTENT_POLYGON |
| 25 | + |
| 26 | +class OpenRegionType(Enum): |
| 27 | + """Provides an enum representing open region types.""" |
| 28 | + |
| 29 | + RADIATION = edb_defs_pb2.HFSS_EXTENT_RADIATION |
| 30 | + PML = edb_defs_pb2.HFSS_EXTENT_PML |
| 31 | + |
| 32 | + |
11 | 33 | class HfssExtentInfo:
|
12 | 34 | """Provides HFSS extent information.
|
13 | 35 |
|
14 | 36 | Attributes
|
15 | 37 | ----------
|
16 |
| - use_open_region: bool |
| 38 | + use_open_region : bool, default: ``True`` |
17 | 39 | Whether an open region is used.
|
18 |
| - extent_type: HfssExtentInfo.HFSSExtentInfoType |
| 40 | + extent_type : HFSSExtentInfoType, default: BOUNDING_BOX |
19 | 41 | Extent type.
|
20 |
| - open_region_type: HfssExtentInfo.OpenRegionType |
| 42 | + open_region_type : OpenRegionType, default: RADIATION |
21 | 43 | Open region type.
|
22 |
| - base_polygon: Primitive |
| 44 | + base_polygon : .Primitive, default: None |
23 | 45 | Polygon to use if the extent is the ``Polygon`` type.
|
24 |
| - dielectric_extent_type: HfssExtentInfo.HFSSExtentInfoType |
| 46 | + dielectric_extent_type : HFSSExtentInfoType, default: BOUNDING_BOX |
25 | 47 | Dielectric extent type.
|
26 |
| - dielectric_base_polygon : :class:`.Primitive` |
27 |
| - Polygon to use if dielectric extent is is the ``Polygon`` type. |
28 |
| - dielectric: (float, bool) |
29 |
| - Dielectric extent size. The first parameter is the value, and the second parameter \ |
30 |
| - indicates if the value is a multiple. |
31 |
| - honor_user_dielectric: bool |
32 |
| - Whether to honor a user-defined dielectric primitive when calculating a dielectric extent. |
33 |
| - airbox_truncate_at_ground: bool |
| 48 | + dielectric_base_polygon : .Primitive, default: None |
| 49 | + Polygon to use if dielectric extent is the ``Polygon`` type. |
| 50 | + dielectric : (float, bool), default: (0, True) |
| 51 | + Dielectric extent size. The first parameter is the value. |
| 52 | + The second parameter is a Boolean indicating if the value is a multiple. |
| 53 | + honor_user_dielectric : bool, default: ``True`` |
| 54 | + Whether to honor a user-defined dielectric primitive when calculating the dielectric |
| 55 | + extent. |
| 56 | + airbox_truncate_at_ground : bool, default: ``False`` |
34 | 57 | Whether to truncate the airbox at the ground layers.
|
35 |
| - airbox_horizontal: (float, bool) |
36 |
| - Airbox horizontal extent size. The first parameter is the value, and the second parameter \ |
37 |
| - indicates if the value is a multiple. |
38 |
| - airbox_vertical_positive: (float, bool) |
39 |
| - Airbox positive vertical extent size. The first parameter is the value, and the second parameter \ |
40 |
| - indicates if the value is a multiple. |
41 |
| - airbox_vertical_negative: (float, bool) |
42 |
| - Airbox negative vertical extent size. The first parameter is the value, and the second parameter \ |
43 |
| - indicates if the value is a multiple. |
44 |
| - sync_airbox_vertical_extent: bool |
| 58 | + airbox_horizontal : (float, bool), default: (0.15, True) |
| 59 | + Airbox horizontal extent size. The first parameter is the value. |
| 60 | + The second parameter is a Boolean indicating if the value is a multiple. |
| 61 | + airbox_vertical_positive : (float, bool), default: (0.15, True) |
| 62 | + Airbox positive vertical extent size. The first parameter is the value. |
| 63 | + The second parameter is a Boolean indicating if the value is a multiple. |
| 64 | + airbox_vertical_negative : (float, bool), default: (0.15, True) |
| 65 | + Airbox negative vertical extent size. The first parameter is the value. |
| 66 | + The second parameter is a Boolean indicating if the value is a multiple. |
| 67 | + sync_airbox_vertical_extent : bool, default: ``True`` |
45 | 68 | Whether to synchronize the airbox positive and negative vertical extent.
|
46 |
| - is_pml_visible: bool |
47 |
| - Whether to check to see if the PML boxes are to rendered. |
48 |
| - operating_frequency : :class:`.Value` |
| 69 | + is_pml_visible : bool, default: ``False`` |
| 70 | + Whether to check to see if PML boxes are to be rendered. |
| 71 | + operating_frequency : :term:`ValueLike`, default: ``5GHz`` |
49 | 72 | PML operating frequency.
|
50 |
| - radiation_level : :class:`.Value` |
| 73 | + radiation_level : .Value, default: 0 |
51 | 74 | PML radiation level for calculating the thickness of the boundary.
|
52 |
| - user_xy_data_extent_for_vertical_expansion: bool |
| 75 | + user_xy_data_extent_for_vertical_expansion : bool, default: ``True`` |
53 | 76 | Whether to retain the old behavior for the vertical expansion of the airbox.
|
54 |
| - If ``True``, the vertical extent is calculated from the XY data extent. |
| 77 | + The default is ``True``, in which case the vertical extent is calculated from |
| 78 | + the XY data extent. |
55 | 79 | """
|
56 | 80 |
|
57 |
| - class HFSSExtentInfoType(Enum): |
58 |
| - """Provides an enum representing available HFSS extent information types.""" |
59 |
| - |
60 |
| - BOUNDING_BOX = edb_defs_pb2.HFSS_EXTENT_BOUNDING_BOX |
61 |
| - CONFORMING = edb_defs_pb2.HFSS_EXTENT_CONFIRMING |
62 |
| - CONVEX_HUL = edb_defs_pb2.HFSS_EXTENT_CONVEX_HULL |
63 |
| - POLYGON = edb_defs_pb2.HFSS_EXTENT_POLYGON |
64 |
| - |
65 |
| - class OpenRegionType(Enum): |
66 |
| - """Provides an enum representing open region types.""" |
67 |
| - |
68 |
| - RADIATION = edb_defs_pb2.HFSS_EXTENT_RADIATION |
69 |
| - PML = edb_defs_pb2.HFSS_EXTENT_PML |
70 |
| - |
71 | 81 | def __init__(
|
72 | 82 | self,
|
73 |
| - use_open_region=True, |
74 |
| - extent_type=HFSSExtentInfoType.BOUNDING_BOX, |
75 |
| - open_region_type=OpenRegionType.RADIATION, |
76 |
| - base_polygon=None, |
77 |
| - dielectric_extent_type=HFSSExtentInfoType.BOUNDING_BOX, |
78 |
| - dielectric_base_polygon=None, |
79 |
| - dielectric=(0, True), |
80 |
| - honor_user_dielectric=True, |
81 |
| - airbox_truncate_at_ground=False, |
82 |
| - airbox_horizontal=(0.15, True), |
83 |
| - airbox_vertical_positive=(0.15, True), |
84 |
| - airbox_vertical_negative=(0.15, True), |
85 |
| - sync_airbox_vertical_extent=True, |
86 |
| - is_pml_visible=False, |
87 |
| - operating_frequency="5GHz", |
88 |
| - radiation_level=Value(0), |
89 |
| - user_xy_data_extent_for_vertical_expansion=True, |
| 83 | + use_open_region: bool = True, |
| 84 | + extent_type: HFSSExtentInfoType = HFSSExtentInfoType.BOUNDING_BOX, |
| 85 | + open_region_type: OpenRegionType = OpenRegionType.RADIATION, |
| 86 | + base_polygon: Primitive = None, |
| 87 | + dielectric_extent_type: HFSSExtentInfoType = HFSSExtentInfoType.BOUNDING_BOX, |
| 88 | + dielectric_base_polygon: Primitive = None, |
| 89 | + dielectric: Tuple[float, bool] =(0, True), |
| 90 | + honor_user_dielectric: bool = True, |
| 91 | + airbox_truncate_at_ground: bool = False, |
| 92 | + airbox_horizontal: Tuple[float, bool] = (0.15, True), |
| 93 | + airbox_vertical_positive: Tuple[float, bool] = (0.15, True), |
| 94 | + airbox_vertical_negative: Tuple[float, bool] = (0.15, True), |
| 95 | + sync_airbox_vertical_extent: bool = True, |
| 96 | + is_pml_visible: bool = False, |
| 97 | + operating_frequency: ValueLike = "5GHz", |
| 98 | + radiation_level: Value = Value(0), |
| 99 | + user_xy_data_extent_for_vertical_expansion: bool = True, |
90 | 100 | ):
|
91 | 101 | """Create an HFSS extent information object.
|
92 | 102 |
|
93 | 103 | Parameters
|
94 | 104 | ----------
|
95 |
| - use_open_region: bool, default: True |
| 105 | + use_open_region : bool, default: ``True`` |
96 | 106 | Whether an open region is used.
|
97 |
| - extent_type: HfssExtentInfo.HFSSExtentInfoType, default: BOUNDING_BOX |
| 107 | + extent_type : HFSSExtentInfoType, default: BOUNDING_BOX |
98 | 108 | Extent type.
|
99 |
| - open_region_type: HfssExtentInfo.OpenRegionType, default: RADIATION |
| 109 | + open_region_type: OpenRegionType, default: RADIATION |
100 | 110 | Open region type.
|
101 |
| - base_polygon: Primitive, default: None |
| 111 | + base_polygon : .Primitive, default: None |
102 | 112 | Polygon to use if the extent is the ``Polygon`` type.
|
103 |
| - dielectric_extent_type: HfssExtentInfo.HFSSExtentInfoType, default: BOUNDING_BOX |
| 113 | + dielectric_extent_type : HFSSExtentInfoType, default: BOUNDING_BOX |
104 | 114 | Dielectric extent type.
|
105 |
| - dielectric_base_polygon : :class:`.Primitive`, default: None |
| 115 | + dielectric_base_polygon : .Primitive, default: None |
106 | 116 | Polygon to use if dielectric extent is the ``Polygon`` type.
|
107 |
| - dielectric: (float, bool), default: (0, True) |
| 117 | + dielectric : (float, bool), default: (0, True) |
108 | 118 | Dielectric extent size. The first parameter is the value.
|
109 | 119 | The second parameter is a Boolean indicating if the value is a multiple.
|
110 |
| - honor_user_dielectric: bool, default: True |
| 120 | + honor_user_dielectric : bool, default: ``True`` |
111 | 121 | Whether to honor a user-defined dielectric primitive when calculating the dielectric
|
112 | 122 | extent.
|
113 |
| - airbox_truncate_at_ground: bool, default: False |
| 123 | + airbox_truncate_at_ground : bool, default: ``False`` |
114 | 124 | Whether to truncate the airbox at the ground layers.
|
115 |
| - airbox_horizontal: (float, bool), default: (0.15, True) |
| 125 | + airbox_horizontal : (float, bool), default: (0.15, True) |
116 | 126 | Airbox horizontal extent size. The first parameter is the value.
|
117 | 127 | The second parameter is a Boolean indicating if the value is a multiple.
|
118 |
| - airbox_vertical_positive: (float, bool), default: (0.15, True) |
| 128 | + airbox_vertical_positive : (float, bool), default: (0.15, True) |
119 | 129 | Airbox positive vertical extent size. The first parameter is the value.
|
120 | 130 | The second parameter is a Boolean indicating if the value is a multiple.
|
121 |
| - airbox_vertical_negative: (float, bool), default: (0.15, True) |
| 131 | + airbox_vertical_negative : (float, bool), default: (0.15, True) |
122 | 132 | Airbox negative vertical extent size. The first parameter is the value.
|
123 | 133 | The second parameter is a Boolean indicating if the value is a multiple.
|
124 |
| - sync_airbox_vertical_extent: bool, default: True |
| 134 | + sync_airbox_vertical_extent : bool, default: ``True`` |
125 | 135 | Whether to synchronize the airbox positive and negative vertical extent.
|
126 |
| - is_pml_visible: bool, default: False |
| 136 | + is_pml_visible : bool, default: ``False`` |
127 | 137 | Whether to check to see if PML boxes are to be rendered.
|
128 |
| - operating_frequency : :class:`.Value`, default: "5GHz" |
| 138 | + operating_frequency : :term:`ValueLike`, default: 5GHz |
129 | 139 | PML operating frequency.
|
130 |
| - radiation_level : :class:`.Value`, default: 0 |
| 140 | + radiation_level : .Value, default: 0 |
131 | 141 | PML radiation level for calculating the thickness of the boundary.
|
132 |
| - user_xy_data_extent_for_vertical_expansion: bool, default: True |
| 142 | + user_xy_data_extent_for_vertical_expansion : bool, default: ``True`` |
133 | 143 | Whether to retain the old behavior for the vertical expansion of the airbox.
|
134 | 144 | The default is ``True``, in which case the vertical extent is calculated from
|
135 | 145 | the XY data extent.
|
|
0 commit comments