Skip to content

flex_rf.tidy3d.Custom2DPathIntegral

Type: class Base(s): Custom2DPathIntegralSpec

Class for defining a custom path integral defined as a curve on an axis-aligned plane.

Given a set of vertices ri\vec{r}_i, this class approximates path integrals over vector fields of the form Fdl\int{\vec{F} \cdot \vec{dl}} as iF(ri)dli\sum_i{\vec{F}(\vec{r}_i) \cdot \vec{dl}_i}, where the differential length dl\vec{dl} is approximated using central differences dli=ri+1ri12\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.

import numpy as np
vertices = np.array([[0, 0], [1, 0], [1, 1], [0, 1]])
path = Custom2DPathIntegral(
axis=2,
position=0.5,
vertices=vertices,
)
axis [Axis]

Specifies dimension of the planar axis (0,1,2) -> (x,y,z).

position [float]

Position of the plane along the axis.

vertices [ArrayFloat2D]

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]

compute_integral(field: FieldParameter, em_field: IntegrableMonitorDataType)

Computes the path integral defined by vertices given the input em_field.