tidy3d.DistanceUnstructuredGrid#
- class DistanceUnstructuredGrid[source]#
Bases:
UnstructuredGridAdaptive grid based on distance to material interfaces. Currently not recommended for larger simulations.
- 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().relative_min_dl (NonNegativeFloat = 0.001) β The minimal allowed mesh size relative to the largest dimension of the simulation domain.Use
relative_min_dl=0to remove this constraint.dl_interface (PositiveFloat) β [units = um]. Grid size near material interfaces.
dl_bulk (PositiveFloat) β [units = um]. Grid size away from material interfaces.
distance_interface (NonNegativeFloat) β [units = um]. Distance from interface within which
dl_interfaceis enforced.Typically the same asdl_interfaceor its multiple.distance_bulk (NonNegativeFloat) β [units = um]. Distance from interface outside of which
dl_bulkis enforced.Typically twice ofdl_bulkor its multiple. Use larger values for a smoother transition fromdl_interfacetodl_bulk.sampling (PositiveFloat = 100) β An internal advanced parameter that defines number of sampling points per surface when computing distance values.
uniform_grid_mediums (Tuple[str, ...] = ()) β List of mediums for which
dl_interfacewill be enforced everywhere in the volume.non_refined_structures (Tuple[str, ...] = ()) β List of structures for which
dl_interfacewill not be enforced.dl_bulkis used instead.mesh_refinements (Tuple[Annotated[Union[tidy3d.components.tcad.grid.GridRefinementRegion, tidy3d.components.tcad.grid.GridRefinementLine], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()) β List of regions/lines for which the mesh refinement will be applied
Example
>>> heat_grid = DistanceUnstructuredGrid( ... dl_interface=0.1, ... dl_bulk=1, ... distance_interface=0.3, ... distance_bulk=2, ... )
Attributes
Methods
names_exist_bcs(val,Β values)Error if distance_bulk is less than distance_interface
Inherited Common Usage
- dl_interface#
- dl_bulk#
- distance_interface#
- distance_bulk#
- sampling#
- uniform_grid_mediums#
- non_refined_structures#
- mesh_refinements#
- classmethod names_exist_bcs(val, values)[source]#
Error if distance_bulk is less than distance_interface
- __hash__()#
Hash method.