[Commits] [svn:einsteintoolkit] Multipole/trunk/src/ (Rev. 103)
ian.hinder at aei.mpg.de
ian.hinder at aei.mpg.de
Wed Oct 9 12:57:23 CDT 2013
User: hinder
Date: 2013/10/09 12:57 PM
Modified:
/trunk/src/
integrate.cc
Log:
integrate.cc: Add a comment on the lack of symmetry of the "midpoint" integration method
File Changes:
Directory: /trunk/src/
======================
File [modified]: integrate.cc
Delta lines: +7 -0
===================================================================
--- trunk/src/integrate.cc 2013-10-09 17:57:15 UTC (rev 102)
+++ trunk/src/integrate.cc 2013-10-09 17:57:23 UTC (rev 103)
@@ -41,6 +41,13 @@
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)];
More information about the Commits
mailing list