tidy3d.components.grid.grid_spec.GridSpec1d#
- class GridSpec1d[source]#
Bases:
Tidy3dBaseModel
,ABC
Abstract base class, defines 1D grid generation specifications.
- 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()
.
Attributes
Methods
estimated_min_dl
(wavelength, structure_list, ...)Estimated minimal grid size along the axis.
make_coords
(axis, structures, symmetry, ...)Generate 1D coords to be used as grid boundaries, based on simulation parameters.
Inherited Common Usage
- make_coords(axis, structures, symmetry, periodic, wavelength, num_pml_layers, snapping_points)[source]#
Generate 1D coords to be used as grid boundaries, based on simulation parameters. Symmetry, and PML layers will be treated here.
- Parameters:
axis (Axis) – Axis of this direction.
structures (List[StructureType]) – List of structures present in simulation, the first one being the simulation domain.
symmetry (Tuple[Symmetry, Symmetry, Symmetry]) – Reflection symmetry across a plane bisecting the simulation domain normal to each of the three axes.
wavelength (float) – Free-space wavelength.
num_pml_layers (Tuple[int, int]) – number of layers in the absorber + and - direction along one dimension.
snapping_points (Tuple[CoordinateOptional, ...]) – A set of points that enforce grid boundaries to pass through them.
- Returns:
1D coords to be used as grid boundaries.
- Return type:
Coords1D
- abstract estimated_min_dl(wavelength, structure_list, sim_size)[source]#
Estimated minimal grid size along the axis. The actual minimal grid size from mesher might be smaller.
- Parameters:
wavelength (float) – Wavelength to use for the step size and for dispersive media epsilon.
structure_list (List[Structure]) – List of structures present in the simulation.
sim_size (Tuple[float, 3]) – Simulation domain size.
- Returns:
Estimated minimal grid size from grid specification.
- Return type:
float
- __hash__()#
Hash method.