tidy3d.plugins.invdes.TopologyDesignRegion#
- class TopologyDesignRegion[source]#
Bases:
DesignRegionDesign 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,
attrsare mutable. For example, the following is allowed for setting anattrobj.attrs['foo'] = bar. Also note that Tidy3D` will raise aTypeErrorifattrscontain objects that can not be serialized. One can check ifattrsare 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
transformationsare applied. Penalty weights can be set inside of the penalties directly through the.weightfield.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_dlis leftNone, thepixel_sizewill 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_dldirectly 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_structureto theJaxSimulation.grid_speccorresponding to this design region. If leftNone,invdeswill 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. SupplyingFalsewill completely leave out the override structure.
Attributes
Coordinates for the custom medium corresponding to this design region.
Generate mesh override structure for this
DesignRegionusingpixel_sizestep.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_sizeand 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
DesignRegioninto 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_sizeand 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
DesignRegionusingpixel_sizestep.
- 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.