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='auto', 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.
Attributes
Injection axis 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.
to_field_monitors
(freqs[, snap_center, grid])Field monitor to compute port voltage and current.
to_mode_solver
(simulation, freqs)Helper to create a
ModeSolver
instance.to_mode_solver_monitor
(freqs)Mode solver monitor to compute modes that will be used to compute characteristic impedances.
to_source
(source_time[, snap_center])Create a mode source from the wave port.
validate_current_integral_sign
(val, values)Validate that the sign of
current_integral
matches the port direction.Inherited Common Usage
- direction#
- mode_spec#
- mode_index#
- voltage_integral#
- current_integral#
- property injection_axis#
Injection axis of the port.
- to_field_monitors(freqs, snap_center=None, grid=None)[source]#
Field monitor to compute port voltage and current.
- to_mode_solver_monitor(freqs)[source]#
Mode solver monitor to compute modes that will be used to compute characteristic impedances.
- 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.
- classmethod validate_current_integral_sign(val, values)[source]#
Validate that the sign of
current_integral
matches the port direction.
- __hash__()#
Hash method.