67 int main(
int argc,
char *argv[]) {
74 clock_t cputime_sim1, cputime_sim2;
75 clock_t cputime_sim1_eta, cputime_sim2_eta;
80 double cputime_sim1, cputime_sim2;
81 double cputime_sim1_eta, cputime_sim2_eta;
88 double seconds, seconds_eta;
108 sprintf(filename,
"%s", argv[1]);
113 printf(
"-TYCHO SIMULATION--\n");
114 printf(
"-Linux Version --\n");
115 printf(
"-V1.3.0 Oct. 2013--\n");
116 printf(
"-------------------\n");
117 printf(
"Please specify a\n");
118 printf(
"parameter File\n");
119 printf(
"-------------------\n");
126 printf(
"---------------This is a TYCHO Simulation--------------\n");
127 printf(
"---------------------Linux Version --------------------\n");
128 printf(
"---------------Version 1.3.0 released Oct. 2013--------\n");
129 printf(
"The code will restart from last checkpoint\n");
135 printf(
"---------------This is a TYCHO Simulation--------------\n");
136 printf(
"---------------------Linux ----------------------------\n");
137 printf(
"---------------Version 1.3.0 released Oct. 2013--------\n");
138 printf(
"The resolution of the simulation is\n%i %i %i\n",
x,
y,
z);
139 printf(
"The domain extend in meter in x,y and z is\n%g %g %g\n",
xmax,
143 printf(
"Attention the extend of your computational domain is a singularity!\n");
144 printf(
"We better stop.\n");
147 printf(
"Your boundary conditions are\n%i %i %i %i %i %i\n",
152 if (
wind_on_off == 1) printf(
"A wind marker file will be processed\n");
153 if (
with_obstacles == 0) printf(
"No Obstacles within computational domain\n");
155 if (
with_one_pulse == 1) printf(
"With a single sound-shock emitted\n");
156 if (
advection == 1) printf(
"A marker field will be advected with the HYDRO solution\n");
162 printf(
"-------------------------------------------------------\n");
275 printf(
"Restart files are read.\n");
293 double x_max_new, y_max_new, z_max_new;
299 double wavelength_divisor = 100.0;
304 if ((x_max_new <
xmax) || (y_max_new <
ymax) || (z_max_new <
zmax)) {
308 printf(
"New extend due to harmonic soundsource\nextend in x-direction: %g\nextend in y-direction: %g\nextend in z-direction: %g\n",
xmax,
ymax,
zmax);
310 printf(
"-------------------------------------------------------\n");
316 printf(
"The beginning time-step: %g [s]\n",
dt);
317 printf(
"-------------------------------------------------------\n");
330 cputime_sim1 = clock();
332 cputime_sim1 = omp_get_wtime();
339 cputime_sim1_eta = clock();
341 cputime_sim1_eta = omp_get_wtime();
406 cputime_sim2_eta = clock();
408 cputime_sim2_eta = omp_get_wtime();
411 seconds_eta = (cputime_sim2_eta - cputime_sim1_eta) / (
double) CLOCKS_PER_SEC;
415 seconds_eta = (cputime_sim2_eta - cputime_sim1_eta);
444 cputime_sim2 = clock();
446 cputime_sim2 = omp_get_wtime();
449 seconds = (cputime_sim2 - cputime_sim1) / (
double) CLOCKS_PER_SEC;
452 seconds = (cputime_sim2 - cputime_sim1);
456 printf(
"time:%g [s], dt:%g [s]\nshock:%i\ncounter:%i\n", time_sim, dt,
shock_or_not, counter);
459 if ((((
endtime_sim - time_sim) / dt) * seconds_eta) < 60.0) {
460 printf(
"Estimated time to simulation end: %4.2f seconds\n", ((
endtime_sim - time_sim) / dt) * seconds_eta);
462 if (((((
endtime_sim - time_sim) / dt) * seconds_eta) > 60.0) && (((((
endtime_sim - time_sim) / dt) * seconds_eta) <= 3600.0))) {
463 printf(
"Estimated time to simulation end: %4.2f minutes\n", ((
endtime_sim - time_sim) / dt) * seconds_eta / 60.0);
465 if (((((
endtime_sim - time_sim) / dt) * seconds_eta) > 3600.0) && ((((
endtime_sim - time_sim) / dt) * seconds_eta) <= 3600.0 * 24.0)) {
466 printf(
"Estimated time to simulation end: %5.2f hours\n", ((
endtime_sim - time_sim) / dt) * seconds_eta / 3600.0);
468 if ((((
endtime_sim - time_sim) / dt) * seconds_eta) > 3600.0 * 24.0) {
469 printf(
"Estimated time to simulation end: %5.2f days\n", ((
endtime_sim - time_sim) / dt) * seconds_eta / (3600.0 * 24.0));
471 if (seconds < 60.0) printf(
"Time since last output: %4.2g [s]\n", seconds);
472 if ((seconds > 60.0) && (seconds < 3600)) printf(
"Time since last output: %4.2g [min]\n", seconds / 60.0);
473 if (seconds > 3600.0) printf(
"Time since last output: %4.2g [h]\n", seconds / 3600.0);
475 printf(
"-------------------------------------------------------\n");
480 printf(
"Restart files are written.\n");
491 cputime_sim1 = clock();
493 cputime_sim1 = omp_get_wtime();
500 printf(
"\n--------------------------");
501 printf(
"\n--------------------------\n");
502 printf(
"Program aborted normally\n");
503 printf(
"End-time of simulation reached\n");
504 printf(
"\n--------------------------");
505 printf(
"\n--------------------------\n");