I am trying to compute various quantities from the scattering amplitude, in the setting of acoustic scattering from an obstacle \Omega with Dirichlet boundary conditions.

One way to compute the scattering amplitude (cf. Taylor 2023, PDE II, Eq. (3.22)) is via the formula

Here, \nu(y) is the unit surface normal at the point y \in \partial \Omega. The second term (involving the Dirichlet-to-Neumann operator) I can compute easily.

I am having some trouble with the first term. I canâ€™t work out how to define a grid function that takes the normal vector of a grid as input. I can probably use grid.normals to extract the normal vectors, and then integrate by hand. But I would prefer to use the convenience of grid_function.integrate() for the boundary integral.