tidy3d.rf.Custom2DCurrentIntegralSpec#
- class Custom2DCurrentIntegralSpec[source]#
Bases:
Custom2DPathIntegralSpecClass for specifying the computation of conduction current via Ampère’s circuital law on a custom path. To compute the current flowing in the positive
axisdirection, the vertices should be ordered in a counterclockwise direction.- 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]) – 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]
Example
>>> import numpy as np >>> vertices = np.array([[0, 0], [2, 0], [2, 1], [0, 1], [0, 0]]) >>> current_spec = Custom2DCurrentIntegralSpec( ... axis=2, ... position=0, ... vertices=vertices ... )
Attributes
Methods
plot([x, y, z, ax])Plot path integral at single (x,y,z) coordinate.
Inherited Common Usage
- plot(x=None, y=None, z=None, ax=None, **path_kwargs)[source]#
Plot path integral at single (x,y,z) coordinate.
- Parameters:
x (float = None) – Position of plane in x direction, only one of x,y,z can be specified to define plane.
y (float = None) – Position of plane in y direction, only one of x,y,z can be specified to define plane.
z (float = None) – Position of plane in z direction, only one of x,y,z can be specified to define plane.
ax (matplotlib.axes._subplots.Axes = None) – Matplotlib axes to plot on, if not specified, one is created.
**path_kwargs – Optional keyword arguments passed to the matplotlib plotting of the line. For details on accepted values, refer to Matplotlib’s documentation.
- Returns:
The supplied or created matplotlib axes.
- Return type:
matplotlib.axes._subplots.Axes
- __hash__()#
Hash method.