tidy3d.DistanceUnstructuredGrid#

class DistanceUnstructuredGrid[source]#

Bases: UnstructuredGrid

Adaptive grid based on distance to material interfaces. Currently not recommended for larger simulations.

Parameters:
  • relative_min_dl (NonNegativeFloat = 0.001) – The minimal allowed mesh size relative to the largest dimension of the simulation domain.Use relative_min_dl=0 to remove this constraint.

  • remove_fragments (bool = False) – Whether to remove fragments before meshing. This is useful when overlapping structures generate internal boundaries that can lead to very small cell volumes.

  • 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_interface is enforced.Typically the same as dl_interface or its multiple.

  • distance_bulk (NonNegativeFloat) – [units = um]. Distance from interface outside of which dl_bulk is enforced.Typically twice of dl_bulk or its multiple. Use larger values for a smoother transition from dl_interface to dl_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_interface will be enforced everywhere in the volume.

  • non_refined_structures (tuple[str, ...] = ()) – List of structures for which dl_interface will not be enforced. dl_bulk is used instead.

  • mesh_refinements (tuple[Union[GridRefinementRegion, GridRefinementLine], …] = ()) – 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

min_mesh_size

Minimum mesh size used by this grid specification.

dl_interface

dl_bulk

distance_interface

distance_bulk

sampling

uniform_grid_mediums

non_refined_structures

mesh_refinements

relative_min_dl

remove_fragments

Methods

names_exist_bcs()

Error if distance_bulk is less than distance_interface

dl_interface#
dl_bulk#
distance_interface#
distance_bulk#
sampling#
uniform_grid_mediums#
non_refined_structures#
mesh_refinements#
names_exist_bcs()[source]#

Error if distance_bulk is less than distance_interface

property min_mesh_size#

Minimum mesh size used by this grid specification.