__getitem__()#
- CenterGrid.__getitem__(key: int | slice | ellipsis | tuple[int | slice | ellipsis, ...] | ndarray[Any, dtype[_ScalarType_co]]) ndarray[Any, dtype[float64]] | floatSource#
Return center grid coordinates indexed by (l, m, n, xyz).
Returned grid coordinates are in \((X, Y, Z)\) which can be specified by
l: radial,m: poloidal,n: torodial indices.Examples
>>> cgrid = CenterGrid("zone0", index_type="cell") >>> cgrid[0, 0, 0, :] # (l=0, m=0, n=0) array([ 3.59664909e+00, 7.84665944e-03, -5.75750000e-04]) # (x, y, z)
>>> cgrid[:, -10, 0, :] # (radial coords at m=-10, n=0) array([[3.59672601e+00, 7.84684125e-03, 1.13558333e-03], [3.57695347e+00, 7.80372411e-03, 1.03814167e-02], ... [3.26883531e+00, 7.13347363e-03, 1.63643583e-01]])