|
24 | 24 |
|
25 | 25 |
|
26 | 26 | class AxisAlignedCurrentIntegralSpec(AbstractAxesRH, Box):
|
27 |
| - """Class for specifying the computation of conduction current via Ampère's circuital law on an axis-aligned loop.""" |
| 27 | + """Class for specifying the computation of conduction current via Ampère's circuital law on an axis-aligned loop. |
| 28 | +
|
| 29 | + Example |
| 30 | + ------- |
| 31 | + >>> current_spec = AxisAlignedCurrentIntegralSpec( # doctest: +SKIP |
| 32 | + ... center=(0, 0, 0), |
| 33 | + ... size=(1, 1, 0), |
| 34 | + ... sign="+", |
| 35 | + ... snap_contour_to_grid=True |
| 36 | + ... ) |
| 37 | + """ |
28 | 38 |
|
29 | 39 | _plane_validator = assert_plane()
|
30 | 40 |
|
@@ -215,7 +225,18 @@ def plot(
|
215 | 225 | class Custom2DCurrentIntegralSpec(Custom2DPathIntegralSpec):
|
216 | 226 | """Class for specifying the computation of conduction current via Ampère's circuital law on a custom path.
|
217 | 227 | To compute the current flowing in the positive ``axis`` direction, the vertices should be
|
218 |
| - ordered in a counterclockwise direction.""" |
| 228 | + ordered in a counterclockwise direction. |
| 229 | +
|
| 230 | + Example |
| 231 | + ------- |
| 232 | + >>> import numpy as np |
| 233 | + >>> vertices = np.array([[0, 0], [2, 0], [2, 1], [0, 1], [0, 0]]) |
| 234 | + >>> current_spec = Custom2DCurrentIntegralSpec( # doctest: +SKIP |
| 235 | + ... axis=2, |
| 236 | + ... position=0, |
| 237 | + ... vertices=vertices |
| 238 | + ... ) |
| 239 | + """ |
219 | 240 |
|
220 | 241 | @add_ax_if_none
|
221 | 242 | def plot(
|
@@ -273,6 +294,19 @@ class CompositeCurrentIntegralSpec(Tidy3dBaseModel):
|
273 | 294 |
|
274 | 295 | This class is used to set up a ``CompositeCurrentIntegral``, which combines
|
275 | 296 | multiple current integrals. It does not perform any integration itself.
|
| 297 | +
|
| 298 | + Example |
| 299 | + ------- |
| 300 | + >>> spec1 = AxisAlignedCurrentIntegralSpec( # doctest: +SKIP |
| 301 | + ... center=(0, 0, 0), size=(1, 1, 0), sign="+" |
| 302 | + ... ) |
| 303 | + >>> spec2 = AxisAlignedCurrentIntegralSpec( # doctest: +SKIP |
| 304 | + ... center=(2, 0, 0), size=(1, 1, 0), sign="+" |
| 305 | + ... ) |
| 306 | + >>> composite_spec = CompositeCurrentIntegralSpec( # doctest: +SKIP |
| 307 | + ... path_specs=(spec1, spec2), |
| 308 | + ... sum_spec="sum" |
| 309 | + ... ) |
276 | 310 | """
|
277 | 311 |
|
278 | 312 | path_specs: tuple[Union[AxisAlignedCurrentIntegralSpec, Custom2DCurrentIntegralSpec], ...] = (
|
|
0 commit comments