tidy3d.components.medium.AbstractCustomMedium#
- class AbstractCustomMedium[source]#
Bases:
AbstractMedium
,ABC
A spatially varying medium.
- Parameters:
name (Attribute:
name
) –Type
Optional[str]
Default
= None
Description
Optional unique name for medium.
frequency_range (Attribute:
frequency_range
) –Type
Optional[Tuple[float, float]]
Default
= None
Units
(Hz, Hz)
Description
Optional range of validity for the medium.
allow_gain (Attribute:
allow_gain
) –Type
bool
Default
= False
Description
Allow the medium to be active. Caution: simulations with a gain medium are unstable, and are likely to diverge.Simulations where ‘allow_gain’ is set to ‘True’ will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.
nonlinear_spec (Attribute:
nonlinear_spec
) –Type
Union[NonlinearSpec, NonlinearSusceptibility]
Default
= None
Description
Nonlinear spec applied on top of the base medium properties.
modulation_spec (Attribute:
modulation_spec
) –Type
Optional[ModulationSpec]
Default
= None
Description
Modulation spec applied on top of the base medium properties.
heat_spec (Attribute:
heat_spec
) –Type
Union[FluidSpec, SolidSpec, NoneType]
Default
= None
Description
Specification of the medium heat properties. They are used for solving the heat equation via the
HeatSimulation
interface. Such simulations can be used for investigating the influence of heat propagation on the properties of optical systems. Once the temperature distribution in the system is found usingHeatSimulation
object,Simulation.perturbed_mediums_copy()
can be used to convert mediums with perturbation models defined into spatially dependent custom mediums. Otherwise, theheat_spec
does not directly affect the running of an opticalSimulation
.interp_method (Attribute:
interp_method
) –Type
Literal[‘nearest’, ‘linear’]
Default
= nearest
Description
Interpolation method to obtain permittivity values that are not supplied at the Yee grids; For grids outside the range of the supplied data, extrapolation will be applied. When the extrapolated value is smaller (greater) than the minimal (maximal) of the supplied data, the extrapolated value will take the minimal (maximal) of the supplied data.
subpixel (Attribute:
subpixel
) –Type
bool
Default
= False
Description
If
True
and simulation’ssubpixel
is alsoTrue
, applies subpixel averaging of the permittivity on the interface of the structure, including exterior boundary and intersection interfaces with other structures.
Attributes
The medium is isotropic or anisotropic.
Methods
eps_comp_on_grid
(row, col, frequency, coords)Spatial profile of a single component of the complex-valued permittivity tensor at
frequency
interpolated at the supplied coordinates.eps_dataarray_freq
(frequency)Permittivity array at
frequency
.eps_diagonal
(frequency)Main diagonal of the complex-valued permittivity tensor at
frequency
.eps_diagonal_on_grid
(frequency, coords)Spatial profile of main diagonal of the complex-valued permittivity at
frequency
interpolated at the supplied coordinates.eps_model
(frequency)Complex-valued spatially averaged permittivity as a function of frequency.
sel_inside
(bounds)Return a new medium that contains the minimal amount data necessary to cover a spatial region defined by
bounds
.- interp_method#
- subpixel#
- abstract property is_isotropic#
The medium is isotropic or anisotropic.
- abstract eps_dataarray_freq(frequency)[source]#
Permittivity array at
frequency
.- Parameters:
frequency (float) – Frequency to evaluate permittivity at (Hz).
- Returns:
The permittivity evaluated at
frequency
.- Return type:
- eps_diagonal_on_grid(frequency, coords)[source]#
Spatial profile of main diagonal of the complex-valued permittivity at
frequency
interpolated at the supplied coordinates.- Parameters:
frequency (float) – Frequency to evaluate permittivity at (Hz).
coords (
Coords
) – The grid point coordinates over which interpolation is performed.
- Returns:
The complex-valued permittivity tensor at
frequency
interpolated at the supplied coordinate.- Return type:
Tuple[ArrayComplex3D, ArrayComplex3D, ArrayComplex3D]
- eps_comp_on_grid(row, col, frequency, coords)[source]#
Spatial profile of a single component of the complex-valued permittivity tensor at
frequency
interpolated at the supplied coordinates.- Parameters:
row (int) – Component’s row in the permittivity tensor (0, 1, or 2 for x, y, or z respectively).
col (int) – Component’s column in the permittivity tensor (0, 1, or 2 for x, y, or z respectively).
frequency (float) – Frequency to evaluate permittivity at (Hz).
coords (
Coords
) – The grid point coordinates over which interpolation is performed.
- Returns:
Single component of the complex-valued permittivity tensor at
frequency
interpolated at the supplied coordinates.- Return type:
ArrayComplex3D
- eps_model(frequency)[source]#
Complex-valued spatially averaged permittivity as a function of frequency.
- eps_diagonal(frequency)[source]#
Main diagonal of the complex-valued permittivity tensor at
frequency
. Spatially, we take max{||eps||}, so that autoMesh generation works appropriately.
- sel_inside(bounds)[source]#
Return a new medium that contains the minimal amount data necessary to cover a spatial region defined by
bounds
.- Parameters:
bounds (Tuple[float, float, float], Tuple[float, float float]) – Min and max bounds packaged as
(minx, miny, minz), (maxx, maxy, maxz)
.- Returns:
Medium with reduced data.
- Return type:
- __hash__()#
Hash method.