xugrid.UgridDataArrayAccessor.to_face#

UgridDataArrayAccessor.to_face(dim: str = 'nmax')[source]#

Map data to faces.

Creates a new dimension representing the contributing source elements for each node, as two edges or multiple nodes are connected to a face.

Parameters:

dim (str, optional)

Returns:

mapped – A new UgridDataArray with data mapped to the faces of the grid.

Return type:

UgridDataArray

Examples

Compute the mean elevation based on the nodes for each face:

>>> face_elevation = node_elevation.to_face().mean("contributors")