# HG changeset patch # User Rio Yokota # Date 1347301105 -10800 # Node ID d64932505ff3c93f0a5eb3ad851acba02808f94b # Parent 2e4d1ad5aa983078570a65b4c8ea87be770fe885 Fix for double precision. diff --git a/include/serialfmm.h b/include/serialfmm.h --- a/include/serialfmm.h +++ b/include/serialfmm.h @@ -86,9 +86,9 @@ void setBounds(Bodies &bodies) { startTimer("Set bounds"); // Start timer vec3Pair bounds = getBounds(bodies.begin(), bodies.end()); // Get Xmin (first) and Xmax (second) of domain - localXmin = bounds.first; // Set local Xmin - localXmax = bounds.second; // Set local Xmax - localCenter = (localXmax + localXmin) / 2; // Calculate center of domain + for (int d=0; d<3; d++) localXmin[d] = bounds.first[d]; // Set local Xmin + for (int d=0; d<3; d++) localXmax[d] = bounds.second[d]; // Set local Xmax + for (int d=0; d<3; d++) localCenter[d] = (localXmax[d] + localXmin[d]) / 2;// Calculate center of domain localRadius = 0; // Initialize localRadius for (int d=0; d<3; d++) { // Loop over dimensions localRadius = std::max(localCenter[d] - localXmin[d], localRadius);// Calculate min distance from center diff --git a/include/types.h b/include/types.h --- a/include/types.h +++ b/include/types.h @@ -15,7 +15,7 @@ typedef std::pair vec3Pair; //!< Pair of vec3 // Compile-time parameters -const int P = 3; //!< Order of expansions +const int P = 5; //!< Order of expansions const float EPS2 = .0; //!< Softening parameter (squared) #if COMkernel const int MTERM = P*(P+1)*(P+2)/6-3; //!< Number of Cartesian mutlipole terms