xugrid.UgridDataArray.from_data#

static UgridDataArray.from_data(data: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], grid: Type[AbstractUgrid], facet: str) UgridDataArray[source]#

Create a UgridDataArray from a grid and a 1D array of values.

Parameters:
  • data (array like) – Values for this array. Must be a numpy.ndarray or castable to it.

  • grid (Ugrid1d, Ugrid2d)

  • facet (str) – With which facet to associate the data. Options for Ugrid1d are, "node" or "edge". Options for Ugrid2d are "node", "edge", or "face".

Returns:

uda

Return type:

UgridDataArray