tidy3d.UniformCurrentSource#

class UniformCurrentSource[source]#

Bases: CurrentSource, ReverseInterpolatedSource

Source in a rectangular volume with uniform time dependence.

Parameters:
  • name (Optional[str] = None) – Optional name for the source.

  • 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.

  • source_time (Union[GaussianPulse, ContinuousWave, CustomSourceTime, BroadbandPulse, BasebandStep, BasebandGaussianPulse, BasebandRectangularPulse, BasebandCustomSourceTime]) – Specification of the source time-dependence.

  • interpolate (bool = True) – Handles reverse-interpolation of zero-size dimensions of the source. If False, the source data is snapped to the nearest Yee grid point. If True, equivalent source data is applied on the surrounding Yee grid points to emulate placement at the specified location using linear interpolation.

  • confine_to_bounds (bool = False) – If True, any source amplitudes which, after discretization, fall beyond the bounding box of the source are zeroed out, but only along directions where the source has a non-zero extent. The bounding box is inclusive. Should be set `True when the current source is being used to excite a current in a conductive material.

  • polarization (Literal['Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz']) – Specifies the direction and type of current component.

  • current_amplitude_definition (Literal['density', 'total'] = density) – Defines how the source_time amplitude is interpreted. If 'total', the source_time parameter is interpreted as the total current in Amperes (A) / Volts (V) when an electric / magnetic current polarization is chosen. The solver automatically scales the current density by the source cross-sectional area to ensure the integrated current equals the specified amplitude, regardless of mesh resolution. If 'density' (default), source_time represents the current density (e.g., A/m²), meaning the total injected current will scale with the source geometry size.

Notes

Inputting the parameter size=(0,0,0) defines the equivalent of a point source.

Example

>>> from tidy3d import GaussianPulse
>>> pulse = GaussianPulse(freq0=200e12, fwidth=20e12)
>>> pt_source = UniformCurrentSource(
...     size=(0,0,0), source_time=pulse, polarization='Ex', current_amplitude_definition='total',
... )

Attributes

current_amplitude_definition

polarization

interpolate

confine_to_bounds

source_time

size

center

name

current_amplitude_definition#