/** # The distance between two point within a cube. In order to test a double grid iterator implementation (i.e.nested) we aim to find the average distance between all points within a cube. The assumption here is that this number may be approximated using a finite number of points. The exact expression and a decimal expression is provided by [mathworld](http://mathworld.wolfram.com/HypercubeLinePicking.html), which will serve as a benchmark for our result. */ #include "grid/octree.h" int main(){ FILE * fp = fopen("distance","w"); int o = BGHOSTS+1; /** We check for an increasing number of points the distance to all points, using the cell centered coordinates. We increase the resolution upto 6 levels of refinement. Since we use a *rather naive* nested iterator, the scaling with increasing resolution is horrible (six dimensional). */ for (int g=1;g<6;g++){ int lev=g; init_grid(1<