tidy3d.plugins.smatrix.LumpedPort#

class LumpedPort[source]#

Bases: AbstractLumpedPort, Box

Class representing a single rectangular lumped port.

Parameters:
  • center (Optional[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]]] = None) – [units = um]. Center of object in x, y, and z.

  • size (tuple[Union[NonNegativeFloat, autograd.tracer.Box], Union[NonNegativeFloat, autograd.tracer.Box], Union[NonNegativeFloat, autograd.tracer.Box]]) – [units = um]. Size in x, y, and z directions.

  • name (str) – Unique name for the port.

  • impedance (complex = 50) – [units = ohm]. Reference port impedance for scattering parameter computation.

  • num_grid_cells (Optional[PositiveInt] = 3) – Number of mesh grid cells associated with the port along each direction, which are added through automatic mesh refinement. A value of None will turn off automatic mesh refinement.

  • enable_snapping_points (bool = True) – When enabled, snapping points are automatically generated to snap grids to key geometric features of the lumped port for more accurate modelling.

  • voltage_axis (Literal[0, 1, 2]) – Specifies the axis along which the E-field line integral is performed when computing the port voltage. The integration axis must lie in the plane of the port.

  • snap_perimeter_to_grid (bool = True) – When enabled, the perimeter of the port is snapped to the simulation grid, which improves accuracy when the number of grid cells is low within the element. A LumpedPort is always snapped to the grid along its injection axis.

  • dist_type (Literal['off', 'laterally_only', 'on'] = on) – Optional field that is passed directly to the LinearLumpedElement used to model the port’s load. When set to on, the network portion of the lumped port, including the source, is distributedacross the entirety of the lumped element’s bounding box. When set to off, the network portion of the lumped port is restricted to one cell and PEC connections are used to connect the network cell to the edges of the lumped element. A third option exists laterally_only, where the network portion is only distributed along the lateral axis of the lumped port.

Note

The port must be planar (exactly one zero-size dimension). One-dimensional ports (two zero-size dimensions) are not supported. If you need a narrow port, provide a small but finite width along the lateral axis (e.g., fp_eps or larger).

Example

>>> port1 = LumpedPort(center=(0, 0, 0),
...             size=(0, 1, 2),
...             voltage_axis=2,
...             name="port_1",
...             impedance=50
...         )

See also

LinearLumpedElement

The lumped element representing the load of the port.

Attributes

current_axis

Integration axis for computing the port current via the magnetic field.

injection_axis

Injection axis of the port.

voltage_axis

snap_perimeter_to_grid

dist_type

impedance

num_grid_cells

enable_snapping_points

name

size

center

Methods

compute_current(sim_data)

Helper to compute current flowing through the port.

compute_voltage(sim_data)

Helper to compute voltage across the port.

from_structures([x, y, z, ground_terminal, ...])

Auto-generate lumped port based on provided structures and plane coordinates.

to_current_monitor(freqs[, snap_center, grid])

Field monitor to compute port current.

to_load([snap_center])

Create a load resistor from the lumped port.

to_source(source_time[, snap_center, grid])

Create a current source from the lumped port.

to_voltage_monitor(freqs[, snap_center, grid])

Field monitor to compute port voltage.

voltage_axis#
snap_perimeter_to_grid#
dist_type#
property injection_axis#

Injection axis of the port.

property current_axis#

Integration axis for computing the port current via the magnetic field.

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

Create a current source from the lumped port.

to_load(snap_center=None)[source]#

Create a load resistor from the lumped port.

to_voltage_monitor(freqs, snap_center=None, grid=None)[source]#

Field monitor to compute port voltage.

to_current_monitor(freqs, snap_center=None, grid=None)[source]#

Field monitor to compute port current.

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.

classmethod from_structures(x=None, y=None, z=None, ground_terminal=None, signal_terminal=None, voltage_axis=None, lateral_coord=None, port_width=None, **kwargs)[source]#

Auto-generate lumped port based on provided structures and plane coordinates.

Parameters:
  • x (float = None) – Position of plane in x direction, only one of x,y,z can be specified to define plane.

  • y (float = None) – Position of plane in x direction, only one of x,y,z can be specified to define plane.

  • z (float = None) – Position of plane in x direction, only one of x,y,z can be specified to define plane.

  • ground_terminal (Structure = None) – Structure representing ground terminal.

  • signal_terminal (Structure = None) – Structure representing signal terminal.

  • voltage_axis (Axis = None) – Direction of lumped port voltage.

  • lateral_coord (Optional[float] = None) – Coordinate along lateral axis.

  • port_width (float = None) – Lateral Width of lumped port.

  • **kwargs – Other LumpedPort parameters.

Returns:

Lumped Port defined between ground and signal terminals.

Return type:

LumpedPorts

Notes

  • The lateral axis refers to the axis perpendicular to the voltage_axis within the port plane

  • lateral_coord has two purposes:
    1. if ground/signal has multiple 2D shapes intersecting the port plane, the shape chosen to create the port is the one that intersects lateral_coord.

    2. if port_width is also specified, lateral_coord is used as the center position of the port along that axis.

  • If port_width is not specified, port width is automatically chosen based on 2D bounds of the in-plane ground/signal shapes.