Skip to content

flex_rf.tidy3d.ModeSolverData

Type: class Base(s): ModeData

Data associated with a ModeSolverMonitor: scalar components of E and H fields.

The data is stored as a DataArray object using the xarray package.

from tidy3d import ModeSpec
from tidy3d import ScalarModeFieldDataArray, ModeIndexDataArray
x = [-1,1,3]
y = [-2,0]
z = [-3,-1,1,3,5]
f = [2e14, 3e14]
mode_index = np.arange(5)
grid = Grid(boundaries=Coords(x=x, y=y, z=z))
field_coords = dict(x=x[:-1], y=y[:-1], z=z[:-1], f=f, mode_index=mode_index)
field = ScalarModeFieldDataArray((1+1j)*np.random.random((2,1,4,2,5)), coords=field_coords)
index_coords = dict(f=f, mode_index=mode_index)
index_data = ModeIndexDataArray((1+1j) * np.random.random((2,5)), coords=index_coords)
monitor = ModeSolverMonitor(
size=(2,0,6),
freqs=[2e14, 3e14],
mode_spec=ModeSpec(num_modes=5),
name='mode_solver',
)
data = ModeSolverData(
monitor=monitor,
Ex=field,
Ey=field,
Ez=field,
Hx=field,
Hy=field,
Hz=field,
n_complex=index_data,
grid_expanded=grid
)
n_complex [ModeIndexDataArray]

Complex-valued effective propagation constants associated with the mode.

monitor [ModeSolverMonitor]

Mode solver monitor associated with the data.

Ex [ScalarModeFieldDataArray | None] = None

Spatial distribution of the x-component of the electric field of the mode.

Ey [ScalarModeFieldDataArray | None] = None

Spatial distribution of the y-component of the electric field of the mode.

Ez [ScalarModeFieldDataArray | None] = None

Spatial distribution of the z-component of the electric field of the mode.

Hx [ScalarModeFieldDataArray | None] = None

Spatial distribution of the x-component of the magnetic field of the mode.

Hy [ScalarModeFieldDataArray | None] = None

Spatial distribution of the y-component of the magnetic field of the mode.

Hz [ScalarModeFieldDataArray | None] = None

Spatial distribution of the z-component of the magnetic field of the mode.

symmetry [tuple[Symmetry, Symmetry, Symmetry]] = (0, 0, 0)

Symmetry eigenvalues of the original simulation in x, y, and z.

symmetry_center [Coordinate | None] = None

Center of the symmetry planes of the original simulation in x, y, and z. Required only if any of the symmetry field are non-zero.

grid_expanded [Grid | None] = None

Grid discretization of the associated monitor in the simulation which created the data. Required if symmetries are present, as well as in order to use some functionalities like getting Poynting vector and flux.

grid_primal_correction [GRID_CORRECTION_TYPE] = 1.0

Correction factor that needs to be applied for data corresponding to a 2D monitor to take into account the finite grid in the normal direction in the simulation in which the data was computed. The factor is applied to fields defined on the primal grid locations along the normal direction.

grid_dual_correction [GRID_CORRECTION_TYPE] = 1.0

Correction factor that needs to be applied for data corresponding to a 2D monitor to take into account the finite grid in the normal direction in the simulation in which the data was computed. The factor is applied to fields defined on the dual grid locations along the normal direction.

n_group_raw [GroupIndexDataArray | None] = None

Index associated with group velocity of the mode.

dispersion_raw [ModeDispersionDataArray | None] = None

Dispersion parameter for the mode.

eps_spec [list[EpsSpecType] | None] = None

Characterization of the permittivity profile on the plane where modes are computed. Possible values are ‘diagonal’, ‘tensorial_real’, ‘tensorial_complex’.

amps [ModeAmpsDataArray | None] = None

Unused for ModeSolverData.

grid_distances_primal [tuple[float] | tuple[float, float]] = (0.0,)

Relative distances to the primal grid locations along the normal direction in the original simulation grid. Needed to recalculate grid corrections after interpolating in frequency.

grid_distances_dual [tuple[float] | tuple[float, float]] = (0.0,)

Relative distances to the dual grid locations along the normal direction in the original simulation grid. Needed to recalculate grid corrections after interpolating in frequency.

log [str | None] = None

A string containing the log information from the mode solver run.

interpolated_copy [ModeSolverData]

Return a copy of the data with interpolated fields.

interp_in_freq(freqs: FreqArray, method: Literal['linear', 'cubic', 'poly'] = 'linear', renormalize: bool = True, recalculate_grid_correction: bool = True, assume_sorted: bool = False)

Interpolate mode data to new frequency points.