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 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()
.size (Tuple[NonNegativeFloat, NonNegativeFloat, NonNegativeFloat]) โ [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[ConstrainedFloatValue, ConstrainedFloatValue]) โ 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.initialization_spec (Union[RandomInitializationSpec, UniformInitializationSpec, CustomInitializationSpec] = UniformInitializationSpec(attrs={}, type='UniformInitializationSpec', value=0.5)) โ Specification of how to initialize the parameters in the design region.
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 leftNone
, thepixel_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 theoverride_structure_dl
directly to a value on the same order as the grid size.uniform (Tuple[bool, bool, bool] = (False, False, True)) โ Axes along which the design should be uniform. By default, the structure is assumed to be uniform, i.e. invariant, in the z direction.
override_structure_dl (Union[PositiveFloat, Literal[False]] = None) โ Defines grid size when adding an
override_structure
to theJaxSimulation.grid_spec
corresponding to this design region. If leftNone
,invdes
will mesh the simulation with the same resolution as thepixel_size
. This is advised if the pixel size is relatively close to the FDTD grid size. SupplyingFalse
will completely leave out the override structure.
Attributes
Coordinates for the custom medium corresponding to this design region.
Generate mesh override structure for this
DesignRegion
usingpixel_size
step.Convenience for generating random parameters of all 0.5 values with correct shape.
Convenience for generating random parameters of all 1 values with correct shape.
Convenience for generating random parameters between (0,1) with correct shape.
Shape of the parameters array in (x, y, z), given the
pixel_size
and bounds.Convenience for generating random parameters of all 0 values with correct shape.
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_structure
(params)Convert this
DesignRegion
into a customStructure
.Inherited Common Usage
- pixel_size#
- uniform#
- transformations#
- penalties#
- override_structure_dl#
- property params_shape#
Shape of the parameters array in (x, y, z), given the
pixel_size
and bounds.
- 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.
- property mesh_override_structure#
Generate mesh override structure for this
DesignRegion
usingpixel_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.