23 sprintf(filename,
"%srho_%i.tyc",
output_dir, counter);
24 fd = fopen(filename,
"wb");
26 printf(
"-----------------------------------\n");
27 printf(
"The output directory does not exist\n");
28 printf(
"-----------------------------------\n");
31 fprintf(fd,
"TYCHO Density File\n%g\n%i\n%i\n%i\n%i\n",
time_sim, x, y, z, counter);
32 fseek(fd, 200, SEEK_SET);
33 for (i = 0; i <
x; i++) {
34 for (j = 0; j <
y; j++) {
35 for (k = 0; k <
z; k++) {
38 printf(
"NaN in density array %i %i %i\n", i, j, k);
41 fwrite(&tmp, 1,
sizeof (
double), fd);
48 sprintf(filename,
"%stemp_%i.tyc",
output_dir, counter);
49 fd = fopen(filename,
"wb");
50 fprintf(fd,
"TYCHO Temperature File\n%g\n%i\n%i\n%i\n%i\n",
time_sim, x, y, z, counter);
51 fseek(fd, 200, SEEK_SET);
52 for (i = 0; i <
x; i++) {
53 for (j = 0; j <
y; j++) {
54 for (k = 0; k <
z; k++) {
57 printf(
"NaN in temperature array %i %i %i\n", i, j, k);
58 printf(
"%g %g %i\n",
pre[i][j][k],
rho[i][j][k],
dom[i][j][k]);
61 fwrite(&tmp, 1,
sizeof (
double), fd);
67 sprintf(filename,
"%spressure_%i.tyc",
output_dir, counter);
68 fd = fopen(filename,
"wb");
69 fprintf(fd,
"TYCHO Pressure File\n%g\n%i\n%i\n%i\n%i\n",
time_sim, x, y, z, counter);
70 fseek(fd, 200, SEEK_SET);
71 for (i = 0; i <
x; i++) {
72 for (j = 0; j <
y; j++) {
73 for (k = 0; k <
z; k++) {
74 if (
dom[i][j][k] == 0) tmp =
pre[i][j][k];
75 if (
dom[i][j][k] == 1) tmp = 0.0;
77 printf(
"NaN in pressure array %i %i %i\n", i, j, k);
80 fwrite(&tmp, 1,
sizeof (
double), fd);
87 sprintf(filename,
"%svel_%i.tyc",
output_dir, counter);
88 fd = fopen(filename,
"wb");
89 fprintf(fd,
"TYCHO Velocity File\n%g\n%i\n%i\n%i\n%i\n",
time_sim, x, y, z, counter);
90 fseek(fd, 200, SEEK_SET);
91 for (i = 0; i <
x; i++) {
92 for (j = 0; j <
y; j++) {
93 for (k = 0; k <
z; k++) {
96 printf(
"NaN in vx array %i %i %i\n", i, j, k);
99 fwrite(&tmp, 1,
sizeof (
double), fd);
102 printf(
"NaN in vy array %i %i %i\n", i, j, k);
105 fwrite(&tmp, 1,
sizeof (
double), fd);
108 printf(
"NaN in vz array %i %i %i\n", i, j, k);
111 fwrite(&tmp, 1,
sizeof (
double), fd);
119 sprintf(filename,
"%spressure_on_solid_%i.tyc",
output_dir, counter);
120 fd = fopen(filename,
"wb");
121 fprintf(fd,
"TYCHO pressure on solid File\n%g\n%i\n%i\n%i\n%i\n",
time_sim, x, y, z, counter);
122 fseek(fd, 200, SEEK_SET);
123 for (i = 0; i <
x; i++) {
124 for (j = 0; j <
y; j++) {
125 for (k = 0; k <
z; k++) {
127 fwrite(&tmp, 1,
sizeof (
double), fd);
134 sprintf(filename,
"%sdB_map_%i.tyc",
output_dir, counter);
135 fd = fopen(filename,
"wb");
136 fprintf(fd,
"TYCHO dba_map\n%g\n%i\n%i\n%i\n%i\n",
time_sim, x, y, z, counter);
137 fseek(fd, 200, SEEK_SET);
138 for (i = 0; i <
x; i++) {
139 for (j = 0; j <
y; j++) {
140 for (k = 0; k <
z; k++) {
143 printf(
"NaN in dB_map array %i %i %i\n", i, j, k);
147 fwrite(&tmp, 1,
sizeof (
double), fd);
156 sprintf(filename,
"%smarker_%i.tyc",
output_dir, counter);
157 fd = fopen(filename,
"wb");
158 fprintf(fd,
"TYCHO Marker File%g\n%i\n%i\n%i\n%i\n",
time_sim, x, y, z, counter);
159 fseek(fd, 200, SEEK_SET);
160 for (i = 0; i <
x; i++) {
161 for (j = 0; j <
y; j++) {
162 for (k = 0; k <
z; k++) {
165 printf(
"NaN in marker array %i %i %i\n", i, j, k);
168 fwrite(&tmp, 1,
sizeof (
double), fd);