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

Method __init__

python/source.py:462–572  ·  view source on GitHub ↗

Construct an `EigenModeSource`. + **`eig_band` [`integer` or `DiffractedPlanewave` class]** — Either the index $n$ (1,2,3,...) of the desired band $\\omega_n(\\mathbf{k})$ to compute in MPB where 1 denotes the lowest-frequency band at a given $\\mathbf{k}$ point

(
        self,
        src,
        center=None,
        volume=None,
        eig_lattice_size=None,
        eig_lattice_center=None,
        eig_vol=None,
        component=mp.ALL_COMPONENTS,
        direction=mp.AUTOMATIC,
        eig_band=1,
        eig_kpoint=Vector3(),
        eig_match_freq=True,
        eig_parity=mp.NO_PARITY,
        eig_resolution=0,
        eig_tolerance=1e-12,
        **kwargs,
    )

Source from the content-addressed store, hash-verified

460 """
461
462 def __init__(
463 self,
464 src,
465 center=None,
466 volume=None,
467 eig_lattice_size=None,
468 eig_lattice_center=None,
469 eig_vol=None,
470 component=mp.ALL_COMPONENTS,
471 direction=mp.AUTOMATIC,
472 eig_band=1,
473 eig_kpoint=Vector3(),
474 eig_match_freq=True,
475 eig_parity=mp.NO_PARITY,
476 eig_resolution=0,
477 eig_tolerance=1e-12,
478 **kwargs,
479 ):
480 """
481 Construct an `EigenModeSource`.
482
483 + **`eig_band` [`integer` or `DiffractedPlanewave` class]** — Either the index $n$
484 (1,2,3,...) of the desired band $\\omega_n(\\mathbf{k})$ to compute in MPB where
485 1 denotes the lowest-frequency band at a given $\\mathbf{k}$ point, and so on,
486 or alternatively a diffracted planewave in homogeneous media.
487
488 + **`direction` [`mp.X`, `mp.Y`, or `mp.Z;` default `mp.AUTOMATIC`],
489 `eig_match_freq` [`boolean;` default `True`], `eig_kpoint` [`Vector3`]** — By
490 default (if `eig_match_freq` is `True`), Meep tries to find a mode with the same
491 frequency $\\omega_n(\\mathbf{k})$ as the `src` property (above), by scanning
492 $\\mathbf{k}$ vectors in the given `direction` using MPB's `find_k` functionality.
493 Alternatively, if `eig_kpoint` is supplied, it is used as an initial guess for
494 $\\mathbf{k}$. By default, `direction` is the direction normal to the source region,
495 assuming `size` is $d$–1 dimensional in a $d$-dimensional simulation (e.g. a
496 plane in 3d). If `direction` is set to `mp.NO_DIRECTION`, then `eig_kpoint` is
497 not only the initial guess and the search direction of the $\\mathbf{k}$ vectors, but is
498 also taken to be the direction of the waveguide, allowing you to [launch modes
499 in oblique ridge waveguides](Python_Tutorials/Eigenmode_Source.md#oblique-waveguides)
500 (not perpendicular to the source plane). If `eig_match_freq` is `False`, then the
501 $\\mathbf{k}$ vector of the desired mode is specified with `eig_kpoint` (in Meep units
502 of 2π/(unit length)). Also, the eigenmode frequency computed by MPB overwrites
503 the `frequency` parameter of the `src` property for a `GaussianSource` and
504 `ContinuousSource` but not `CustomSource` (the `width` or any other parameter of
505 `src` is unchanged). By default, the $\\mathbf{k}$ components in the plane of the source
506 region are zero. However, if the source region spans the *entire* cell in some
507 directions, and the cell has Bloch-periodic boundary conditions via the
508 `k_point` parameter, then the mode's $\\mathbf{k}$ components in those directions will
509 match `k_point` so that the mode satisfies the Meep boundary conditions,
510 regardless of `eig_kpoint`. Note that once $\\mathbf{k}$ is either found by MPB, or
511 specified by `eig_kpoint`, the field profile used to create the current sources
512 corresponds to the [Bloch mode](https://en.wikipedia.org/wiki/Bloch_wave),
513 $\\mathbf{u}_{n,\\mathbf{k}}(\\mathbf{r})$, multiplied by the appropriate
514 exponential factor, $e^{i \\mathbf{k} \\cdot \\mathbf{r}}$.
515
516 + **`eig_parity` [`mp.NO_PARITY` (default), `mp.EVEN_Z`, `mp.ODD_Z`, `mp.EVEN_Y`,
517 `mp.ODD_Y`]** — The parity (= polarization in 2d) of the mode to calculate,
518 assuming the structure has $z$ and/or $y$ mirror symmetry *in the source
519 region*, with respect to the `center` of the source region. (In particular, it

Callers

nothing calls this directly

Calls 2

Vector3Class · 0.90
__init__Method · 0.45

Tested by

no test coverage detected