diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/integrate.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/integrate.cc b/src/integrate.cc index 1f64c29..93b61ee 100644 --- a/src/integrate.cc +++ b/src/integrate.cc @@ -41,6 +41,13 @@ CCTK_REAL Midpoint2DIntegral(CCTK_REAL const *f, int nx, int ny, CCTK_REAL hx, C assert(nx > 0); assert(ny > 0); assert (f); + // This sum should probably exclude the upper end points. As + // currently implemented, it does not naturally map to the "sum of + // areas" definition of the integral, as there is an additional + // contribution from the last term in the sum. This introduces an + // additional first order error to a method which is already only + // first order. + for (iy = 0; iy <= ny; iy++) for (ix = 0; ix <= nx; ix++) integrand_sum += f[idx(ix,iy)]; |