tidy3d.plugins.microwave.CustomPathIntegral2D#
- class CustomPathIntegral2D[source]#
Bases:
AbstractAxesRHClass for defining a custom path integral defined as a curve on an axis-aligned plane.
- 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,
attrsare mutable. For example, the following is allowed for setting anattrobj.attrs['foo'] = bar. Also note that Tidy3D` will raise aTypeErrorifattrscontain objects that can not be serialized. One can check ifattrsare serializable by callingobj.json().axis (Literal[0, 1, 2] = 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
Given a set of vertices \(\vec{r}_i\), this class approximates path integrals over vector fields of the form \(\int{\vec{F} \cdot \vec{dl}}\) as \(\sum_i{\vec{F}(\vec{r}_i) \cdot \vec{dl}_i}\), where the differential length \(\vec{dl}\) is approximated using central differences \(\vec{dl}_i = \frac{\vec{r}_{i+1} - \vec{r}_{i-1}}{2}\). If the path is not closed, forward and backward differences are used at the endpoints.
Attributes
Helper to get the geometric bounding box of the path integral.
Returns
truewhen the first vertex equals the last vertex.Axis for performing integration.
Methods
compute_integral(field,Β em_field)Computes the path integral defined by
verticesgiven the inputem_field.from_circular_path(center,Β radius,Β ...)Creates a
CustomPathIntegral2Dfrom a circular path given a desired number of points along the perimeter.Inherited Common Usage
- axis#
- position#
- vertices#
- compute_integral(field, em_field)[source]#
Computes the path integral defined by
verticesgiven the inputem_field.- Parameters:
field (
FieldParameter) β Can take the value of"E"or"H". Determines whether to perform the integral over electric or magnetic field.em_field (
MonitorDataTypes) β The electromagnetic field data that will be used for integrating.
- Returns:
Result of integral over remaining dimensions (frequency, time, mode indices).
- Return type:
IntegralResultTypes
- classmethod from_circular_path(center, radius, num_points, normal_axis, clockwise)[source]#
Creates a
CustomPathIntegral2Dfrom a circular path given a desired number of points along the perimeter.- Parameters:
center (Coordinate) β The center of the circle.
radius (float) β The radius of the circle.
num_points (int) β THe number of equidistant points to use along the perimeter of the circle.
normal_axis (Axis) β The axis normal to the defined circle.
clockwise (bool) β When
True, the points will be ordered clockwise with respect to the positive direction of thenormal_axis.
- Returns:
A path integral defined on a circular path.
- Return type:
- property is_closed_contour#
Returns
truewhen the first vertex equals the last vertex.
- property main_axis#
Axis for performing integration.
- property bounds#
Helper to get the geometric bounding box of the path integral.
- __hash__()#
Hash method.