tidy3d.ModeABCBoundary#
- class ModeABCBoundary[source]#
Bases:
AbstractABCBoundary
One-way wave equation absorbing boundary conditions for absorbing a waveguide mode.
- 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()
.name (Optional[str] = None) β Optional unique name for boundary.
mode_spec (ModeSpec = ModeSpec(attrs={}, num_modes=1, target_neff=None, num_pml=(0,, 0), filter_pol=None, angle_theta=0.0, angle_phi=0.0, precision='double', bend_radius=None, bend_axis=None, angle_rotation=False, track_freq='central', group_index_step=False, type='ModeSpec')) β Parameters that determine the modes computed by the mode solver.
mode_index (NonNegativeInt = 0) β Index into the collection of modes returned by mode solver. The absorbing boundary conditions are configured to absorb the specified mode. If larger than
mode_spec.num_modes
,num_modes
in the solver will be set tomode_index + 1
.freq_spec (Union[PositiveFloat, BroadbandModeABCSpec, NoneType] = None) β Specifies the frequency at which field is absorbed. If
None
, then the central frequency of the source is used. IfBroadbandModeABCSpec
, then the field is absorbed over the specified frequency range.plane (Box) β Cross-sectional plane in which the absorbed mode will be computed.
Attributes
Methods
from_monitor
(monitor[,Β mode_index,Β freq_spec])Instantiate from a
ModeMonitor
orModeSolverMonitor
.from_source
(source[,Β freq_spec])Instantiate from a
ModeSource
.is_plane
(val)Raise validation error if not planar.
Inherited Common Usage
- mode_spec#
- mode_index#
- freq_spec#
- plane#
- classmethod from_source(source, freq_spec=None)[source]#
Instantiate from a
ModeSource
.- Parameters:
source (
ModeSource
) β Mode source.freq_spec (Optional[Union[pd.PositiveFloat, BroadbandModeABCSpec]] = None) β Specifies the frequency at which field is absorbed. If
None
, then the central frequency of the source is used. IfBroadbandModeABCSpec
, then the field is absorbed over the specified frequency range.
- Returns:
Boundary conditions for absorbing the desired mode.
- Return type:
Example
>>> from tidy3d import GaussianPulse, ModeSource, inf >>> pulse = GaussianPulse(freq0=200e12, fwidth=20e12) >>> source = ModeSource(size=(1, 1, 0), source_time=pulse, direction='+') >>> abc_boundary = ModeABCBoundary.from_source(source=source)
- classmethod from_monitor(monitor, mode_index=0, freq_spec=None)[source]#
Instantiate from a
ModeMonitor
orModeSolverMonitor
.- Parameters:
monitor (Union[
ModeMonitor
,ModeSolverMonitor
]) β Mode monitor.mode_index (pd.NonNegativeInt = 0) β Mode index.
freq_spec (Optional[Union[pd.PositiveFloat, BroadbandModeABCSpec]] = None) β Specifies the frequency at which field is absorbed. If
None
, then the central frequency of the source is used. IfBroadbandModeABCSpec
, then the field is absorbed over the specified frequency range.
- Returns:
Boundary conditions for absorbing the desired mode.
- Return type:
Example
>>> from tidy3d import ModeMonitor >>> mnt = ModeMonitor(size=(1, 1, 0), freqs=[1e10], name="mnt") >>> abc_boundary = ModeABCBoundary.from_monitor(monitor=mnt, mode_index=0)
- __hash__()#
Hash method.