viscid.coordinate module

Container for grid coordinates

Coordinates primarily go into Field objects. The order of coords in the clist should mirror the data layout, as in if data[ix, iy, iz] (C-order, ix is fastest varying index) then list should go x, y, z… this is the default order

types:
“Structured”:
“nonuniform_cartesian” “Cylindrical” “Spherical”
“Unstructured”:
-> Not Implemented <-
FIXME: uniform coordinates are generally unsupported, but they’re just
a special case of nonuniform coordinates, so the functionality is still there… it’s just unnatural to use full crd arrays with uniform coordinates
exception viscid.coordinate.NonuniformFullArrayError[source]

Bases: exceptions.ValueError

trying to make uniform crds from nonuniform full arrays

viscid.coordinate.arrays2crds(crd_arrs, crd_type='AUTO', crd_names='xyzuvw', **kwargs)[source]

make either uniform or nonuniform coordnates given full arrays

Parameters:
  • crd_arrs (array-like) – for n-dimensional crds, supply a list of n ndarrays
  • crd_type (str) – passed to wrap_crds, should uniquely specify a type of coordinate object
  • crd_names (iterable) – names of coordinates in the same order as crd_arrs. Should always be in xyz order.
viscid.coordinate.wrap_crds(crdtype, clist, **kwargs)[source]
viscid.coordinate.extend_arr(x, n=1, cell_fraction=1.0, full_arr=True, default_width=1e-05, width_arr=None)[source]

TODO: docstring