xugrid.Ugrid2d.compute_barycentric_weights#
- Ugrid2d.compute_barycentric_weights(points: ndarray, tolerance: float | None = None) Tuple[ndarray, ndarray] [source]#
Find in which face the points are located, and compute the barycentric weight for every vertex of the face.
- Parameters:
points (ndarray of floats with shape
(n_point, 2)
)tolerance (float, optional) – The tolerance used to determine whether a point is on an edge. This accounts for the inherent inexactness of floating point calculations. If None, an appropriate tolerance is automatically estimated based on the geometry size. Consider adjusting this value if edge detection results are unsatisfactory.
- Returns:
face_index (ndarray of integers with shape
(n_points,)
)weights (ndarray of floats with shape
`(n_points, n_max_node)
)