tidy3d.FieldGrid#

class tidy3d.FieldGrid#

Holds the grid data for a single field.

Parameters
  • x (Coords = None) – x,y,z coordinates of the locations of the x-component of a vector field.

  • y (Coords = None) – x,y,z coordinates of the locations of the y-component of a vector field.

  • z (Coords = None) – x,y,z coordinates of the locations of the z-component of a vector 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)

Show JSON schema
{
   "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,
   "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
      }
   }
}

Fields
  • x (tidy3d.components.grid.grid.Coords)

  • y (tidy3d.components.grid.grid.Coords)

  • z (tidy3d.components.grid.grid.Coords)

attribute x: tidy3d.components.grid.grid.Coords [Required]#

x,y,z coordinates of the locations of the x-component of a vector field.

attribute y: tidy3d.components.grid.grid.Coords [Required]#

x,y,z coordinates of the locations of the y-component of a vector field.

attribute z: tidy3d.components.grid.grid.Coords [Required]#

x,y,z coordinates of the locations of the z-component of a vector field.