tidy3d.AutoGrid#

class tidy3d.AutoGrid#

Specification for non-uniform grid along a given dimension.

Parameters
  • min_steps_per_wvl (ConstrainedFloatValue = 10.0) – Minimal number of steps per wavelength in each medium.

  • max_scale (ConstrainedFloatValue = 1.4) – Sets the maximum ratio between any two consecutive grid steps.

  • dl_min (NonNegativeFloat = 0) – Lower bound of the grid size along this dimension regardless of structures present in the simulation, including override structures with enforced=True. It is a soft bound, meaning that the actual minimal grid size might be slightly smaller.

  • mesher (GradedMesher = GradedMesher(type='GradedMesher')) – The type of mesher to use to generate the grid automatically.

Example

>>> grid_1d = AutoGrid(min_steps_per_wvl=16, max_scale=1.4)

Show JSON schema
{
   "title": "AutoGrid",
   "description": "Specification for non-uniform grid along a given dimension.\n\nParameters\n----------\nmin_steps_per_wvl : ConstrainedFloatValue = 10.0\n    Minimal number of steps per wavelength in each medium.\nmax_scale : ConstrainedFloatValue = 1.4\n    Sets the maximum ratio between any two consecutive grid steps.\ndl_min : NonNegativeFloat = 0\n    Lower bound of the grid size along this dimension regardless of structures present in the simulation, including override structures with ``enforced=True``. It is a soft bound, meaning that the actual minimal grid size might be slightly smaller.\nmesher : GradedMesher = GradedMesher(type='GradedMesher')\n    The type of mesher to use to generate the grid automatically.\n\nExample\n-------\n>>> grid_1d = AutoGrid(min_steps_per_wvl=16, max_scale=1.4)",
   "type": "object",
   "properties": {
      "type": {
         "title": "Type",
         "default": "AutoGrid",
         "enum": [
            "AutoGrid"
         ],
         "type": "string"
      },
      "min_steps_per_wvl": {
         "title": "Minimal number of steps per wavelength",
         "description": "Minimal number of steps per wavelength in each medium.",
         "default": 10.0,
         "minimum": 6.0,
         "type": "number"
      },
      "max_scale": {
         "title": "Maximum Grid Size Scaling",
         "description": "Sets the maximum ratio between any two consecutive grid steps.",
         "default": 1.4,
         "exclusiveMaximum": 2.0,
         "minimum": 1.2,
         "type": "number"
      },
      "dl_min": {
         "title": "Lower bound of grid size",
         "description": "Lower bound of the grid size along this dimension regardless of structures present in the simulation, including override structures with ``enforced=True``. It is a soft bound, meaning that the actual minimal grid size might be slightly smaller.",
         "default": 0,
         "minimum": 0,
         "type": "number"
      },
      "mesher": {
         "title": "Grid Construction Tool",
         "description": "The type of mesher to use to generate the grid automatically.",
         "default": {
            "type": "GradedMesher"
         },
         "allOf": [
            {
               "$ref": "#/definitions/GradedMesher"
            }
         ]
      }
   },
   "additionalProperties": false,
   "definitions": {
      "GradedMesher": {
         "title": "GradedMesher",
         "description": "Implements automatic nonuniform meshing with a set minimum steps per wavelength and\na graded mesh expanding from higher- to lower-resolution regions.\n\nParameters\n----------",
         "type": "object",
         "properties": {
            "type": {
               "title": "Type",
               "default": "GradedMesher",
               "enum": [
                  "GradedMesher"
               ],
               "type": "string"
            }
         },
         "additionalProperties": false
      }
   }
}

attribute dl_min: pydantic.types.NonNegativeFloat = 0#

Lower bound of the grid size along this dimension regardless of structures present in the simulation, including override structures with enforced=True. It is a soft bound, meaning that the actual minimal grid size might be slightly smaller.

Constraints
  • minimum = 0

attribute max_scale: float = 1.4#

Sets the maximum ratio between any two consecutive grid steps.

Constraints
  • exclusiveMaximum = 2.0

  • minimum = 1.2

attribute mesher: tidy3d.components.grid.mesher.GradedMesher = GradedMesher(type='GradedMesher')#

The type of mesher to use to generate the grid automatically.

attribute min_steps_per_wvl: float = 10.0#

Minimal number of steps per wavelength in each medium.

Constraints
  • minimum = 6.0