tidy3d.plugins.invdes.TopologyDesignRegion#

class TopologyDesignRegion[source]#

Bases: DesignRegion

Design region as a pixellated permittivity 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 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().

  • size (Tuple[PositiveFloat, PositiveFloat, PositiveFloat]) – [units = um]. Size in x, y, and z directions.

  • center (Tuple[float, float, float]) – [units = um]. Center of object in x, y, and z.

  • eps_bounds (Tuple[float, float]) – Minimum and maximum relative permittivity expressed to the design region.

  • transformations (Tuple[FilterProject, ...] = ()) – Transformations that get applied from first to last on the parameter array.The end result of the transformations should be the material density of the design region . With floating point values between (0, 1), 0 corresponds to the minimum relative permittivity and 1 corresponds to the maximum relative permittivity. Specific permittivity values given the density array are determined by eps_bounds.

  • penalties (Tuple[ErosionDilationPenalty, ...] = ()) – Set of penalties that get evaluated on the material density. Note that the penalties are applied after transformations are applied. Penalty weights can be set inside of the penalties directly through the .weight field.

  • pixel_size (PositiveFloat) – Pixel size of the design region in x, y, z. For now, we only support the same pixel size in all 3 dimensions. If TopologyDesignRegion.override_structure_dl is left None, the pixel_size will determine the FDTD mesh size in the design region. Therefore, if your pixel size is large compared to the FDTD grid size, we recommend setting the override_structure_dl directly to a value on the same order as the grid size.

  • override_structure_dl (Union[PositiveFloat, Literal[False]] = None) – Defines grid size when adding an override_structure to the JaxSimulation.grid_spec corresponding to this design region. If left None, invdes will mesh the simulation with the same resolution as the pixel_size. This is advised if the pixel size is relatively close to the FDTD grid size. Supplying False will completely leave out the override structure.

Attributes

coords

Coordinates for the custom medium corresponding to this design region.

mesh_override_structure

Generate mesh override structure for this DesignRegion using pixel_size step.

params_half

Convenience for generating random parameters of all 0.5 values with correct shape.

params_ones

Convenience for generating random parameters of all 1 values with correct shape.

params_random

Convenience for generating random parameters between (0,1) with correct shape.

params_shape

Shape of the parameters array in (x, y, z), given the pixel_size and bounds.

params_zeros

Convenience for generating random parameters of all 0 values with correct shape.

attrs

Methods

eps_values(params)

Values for the custom medium permittivity.

evaluate_penalty(penalty, material_density)

Evaluate an erosion-dilation penalty, passing in pixel_size.

evaluate_transformation(transformation, params)

Evaluate a transformation, passing in design_region_dl.

params_uniform(value)

Make an array of parameters with all the same value.

to_jax_structure(params)

Convert this DesignRegion into a custom JaxStructure.

Inherited Common Usage

pixel_size#
transformations#
penalties#
override_structure_dl#
property params_shape#

Shape of the parameters array in (x, y, z), given the pixel_size and bounds.

params_uniform(value)[source]#

Make an array of parameters with all the same value.

property params_random#

Convenience for generating random parameters between (0,1) with correct shape.

property params_zeros#

Convenience for generating random parameters of all 0 values with correct shape.

property params_half#

Convenience for generating random parameters of all 0.5 values with correct shape.

property params_ones#

Convenience for generating random parameters of all 1 values with correct shape.

property coords#

Coordinates for the custom medium corresponding to this design region.

eps_values(params)[source]#

Values for the custom medium permittivity.

to_jax_structure(params)[source]#

Convert this DesignRegion into a custom JaxStructure.

property mesh_override_structure#

Generate mesh override structure for this DesignRegion using pixel_size step.

evaluate_transformation(transformation, params)[source]#

Evaluate a transformation, passing in design_region_dl.

evaluate_penalty(penalty, material_density)[source]#

Evaluate an erosion-dilation penalty, passing in pixel_size.

__hash__()#

Hash method.