tidy3d.FieldStructureData#

class FieldStructureData[source]#

Bases: _FieldStructureDerivedMixin, AbstractFieldData

Data for a FieldStructureMonitor: matched electric field, permittivity, and per-Yee structure-ownership components on their native Yee grids, plus the derived displacement field, loss current density and absorbed power density.

Parameters:
  • monitor (FieldStructureMonitor) – Field–medium monitor associated with the data.

  • symmetry (tuple[Literal[0, -1, 1], Literal[0, -1, 1], Literal[0, -1, 1]] = (0, 0, 0)) – Symmetry eigenvalues of the original simulation in x, y, and z.

  • symmetry_center (Optional[tuple[float, float, float]] = 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 (Optional[Grid] = 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.

  • Ex (ScalarFieldDataArray) – Spatial distribution of the x-component of the electric field.

  • Ey (ScalarFieldDataArray) – Spatial distribution of the y-component of the electric field.

  • Ez (ScalarFieldDataArray) – Spatial distribution of the z-component of the electric field.

  • eps_xx (ScalarFieldDataArray) – Spatial distribution of the xx-component of the complex relative permittivity, on the Ex Yee grid.

  • eps_yy (ScalarFieldDataArray) – Spatial distribution of the yy-component of the complex relative permittivity, on the Ey Yee grid.

  • eps_zz (ScalarFieldDataArray) – Spatial distribution of the zz-component of the complex relative permittivity, on the Ez Yee grid.

  • structure_index_x (SpatialDataArray) – Owning structure index at each Ex Yee point; -1 for the background medium, -2 for a lumped element or an automatic PEC frame, i for simulation.structures[i].

  • structure_index_y (SpatialDataArray) – Owning structure index at each Ey Yee point; -1 for the background medium, -2 for a lumped element or an automatic PEC frame, i for simulation.structures[i].

  • structure_index_z (SpatialDataArray) – Owning structure index at each Ez Yee point; -1 for the background medium, -2 for a lumped element or an automatic PEC frame, i for simulation.structures[i].

Notes

The stored primitives (Ex/Ey/Ez, eps_xx/eps_yy/eps_zz, structure_index_x/structure_index_y/structure_index_z) are recorded on their native Yee grids. The derived displacement field components Dx/Dy/Dz, loss current density components Jx_loss/Jy_loss/Jz_loss and the absorbed_power_density are computed on demand from the raw self arrays; access the symmetry-expanded quantities via self.symmetry_expanded.

Following PointCloudFieldMonitor, the displacement components are stored in electric-field units, i.e. scaled only by the relative permittivity (D / epsilon_0 = eps_rel * E).

Example

>>> from tidy3d import Grid, ScalarFieldDataArray, SpatialDataArray
>>> from tidy3d.components.grid.grid import Coords
>>> x = [-1,1,3]
>>> y = [-2,0,2,4]
>>> z = [-3,-1,1,3,5]
>>> f = [2e14, 3e14]
>>> coords = dict(x=x[:-1], y=y[:-1], z=z[:-1], f=f)
>>> scoords = dict(x=x[:-1], y=y[:-1], z=z[:-1])
>>> grid = Grid(boundaries=Coords(x=x, y=y, z=z))
>>> fld = ScalarFieldDataArray((1+1j) * np.random.random((2,3,4,2)), coords=coords)
>>> idx = SpatialDataArray(np.zeros((2,3,4)), coords=scoords)
>>> monitor = FieldStructureMonitor(size=(2,4,6), freqs=[2e14, 3e14], name='field_structure')
>>> data = FieldStructureData(
...     monitor=monitor, Ex=fld, Ey=fld, Ez=fld,
...     eps_xx=fld, eps_yy=fld, eps_zz=fld,
...     structure_index_x=idx, structure_index_y=idx, structure_index_z=idx,
...     grid_expanded=grid,
... )

Attributes

monitor

Ex

Ey

Ez

eps_xx

eps_yy

eps_zz

structure_index_x

structure_index_y

structure_index_z

symmetry

symmetry_center

grid_expanded

Methods

normalize(source_spectrum_fn)

Return copy of self with only the electric field components source-normalized.

monitor#
normalize(source_spectrum_fn)[source]#

Return copy of self with only the electric field components source-normalized.

Ex/Ey/Ez are divided by the source spectrum; the permittivity (eps_*) and structure-ownership (structure_index_*) components are intrinsic material properties and left untouched.