diff --git a/lib/nBodySim.cpp b/lib/nBodySim.cpp index c49c23074b08a2b0994728d78b74a7270a85d72e..6e5bda6e4c219eecfd44685dac76b903f255d316 100644 --- a/lib/nBodySim.cpp +++ b/lib/nBodySim.cpp @@ -1,5 +1,6 @@ #include "nBodySim.hpp" #include "tree.hpp" +#include "utils.hpp" #include <omp.h> #include <cmath> #include <string> @@ -74,13 +75,14 @@ void nBodySim::runSimulation(double dt, unsigned nSteps) { write2file(positions_, positionsFile, 3, skip); energyFile << calculateTotalEnergy() << std::endl; - Vector COM = getCenterOfMass(); + // Vector COM = getCenterOfMass(); // Integrate with leapfrog auto start = std::chrono::high_resolution_clock::now(); kick(dt/2.0); drift(dt); treeUpdateForces(); + // double dev = verifyForces(); kick(dt/2.0); updateTree(); auto stop = std::chrono::high_resolution_clock::now(); @@ -88,7 +90,7 @@ void nBodySim::runSimulation(double dt, unsigned nSteps) { std::cout << std::right << "Step " << std::setw(5) << i // << ": MFM = " << std::setw(12) << calculateMeanForceMagnitude() - // << ", DEV = " << std::setw(12) << verifyForces() + // << ", DEV = " << std::setw(12) << dev // << ", MCD = " << std::setw(8) << calculateMeanCenterDistance() // << ", MID = " << std::setw(8) << calculateMeanInterparticleDistance() // << ", COM = " << "(" << COM[0] << ", " << COM[1] << ", " << COM[2] << ")" diff --git a/main.cpp b/main.cpp index 407899ec4588ba4f5a1bf1504fe8363946c7477b..41eb36e6702944b1c77745bbef6f39034bc35717 100644 --- a/main.cpp +++ b/main.cpp @@ -18,7 +18,7 @@ int main(int argc, char** argv) { return 1; } - double dt = 0.000005; + double dt = 5e-7; unsigned nSteps = 240; std::cout << "dt = " << dt << std::endl;