xugrid.Ugrid2d.validate_edge_node_connectivity#
- Ugrid2d.validate_edge_node_connectivity()[source]#
Mark valid edges, by comparing face_node_connectivity and edge_node_connectivity. Edges that are not part of a face, as well as duplicate edges are marked
False
.An error is raised if the face_node_connectivity defines more unique edges than the edge_node_connectivity.
- Returns:
valid – Marks for every edge whether it is valid.
- Return type:
np.ndarray of bool
Examples
To purge invalid edges and associated data from a dataset that contains un-associated or duplicate edges:
>>> uds = xugrid.open_dataset("example.nc") >>> valid = uds.ugrid.grid.validate_edge_node_connectivity() >>> purged = uds.isel({grid.edge_dimension: valid})