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 an attr obj.attrs['foo'] = bar. Also note that Tidy3D` will raise a TypeError if attrs contain objects that can not be serialized. One can check if attrs are serializable by calling obj.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 to mode_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.

  • conjugated_dot_product (bool = False) – Use conjugated or non-conjugated dot product for mode decomposition.

  • frame (Optional[PECFrame] = PECFrame(attrs={}, length=2, type='PECFrame')) – Add a thin frame around the source during FDTD run for an improved injection.

  • absorber (Union[bool, ABCBoundary, ModeABCBoundary] = True) – Place a mode absorber in the port. If True, an automatically generated mode absorber is placed in the port. If ABCBoundary or ModeABCBoundary, a mode absorber is placed in the port with the specified boundary conditions.

Attributes

injection_axis

Injection axis of the port.

transverse_axes

Transverse axes of the port.

attrs

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_absorber([snap_center, freq_spec])

Create an internal absorber from the wave port.

to_mesh_overrides()

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#
conjugated_dot_product#
frame#
absorber#
property injection_axis#

Injection axis of the port.

property transverse_axes#

Transverse axes of the port.

to_source(source_time, snap_center=None)[source]#

Create a mode source from the wave 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.

to_absorber(snap_center=None, freq_spec=None)[source]#

Create an internal absorber from the wave port.

compute_voltage(sim_data)[source]#

Helper to compute voltage across the port.

compute_current(sim_data)[source]#

Helper to compute current flowing through the port.

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.