Commit 0aee1336 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Use different file names for the exact force output for the periodic/non-periodic cases.

parent e08c2b7a
......@@ -307,7 +307,10 @@ int gravity_exact_force_file_exits(const struct engine *e) {
/* File name */
char file_name[100];
sprintf(file_name, "gravity_checks_exact_step%d.dat", e->step);
if (e->s->periodic)
sprintf(file_name, "gravity_checks_exact_periodic_step%d.dat", e->step);
else
sprintf(file_name, "gravity_checks_exact_step%d.dat", e->step);
/* Does the file exist ? */
if (access(file_name, R_OK | W_OK) == 0) {
......@@ -552,7 +555,10 @@ void gravity_exact_force_check(struct space *s, const struct engine *e,
if (!gravity_exact_force_file_exits(e)) {
char file_name_exact[100];
sprintf(file_name_exact, "gravity_checks_exact_step%d.dat", e->step);
if(s->periodic)
sprintf(file_name_exact, "gravity_checks_exact_periodic_step%d.dat", e->step);
else
sprintf(file_name_exact, "gravity_checks_exact_step%d.dat", e->step);
FILE *file_exact = fopen(file_name_exact, "w");
fprintf(file_exact, "# Gravity accuracy test - EXACT FORCES\n");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment