tidy3d.EMECoefficientMonitor#

class EMECoefficientMonitor[source]#

Bases: EMEMonitor

EME monitor for mode coefficients and related quantities.

Parameters:
  • center (Optional[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]]] = None) – [units = um]. Center of object in x, y, and z.

  • size (tuple[Union[NonNegativeFloat, autograd.tracer.Box], Union[NonNegativeFloat, autograd.tracer.Box], Union[NonNegativeFloat, autograd.tracer.Box]]) – [units = um]. Size in x, y, and z directions.

  • name (str) – Unique name for monitor.

  • freqs (Optional[ArrayLike[dtype=float, ndim=1]] = None) – Frequencies at which the monitor will record. Must be a subset of the simulation ‘freqs’. A value of ‘None’ will record at all simulation ‘freqs’.

  • num_modes (Optional[NonNegativeInt] = None) – Maximum number of modes for the monitor to record. Cannot exceed the greatest number of modes in any EME cell. A value of ‘None’ will record all modes.

  • num_sweep (Optional[NonNegativeInt] = 1) – Number of sweep indices for the monitor to record. Cannot exceed the number of sweep indices for the simulation. If the sweep does not change the monitor data, the sweep index will be omitted. A value of ‘None’ will record all sweep indices.

  • interval_space (tuple[Literal[1], Literal[1], Literal[1]] = (1, 1, 1)) – Number of grid step intervals between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the first and last point of the monitor grid are always included. Not all monitors support values different from 1. Note: This field is not used for ‘EMECoefficientMonitor’.

  • eme_cell_interval_space (PositiveInt = 1) – Number of EME cells between monitor recordings. If equal to 1, there will be no downsampling. If greater than 1, the step will be applied, but the first and last cells are always included. Not used in all monitors. Not all monitors support values different from 1.

  • colocate (Literal[True] = True) – Defines whether fields are colocated to grid cell boundaries (i.e. to the primal grid) on-the-fly during a solver run. Can be toggled for field recording monitors and is hard-coded for other monitors depending on their specific function.

  • fields (tuple[Literal['A', 'B', 'n_complex', 'flux', 'interface_smatrices', 'overlaps'], ...] = ('A', 'B')) – Collection of coefficient fields to store in the monitor. Available fields: ‘A’ (forward mode coefficients), ‘B’ (backward mode coefficients), ‘n_complex’ (propagation indices), ‘flux’ (power flux), ‘interface_smatrices’ (S matrices at cell interfaces), ‘overlaps’ (mode overlaps).

Notes

Records the amplitudes of the forward (A) and backward (B) modes in each cell intersecting the monitor geometry. Additional fields can be recorded by including them in the fields parameter: propagation indices (n_complex), power flux (flux), interface S matrices (interface_smatrices), and mode overlaps (overlaps).

Example

>>> monitor = EMECoefficientMonitor(
...     center=(1,2,3),
...     size=(2,2,2),
...     freqs=[300e12],
...     num_modes=2,
...     fields=['A', 'B'],
...     name="eme_coeffs"
... )

Attributes

fields

interval_space

eme_cell_interval_space

freqs

num_modes

num_sweep

colocate

name

size

center

Methods

storage_size(num_cells, ...)

Size of monitor storage given the number of points after discretization.

Inherited Common Usage

fields#
interval_space#
eme_cell_interval_space#
storage_size(num_cells, num_transverse_cells, num_eme_cells, num_virtual_eme_cells, num_freqs, num_modes, sweep_spec)[source]#

Size of monitor storage given the number of points after discretization.