tidy3d.EMECompositeGrid#

class EMECompositeGrid[source]#

Bases: EMEGridSpec

EME grid made out of multiple subgrids.

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 an attr obj.attrs['foo'] = bar. Also note that Tidy3D` will raise a TypeError if attrs contain objects that can not be serialized. One can check if attrs are serializable by calling obj.json().

  • subgrids (ForwardRef('List[annotate_type(EMESubgridType)]')) – Subgrids in the composite grid.

  • subgrid_boundaries (List[float]) – List of coordinates of internal subgrid boundaries along the propagation axis. Must contain one fewer item than ‘subgrids’, and must be strictly increasing. Each subgrid spans the region between an adjacent pair of subgrid boundaries. The first (last) subgrid spans the region between the first (last) subgrid boundary and the simulation boundary.

Example

>>> from tidy3d import EMEUniformGrid, EMEModeSpec
>>> mode_spec1 = EMEModeSpec(num_modes=10)
>>> mode_spec2 = EMEModeSpec(num_modes=20)
>>> subgrid1 = EMEUniformGrid(num_cells=5, mode_spec=mode_spec1)
>>> subgrid2 = EMEUniformGrid(num_cells=10, mode_spec=mode_spec2)
>>> eme_grid = EMECompositeGrid(
...     subgrids=[subgrid1, subgrid2],
...     subgrid_boundaries=[1]
... )

Attributes

attrs

Methods

make_grid(center, size, axis)

Generate EME grid from the EME grid spec.

subgrid_bounds(center, size, axis)

Subgrid bounds: a list of pairs (rmin, rmax) of the bounds of the subgrids along the propagation axis.

Inherited Common Usage

subgrids#
subgrid_boundaries#
subgrid_bounds(center, size, axis)[source]#

Subgrid bounds: a list of pairs (rmin, rmax) of the bounds of the subgrids along the propagation axis.

Parameters:
  • center (Coordinate) – Center of the EME simulation.

  • size (Size) – Size of the EME simulation.

  • axis (Axis) – Propagation axis for the EME simulation.

Returns:

A list of pairs (rmin, rmax) of the bounds of the subgrids along the propagation axis.

Return type:

List[Tuple[float, float]]

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:

EMEGrid

__hash__()#

Hash method.