tidy3d.plugins.microwave.Custom2DVoltageIntegral

tidy3d.plugins.microwave.Custom2DVoltageIntegral#

class Custom2DVoltageIntegral[source]#

Bases: Custom2DPathIntegral, Custom2DVoltageIntegralSpec

Class for computing the voltage between two points defined by a custom path. Computed voltage is \(V=V_b-V_a\), where position b is the final vertex in the supplied path.

Parameters:
  • axis (Literal[0, 1, 2]) – Specifies dimension of the planar axis (0,1,2) -> (x,y,z).

  • position (float) – Position of the plane along the axis.

  • vertices (ArrayLike[dtype=float, ndim=2]) – [units = um]. List of (d1, d2) defining the 2 dimensional positions of the path. The index of dimension should be in the ascending order, which means if the axis corresponds with y, the coordinates of the vertices should be (x, z). If you wish to indicate a closed contour, the final vertex should be made equal to the first vertex, i.e., vertices[-1] == vertices[0]

Notes

Use AxisAlignedVoltageIntegral if possible, since interpolation near conductors will not be accurate.

Example

>>> import numpy as np
>>> vertices = np.array([[0, 0], [0.5, 0.2], [1.0, 0.5]])
>>> voltage = Custom2DVoltageIntegral(
...     axis=2,
...     position=0.0,
...     vertices=vertices,
... )

Attributes

axis

position

vertices

Methods

compute_voltage(em_field)

Compute voltage along path defined by a line.

Inherited Common Usage

compute_voltage(em_field)[source]#

Compute voltage along path defined by a line.

Parameters:

em_field (IntegrableMonitorDataType) – The electromagnetic field data that will be used for integrating.

Returns:

Result of voltage computation over remaining dimensions (frequency, time, mode indices).

Return type:

VoltageIntegralResultType