tidy3d.YeeGrid#

class tidy3d.YeeGrid#

Holds the yee grid coordinates for each of the E and H positions.

Parameters
  • E (FieldGrid = None) – Coordinates of the locations of all three components of the electric field.

  • H (FieldGrid = None) – Coordinates of the locations of all three components of the magnetic field.

Example

>>> x = np.linspace(-1, 1, 10)
>>> y = np.linspace(-1, 1, 11)
>>> z = np.linspace(-1, 1, 12)
>>> coords = Coords(x=x, y=y, z=z)
>>> field_grid = FieldGrid(x=coords, y=coords, z=coords)
>>> yee_grid = YeeGrid(E=field_grid, H=field_grid)
>>> Ex_coords = yee_grid.E.x

Show JSON schema
{
   "title": "YeeGrid",
   "description": "Holds the yee grid coordinates for each of the E and H positions.\n\nParameters\n----------\nE : FieldGrid = None\n    Coordinates of the locations of all three components of the electric field.\nH : FieldGrid = None\n    Coordinates of the locations of all three components of the magnetic field.\n\nExample\n-------\n>>> x = np.linspace(-1, 1, 10)\n>>> y = np.linspace(-1, 1, 11)\n>>> z = np.linspace(-1, 1, 12)\n>>> coords = Coords(x=x, y=y, z=z)\n>>> field_grid = FieldGrid(x=coords, y=coords, z=coords)\n>>> yee_grid = YeeGrid(E=field_grid, H=field_grid)\n>>> Ex_coords = yee_grid.E.x",
   "type": "object",
   "properties": {
      "E": {
         "title": "Electric Field Grid",
         "description": "Coordinates of the locations of all three components of the electric field.",
         "allOf": [
            {
               "$ref": "#/definitions/FieldGrid"
            }
         ]
      },
      "H": {
         "title": "Electric Field Grid",
         "description": "Coordinates of the locations of all three components of the magnetic field.",
         "allOf": [
            {
               "$ref": "#/definitions/FieldGrid"
            }
         ]
      },
      "type": {
         "title": "Type",
         "default": "YeeGrid",
         "enum": [
            "YeeGrid"
         ],
         "type": "string"
      }
   },
   "required": [
      "E",
      "H"
   ],
   "additionalProperties": false,
   "definitions": {
      "Coords": {
         "title": "Coords",
         "description": "Holds data about a set of x,y,z positions on a grid.\n\nParameters\n----------\nx : Array = None\n    1-dimensional array of x coordinates.\ny : Array = None\n    1-dimensional array of y coordinates.\nz : Array = None\n    1-dimensional array of z coordinates.\n\nExample\n-------\n>>> x = np.linspace(-1, 1, 10)\n>>> y = np.linspace(-1, 1, 11)\n>>> z = np.linspace(-1, 1, 12)\n>>> coords = Coords(x=x, y=y, z=z)",
         "type": "object",
         "properties": {
            "x": {
               "title": "NumpyArray",
               "description": "Wrapper around numpy arrays that has a well defined json schema.",
               "type": "object",
               "properties": {
                  "data_list": {
                     "title": "Data List",
                     "type": "array",
                     "items": {}
                  }
               },
               "required": [
                  "data_list"
               ]
            },
            "y": {
               "title": "NumpyArray",
               "description": "Wrapper around numpy arrays that has a well defined json schema.",
               "type": "object",
               "properties": {
                  "data_list": {
                     "title": "Data List",
                     "type": "array",
                     "items": {}
                  }
               },
               "required": [
                  "data_list"
               ]
            },
            "z": {
               "title": "NumpyArray",
               "description": "Wrapper around numpy arrays that has a well defined json schema.",
               "type": "object",
               "properties": {
                  "data_list": {
                     "title": "Data List",
                     "type": "array",
                     "items": {}
                  }
               },
               "required": [
                  "data_list"
               ]
            },
            "type": {
               "title": "Type",
               "default": "Coords",
               "enum": [
                  "Coords"
               ],
               "type": "string"
            }
         },
         "required": [
            "x",
            "y",
            "z"
         ],
         "additionalProperties": false
      },
      "FieldGrid": {
         "title": "FieldGrid",
         "description": "Holds the grid data for a single field.\n\nParameters\n----------\nx : Coords = None\n    x,y,z coordinates of the locations of the x-component of a vector field.\ny : Coords = None\n    x,y,z coordinates of the locations of the y-component of a vector field.\nz : Coords = None\n    x,y,z coordinates of the locations of the z-component of a vector field.\n\nExample\n-------\n>>> x = np.linspace(-1, 1, 10)\n>>> y = np.linspace(-1, 1, 11)\n>>> z = np.linspace(-1, 1, 12)\n>>> coords = Coords(x=x, y=y, z=z)\n>>> field_grid = FieldGrid(x=coords, y=coords, z=coords)",
         "type": "object",
         "properties": {
            "x": {
               "title": "X Positions",
               "description": "x,y,z coordinates of the locations of the x-component of a vector field.",
               "allOf": [
                  {
                     "$ref": "#/definitions/Coords"
                  }
               ]
            },
            "y": {
               "title": "Y Positions",
               "description": "x,y,z coordinates of the locations of the y-component of a vector field.",
               "allOf": [
                  {
                     "$ref": "#/definitions/Coords"
                  }
               ]
            },
            "z": {
               "title": "Z Positions",
               "description": "x,y,z coordinates of the locations of the z-component of a vector field.",
               "allOf": [
                  {
                     "$ref": "#/definitions/Coords"
                  }
               ]
            },
            "type": {
               "title": "Type",
               "default": "FieldGrid",
               "enum": [
                  "FieldGrid"
               ],
               "type": "string"
            }
         },
         "required": [
            "x",
            "y",
            "z"
         ],
         "additionalProperties": false
      }
   }
}

Fields
  • E (tidy3d.components.grid.grid.FieldGrid)

  • H (tidy3d.components.grid.grid.FieldGrid)

attribute E: tidy3d.components.grid.grid.FieldGrid [Required]#

Coordinates of the locations of all three components of the electric field.

attribute H: tidy3d.components.grid.grid.FieldGrid [Required]#

Coordinates of the locations of all three components of the magnetic field.

property grid_dict#

The Yee grid coordinates associated to various field components as a dictionary.