tidy3d.EMEExplicitGrid#
- class EMEExplicitGrid[source]#
Bases:
EMEGridSpec
EME grid with explicitly defined internal boundaries.
- Parameters:
attrs (dict = {}) – Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields,
attrs
are mutable. For example, the following is allowed for setting anattr
obj.attrs['foo'] = bar
. Also note that Tidy3D` will raise aTypeError
ifattrs
contain objects that can not be serialized. One can check ifattrs
are serializable by callingobj.json()
.mode_specs (List[EMEModeSpec]) – Mode specifications for each cell in the explicit EME grid.
boundaries (ArrayLike[dtype=float, ndim=1]) – List of coordinates of internal cell boundaries along the propagation axis. Must contain one fewer item than ‘mode_specs’, and must be strictly increasing. Each cell spans the region between an adjacent pair of boundaries. The first (last) cell spans the region between the first (last) boundary and the simulation boundary.
Example
>>> from tidy3d import EMEExplicitGrid, EMEModeSpec >>> mode_spec1 = EMEModeSpec(num_modes=10) >>> mode_spec2 = EMEModeSpec(num_modes=20) >>> eme_grid = EMEExplicitGrid( ... mode_specs=[mode_spec1, mode_spec2], ... boundaries=[1], ... )
Attributes
Methods
make_grid
(center, size, axis)Generate EME grid from the EME grid spec.
Inherited Common Usage
- mode_specs#
- boundaries#
- make_grid(center, size, axis)[source]#
Generate EME grid from the EME grid spec.
- Parameters:
center (
Coordinate
) – Center of the EME simulation.size (
Size
) – Size of the EME simulation.axis (
Axis
) – Propagation axis for the EME simulation.
- Returns:
An EME grid dividing the EME simulation into cells, as defined by the EME grid spec.
- Return type:
- __hash__()#
Hash method.