tidy3d.plugins.smatrix.LumpedPort#

class LumpedPort[source]#

Bases: AbstractLumpedPort, Box

Class representing a single rectangular lumped 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.

  • impedance (Union[tidycomplex, ComplexNumber] = 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.

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.

attrs

Methods

compute_current(sim_data)

Helper to compute current flowing through the port.

compute_voltage(sim_data)

Helper to compute voltage across the port.

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.

Inherited Common Usage

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)[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.

__hash__()#

Hash method.