Skip to content
Snippets Groups Projects
Commit f99dec56 authored by Armin Damon Riess's avatar Armin Damon Riess
Browse files

program writes forces to file

parent 2fb0da24
No related branches found
No related tags found
No related merge requests found
#include <iostream>
#include "lib/nBodySim.h"
#include <string>
#include "lib/nBodySim.hpp"
int main(int argc, char** argv) {
std::string datafile;
switch (argc) {
case 1:
datafile = "lib/data.ascii";
datafile = "../data/data.ascii";
break;
case 2:
datafile = argv[1];
......@@ -17,9 +18,11 @@ int main(int argc, char** argv) {
}
nBodySim sim(datafile);
std::cout << "N = " << sim.getN() << std::endl;
try {
sim.run();
sim.calculateForces();
sim.write2file(sim.getForces(), "../data/output.txt", sim.getN(), 3);
} catch (std::exception& e) {
std::cerr << e.what() << std::endl;
return 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment