tidy3d.CustomGrid#

class tidy3d.CustomGrid#

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

Parameters

dl (List[PositiveFloat] = None) – [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 : List[PositiveFloat] = None\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
}

Fields
  • dl (List[pydantic.types.PositiveFloat])

attribute dl: List[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.