tidy3d.components.grid.grid_spec.GridSpec1d

tidy3d.components.grid.grid_spec.GridSpec1d#

class GridSpec1d[source]#

Bases: Tidy3dBaseModel, ABC

Abstract base class, defines 1D grid generation specifications.

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.

make_coords(axis, structures, symmetry, periodic, wavelength, num_pml_layers, snapping_points, parse_structures_interval_coords=None, parse_structures_max_dl_list=None)[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.

  • periodic (bool) – Apply periodic boundary condition or not. Only relevant for autogrids.

  • 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.

  • parse_structures_interval_coords (np.ndarray, optional) – If not None, pre-computed interval coordinates from parsing structures.

  • parse_structures_max_dl_list (np.ndarray, optional) – If not None, pre-computed maximum grid spacing list from parsing structures.

Returns:

1D coords to be used as grid boundaries.

Return type:

ArrayLike[dtype=float, ndim=1]

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