Commits

Enas Yunis committed 2d1621c

added heuristics to alpha and ksize values.

Comments (0)

Files changed (1)

unit_test/ewald_fmm.cxx

 #include "serialfmm.h"
 
 int main() {
-  const int numBodies = 1000;                                   // Number of bodies
-  const real xmax = 100.0;                                      // Size of domain
-  const real ksize = 44.0;                                      // Ewald wave number
-  const real alpha = 0.2;                                       // Ewald alpha value
-  const real sigma = .25 / M_PI;                                // Ewald sigma value
-  IMAGES = 8;                                                   // Level of periodic image tree (0 for non-periodic)
-  THETA = 1 / sqrt(4);                                          // Multipole acceptance criteria
+  const int numBodies = 2000;                                   // Number of bodies - DEF=1000.
+  const real delBodies = pow(numBodies, 1.0/3.0)/10.0;         // change in numBodies
+  const real xmax = 100.0;                                      // Size of domain - DEF=100.0
+  const real delXmax = 100.0/xmax;                             // Change in xmax
+  const real ksize = 44.0*delBodies;                           // Ewald wave number
+  const real alpha = 0.2*delXmax*delBodies;                    // Ewald alpha value
+  const real sigma = .25 / M_PI;                               // Ewald sigma value
+  IMAGES = 8;                                                  // Level of periodic image tree (0 for non-periodic)
+  THETA = 1 / sqrt(4);                                         // Multipole acceptance criteria
+  
+  std::cout << "numBodies: " << numBodies << ", delBodies: " << delBodies << std::endl << "xmax: " << xmax << ", delXmax: " << delXmax << std::endl << "ksize: " << ksize << ", alpha: " << alpha << std::endl << "sigma: " << sigma <<", IMAGES: "  << IMAGES << ", THETA: " << THETA << std::endl;
+
   Bodies bodies(numBodies);                                     // Define vector of bodies
   Bodies jbodies;                                               // Define vector of source bodies
   Cells cells, jcells;                                          // Define vector of cells