From 6aea2421a5117daece141b16fb1ef2abe2a8895b Mon Sep 17 00:00:00 2001 From: hinder Date: Wed, 9 Oct 2013 17:57:23 +0000 Subject: integrate.cc: Add a comment on the lack of symmetry of the "midpoint" integration method git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/Multipole/trunk@103 4f5cb9a8-4dd8-4c2d-9bbd-173fa4467843 --- src/integrate.cc | 7 +++++++ 1 file changed, 7 insertions(+) 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)]; -- cgit v1.2.3