From 16d7622283c3865243bbfb4b9f949a4ea642af5b Mon Sep 17 00:00:00 2001 From: Cory Date: Tue, 24 Oct 2023 12:44:25 +0200 Subject: [PATCH] Add ofile as private --- src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 937c306..0537470 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -94,9 +93,10 @@ void simulate_single_particle_with_different_steps() // Calculate relative error for RK4 std::string path = "output/relative_error/RK4/"; mkpath(path); -#pragma omp parallel for +#pragma omp parallel for private(ofile) for (int i = 0; i < 4; i++) { int steps = 4000 * std::pow(2, i); + std::cout << steps << std::endl; double dt = time / (double)steps; ofile.open(path + std::to_string(steps) + "_steps.txt"); PenningTrap trap(std::vector{p1}); @@ -112,7 +112,7 @@ void simulate_single_particle_with_different_steps() // Calculate relative error for forward Euler path = "output/relative_error/euler/"; mkpath(path); -#pragma omp parallel for +#pragma omp parallel for private(ofile) for (int i = 0; i < 4; i++) { int steps = 4000 * std::pow(2, i); double dt = time / (double)steps;