tidy3d.EMEUniformGrid#
- class EMEUniformGrid[source]#
Bases:
EMEGridSpec
Specification for a uniform EME grid.
- 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()
.num_reps (PositiveInt = 1) – Number of periodic repetitions of this EME grid. Useful for efficiently simulating long periodic structures like Bragg gratings. Instead of explicitly repeating the cells, setting ‘num_reps’ allows the EME solver to reuse the modes and cell interface scattering matrices.
name (Optional[str] = None) – Name of this ‘EMEGridSpec’. Used in ‘EMEPeriodicitySweep’.
num_cells (PositiveInt) – Number of cells in the uniform EME grid.
mode_spec (EMEModeSpec) – Mode specification for the uniform EME grid.
Example
>>> from tidy3d import EMEModeSpec >>> mode_spec = EMEModeSpec(num_modes=10) >>> eme_grid = EMEUniformGrid(num_cells=10, mode_spec=mode_spec)
Attributes
Number of real cells in this EME grid spec.
Methods
make_grid
(center, size, axis)Generate EME grid from the EME grid spec.
Inherited Common Usage
- num_cells#
- mode_spec#
- 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:
- property num_real_cells#
Number of real cells in this EME grid spec.
- __hash__()#
Hash method.