xugrid.UgridDataArrayAccessor.to_node#
- UgridDataArrayAccessor.to_node(dim: str = 'nmax')[source]#
Map data to nodes.
Creates a new dimension representing the contributing source elements for each node, as multiple faces/edges can connect to a single node.
- Parameters:
dim (str, optional)
- Returns:
mapped – A new UgridDataArray with data mapped to the nodes of the grid.
- Return type:
Examples
Compute the mean elevation based on the surrounding faces for each node:
>>> node_elevation = face_elevation.to_node().mean("contributors")