MCPcopy Create free account
hub / github.com/NanoComp/meep / EigenModeSource

Class EigenModeSource

python/source.py:409–690  ·  view source on GitHub ↗

This is a subclass of `Source` and has **all of the properties** of `Source` above. However, you normally do not specify a `component`. Instead of `component`, the current source components and amplitude profile are computed by calling MPB to compute the modes, $\\mathbf{u}_{n,\\mat

Source from the content-addressed store, hash-verified

407
408
409class EigenModeSource(Source):
410 """
411 This is a subclass of `Source` and has **all of the properties** of `Source` above.
412 However, you normally do not specify a `component`. Instead of `component`, the
413 current source components and amplitude profile are computed by calling MPB to compute
414 the modes, $\\mathbf{u}_{n,\\mathbf{k}}(\\mathbf{r}) e^{i \\mathbf{k} \\cdot \\mathbf{r}}$,
415 of the dielectric profile in the region given by the `size` and `center` of the
416 source, with the modes computed as if the *source region were repeated periodically in
417 all directions*. If an `amplitude` and/or `amp_func` are supplied, they are
418 *multiplied* by this current profile. The desired eigenmode and other features are
419 specified by the properties shown in `__init__`.
420
421 Eigenmode sources are normalized so that in the case of a time-harmonic simulation
422 with all sources and fields having monochromatic time dependence $e^{-i 2\\pi f_m t}$
423 where $f_m$ is the frequency of the eigenmode, the total time-average power of the
424 fields — the integral of the normal Poynting vector over the entire cross-sectional
425 line or plane — is equal to 1. This convention has two use cases:
426
427 + For [frequency-domain
428 calculations](Python_User_Interface.md#frequency-domain-solver) involving a
429 `ContinuousSource` time dependence, the time-average power of the fields is 1.
430
431 + For time-domain calculations involving a time dependence $W(t)$ which is typically a
432 [Gaussian](#gaussiansource), the amplitude of the fields at frequency $f$ will be
433 multiplied by $\\widetilde W(f)$, the Fourier transform of $W(t)$, while
434 field-bilinear quantities like the [Poynting flux](#flux-spectra) and [energy
435 density](#energy-density-spectra) are multiplied by $|\\widetilde W(f)|^2$. For the
436 particular case of a Gaussian time dependence, the Fourier transform at $f$ can be
437 obtained via the `fourier_transform` class method.
438
439 In either case, the `eig_power` method returns the total power at frequency `f`.
440 However, for a user-defined [`CustomSource`](#customsource), `eig_power` will *not*
441 include the $|\\widetilde W(f)|^2$ factor since Meep does not know the Fourier
442 transform of your source function $W(t)$. You will have to multiply by this yourself
443 if you need it.
444
445 **Note:** Due to discretization effects, the normalization of eigenmode sources to
446 yield unit power transmission is only approximate: at any finite resolution, the power
447 of the fields as measured using [DFT flux](#flux-spectra) monitors will not precisely
448 match that of calling `eig_power` but will rather include discretization errors that
449 decrease with resolution. Generally, the most reliable procedure is to normalize your
450 calculations by the power computed in a separate normalization run at the same
451 resolution, as shown in several of the tutorial examples.
452
453 Note that Meep's MPB interface only supports dispersionless non-magnetic materials but
454 it does support anisotropic $\\varepsilon$. Any nonlinearities, magnetic responses $\\mu$,
455 conductivities $\\sigma$, or dispersive polarizations in your materials will be *ignored* when
456 computing the eigenmode source. PML will also be ignored.
457
458 The `SourceTime` object (`Source.src`), which specifies the time dependence of the
459 source, can be one of `ContinuousSource`, `GaussianSource` or `CustomSource`.
460 """
461
462 def __init__(
463 self,
464 src,
465 center=None,
466 volume=None,

Callers 2

Calls

no outgoing calls

Tested by 2