16
16
from tidy3d .plugins .smatrix .component_modelers .base import TerminalPortType
17
17
from tidy3d .plugins .smatrix .component_modelers .terminal import TerminalComponentModeler
18
18
from tidy3d .plugins .smatrix .data .data_array import PortDataArray , TerminalPortDataArray
19
+ from tidy3d .plugins .smatrix .utils import (
20
+ ab_to_s ,
21
+ check_port_impedance_sign ,
22
+ compute_F ,
23
+ compute_port_VI ,
24
+ compute_power_delivered_by_port ,
25
+ compute_power_wave_amplitudes ,
26
+ s_to_z ,
27
+ )
19
28
20
29
21
30
class MicrowavePortSimulationData (Tidy3dBaseModel ):
@@ -78,9 +87,9 @@ class TerminalComponentModelerData(Tidy3dBaseModel):
78
87
@cached_property
79
88
def smatrix (self ) -> MicrowaveSMatrixData :
80
89
"Stores the computed S-matrix and reference impedances for the terminal ports"
81
- from tidy3d .plugins .smatrix .run .local_run import construct_smatrix
90
+ from tidy3d .plugins .smatrix .run .terminal import terminal_construct_smatrix
82
91
83
- terminal_port_data = construct_smatrix (simulation = self .simulation )
92
+ terminal_port_data = terminal_construct_smatrix (simulation = self .simulation )
84
93
smatrix_data = MicrowaveSMatrixData (data = terminal_port_data )
85
94
return smatrix_data
86
95
@@ -141,7 +150,7 @@ def get_antenna_metrics_data(
141
150
Container with antenna parameters including directivity, gain, and radiation efficiency,
142
151
computed from the superposition of fields from all excited ports.
143
152
"""
144
- from tidy3d .plugins .smatrix .run .local_run import compute_power_wave_amplitudes_at_each_port
153
+ from tidy3d .plugins .smatrix .run .terminal import compute_power_wave_amplitudes_at_each_port
145
154
146
155
# Use the first port as default if none specified
147
156
if port_amplitudes is None :
@@ -210,14 +219,14 @@ def get_antenna_metrics_data(
210
219
@cached_property
211
220
def port_reference_impedances (self ) -> PortDataArray :
212
221
"""The reference impedance used at each port for definining power wave amplitudes."""
213
- from tidy3d .plugins .smatrix .run .local_run import port_reference_impedances
222
+ from tidy3d .plugins .smatrix .run .terminal import port_reference_impedances
214
223
215
224
return port_reference_impedances (self .simulation )
216
225
217
226
def compute_power_wave_amplitudes_at_each_port (
218
227
self , port_reference_impedances : PortDataArray , sim_data : SimulationData
219
228
) -> tuple [PortDataArray , PortDataArray ]:
220
- from tidy3d .plugins .smatrix .run .local_run import compute_power_wave_amplitudes_at_each_port
229
+ from tidy3d .plugins .smatrix .run .terminal import compute_power_wave_amplitudes_at_each_port
221
230
222
231
data = compute_power_wave_amplitudes_at_each_port (
223
232
simulation = self .simulation ,
@@ -228,3 +237,10 @@ def compute_power_wave_amplitudes_at_each_port(
228
237
229
238
# Mirror Utils
230
239
# So they can be reused elsewhere without a class reimport
240
+ ab_to_s = ab_to_s
241
+ compute_F = compute_F
242
+ check_port_impedance_sign = check_port_impedance_sign
243
+ compute_port_VI = compute_port_VI
244
+ compute_power_wave_amplitudes = compute_power_wave_amplitudes
245
+ compute_power_delivered_by_port = compute_power_delivered_by_port
246
+ s_to_z = s_to_z
0 commit comments