tidy3d.CustomGrid#

class tidy3d.CustomGrid#

Custom 1D grid supplied as a list of grid cell sizes centered on the simulation center.

Parameters

dl (Tuple[PositiveFloat, ...]) – [units = um]. An array of custom nonuniform grid sizes. The resulting grid is centered on the simulation center such that it spans the region (center - sum(dl)/2, center + sum(dl)/2). Note: if supplied sizes do not cover the simulation size, the first and last sizes are repeated to cover the simulation domain.

Example

>>> grid_1d = CustomGrid(dl=[0.2, 0.2, 0.1, 0.1, 0.1, 0.2, 0.2])

Show JSON schema
{
   "title": "CustomGrid",
   "description": "Custom 1D grid supplied as a list of grid cell sizes centered on the simulation center.\n\nParameters\n----------\ndl : Tuple[PositiveFloat, ...]\n    [units = um].  An array of custom nonuniform grid sizes. The resulting grid is centered on the simulation center such that it spans the region ``(center - sum(dl)/2, center + sum(dl)/2)``. Note: if supplied sizes do not cover the simulation size, the first and last sizes are repeated to cover the simulation domain.\n\nExample\n-------\n>>> grid_1d = CustomGrid(dl=[0.2, 0.2, 0.1, 0.1, 0.1, 0.2, 0.2])",
   "type": "object",
   "properties": {
      "type": {
         "title": "Type",
         "default": "CustomGrid",
         "enum": [
            "CustomGrid"
         ],
         "type": "string"
      },
      "dl": {
         "title": "Customized grid sizes.",
         "description": "An array of custom nonuniform grid sizes. The resulting grid is centered on the simulation center such that it spans the region ``(center - sum(dl)/2, center + sum(dl)/2)``. Note: if supplied sizes do not cover the simulation size, the first and last sizes are repeated to cover the simulation domain.",
         "units": "um",
         "type": "array",
         "items": {
            "type": "number",
            "exclusiveMinimum": 0
         }
      }
   },
   "required": [
      "dl"
   ],
   "additionalProperties": false
}

attribute dl: Tuple[pydantic.types.PositiveFloat, ...] [Required]#

An array of custom nonuniform grid sizes. The resulting grid is centered on the simulation center such that it spans the region (center - sum(dl)/2, center + sum(dl)/2). Note: if supplied sizes do not cover the simulation size, the first and last sizes are repeated to cover the simulation domain.