tmeaningful output during runtime - ns2dfd - 2D finite difference Navier Stokes… | |
git clone git://src.adamsgaard.dk/ns2dfd | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 78528b5cbef9193329d1cff3968e15b747323cf8 | |
parent 774db92458969b251c42ee905cf9da083bbb5570 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Sun, 2 Mar 2014 21:28:26 +0100 | |
meaningful output during runtime | |
Diffstat: | |
M src/main.c | 7 ++++--- | |
1 file changed, 4 insertions(+), 3 deletions(-) | |
--- | |
diff --git a/src/main.c b/src/main.c | |
t@@ -69,16 +69,16 @@ int main(int argc, char** argv) | |
simulation_id = argv[optind]; | |
dot = strchr(simulation_id, '.'); | |
dot[0] = '\0'; | |
- printf("%s\n", simulation_id); | |
+ printf("%s: simulation id: `%s`\n", argv[0], simulation_id); | |
while (t <= t_end+dt) { | |
dt = select_time_step(tau, re, dx, dy, nx, ny, U, V); | |
- printf("t = %f\tdt = %f\n", t, dt); | |
+ printf("\rt = %.2f/%.2f s, dt = %.2f s, last output: %d", | |
+ t, t_end, dt, nfile); | |
if (t_file_elapsed >= t_file || n == 0) { | |
- printf("output file %d\n", nfile); | |
sprintf(filename, "%s%05d.dat", simulation_id, nfile); | |
write_file(filename, &t, &t_end, &t_file, &tau, &itermax, | |
&epsilon, &omega, &gamma, | |
t@@ -92,6 +92,7 @@ int main(int argc, char** argv) | |
n++; | |
t_file_elapsed += dt; | |
} | |
+ puts("\n"); | |
free_memory(P, U, V, nx); | |
return 0; |