tidy3d.plugins.smatrix.WavePort#
- class WavePort[source]#
Bases:
AbstractTerminalPort
,Box
Class representing a single wave port
- Parameters:
attrs (dict = {}) – Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields,
attrs
are mutable. For example, the following is allowed for setting anattr
obj.attrs['foo'] = bar
. Also note that Tidy3D` will raise aTypeError
ifattrs
contain objects that can not be serialized. One can check ifattrs
are serializable by callingobj.json()
.center (Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)) – [units = um]. Center of object in x, y, and z.
size (Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]) – [units = um]. Size in x, y, and z directions.
name (ConstrainedStrValue) – Unique name for the port.
direction (Literal['+', '-']) – ‘+’ or ‘-’, defining which direction is considered ‘input’.
mode_spec (ModeSpec = ModeSpec(attrs={}, num_modes=1, target_neff=None, num_pml=(0,, 0), filter_pol=None, angle_theta=0.0, angle_phi=0.0, precision='double', bend_radius=None, bend_axis=None, angle_rotation=False, track_freq='central', group_index_step=False, type='ModeSpec')) – Parameters to feed to mode solver which determine modes measured by monitor.
mode_index (NonNegativeInt = 0) – Index into the collection of modes returned by mode solver. Specifies which mode to inject using this source. If larger than
mode_spec.num_modes
,num_modes
in the solver will be set tomode_index + 1
.voltage_integral (Union[VoltageIntegralAxisAligned, CustomVoltageIntegral2D, NoneType] = None) – Definition of voltage integral used to compute voltage and the characteristic impedance.
current_integral (Union[CurrentIntegralAxisAligned, CustomCurrentIntegral2D, NoneType] = None) – Definition of current integral used to compute current and the characteristic impedance.
num_grid_cells (Optional[ConstrainedIntValue] = 5) – Number of mesh grid cells in the transverse plane of the WavePort. Used in generating the suggested list of
MeshOverrideStructure
objects. Must be greater than or equal to 3. When set to None, no grid refinement is performed.
Attributes
Injection axis of the port.
Transverse axes of the port.
Methods
compute_current
(sim_data)Helper to compute current flowing through the port.
compute_port_impedance
(sim_mode_data)Helper to compute impedance of port.
compute_voltage
(sim_data)Helper to compute voltage across the port.
Creates a list of
MeshOverrideStructure
for mesh refinement in the transverse plane of the port.to_mode_solver
(simulation, freqs)Helper to create a
ModeSolver
instance.to_monitors
(freqs[, snap_center, grid])The wave port uses a
ModeMonitor
to compute the characteristic impedance and the port voltages and currents.to_source
(source_time[, snap_center])Create a mode source from the wave port.
Inherited Common Usage
- direction#
- mode_spec#
- mode_index#
- voltage_integral#
- current_integral#
- num_grid_cells#
- property injection_axis#
Injection axis of the port.
- property transverse_axes#
Transverse axes of the port.
- to_monitors(freqs, snap_center=None, grid=None)[source]#
The wave port uses a
ModeMonitor
to compute the characteristic impedance and the port voltages and currents.
- to_mode_solver(simulation, freqs)[source]#
Helper to create a
ModeSolver
instance.
- compute_port_impedance(sim_mode_data)[source]#
Helper to compute impedance of port. The port impedance is computed from the transmission line mode, which should be TEM or at least quasi-TEM.
- to_mesh_overrides()[source]#
Creates a list of
MeshOverrideStructure
for mesh refinement in the transverse plane of the port. The mode source requires at least 3 grid cells in the transverse dimensions, so these mesh overrides will be added to the simulation to ensure that this requirement is satisfied.
- __hash__()#
Hash method.