# This file is automatically generated by pyo3_stub_gen
# ruff: noqa: E501, F401, F403, F405

import collections.abc
from raygeo.mesh import types
__all__ = [
    "compute_gradient_field",
]

def compute_gradient_field(mesh: types.TriangleMesh, u_field: collections.abc.Sequence[float]) -> collections.abc.Sequence[tuple[float, float]]:
    r"""
    Compute the gradient of the scalar field on each triangle.
    
    Given the solution u to the Laplace equation, computes ∇u = (∂u/∂x, ∂u/∂y)
    in the interior of each triangle of the mesh (piecewise constant).
    
    :param mesh: TriangleMesh with the same vertex count as u_field.
    :param u_field: Scalar field values, one per vertex.
    :returns: List of (gx, gy) pairs, one per triangle in mesh order.
    :complexity: O(n) where n = number of triangles
    """

