I would like to numerically evaluate an integral of the form:
$$ int_D f(x,y) dx dy $$
where $D$ is a region in $R^2$ and $f(x,y)$ is a map from $R^2$ to $R$.
I have a grid covering a subset of $R^2$. From this grid, for my particular application, I select a particular region $D$ (not necessarily rectangular, but simply-connected) according to the value of $f(x,y)$ (for example, I select all points for which $f(x,y) < 5$).
I would then like to integrate the function over this selected region. Many functions exist for 2D integrals over rectangular regions and some have been implemented for integration over simplicies. It appears to me none exist for integration over more general regions. It does not seem too complicated to implement a version of Riemann Sums, but have not seen it anywhere.
Does anyone know?