25 double tmp, tmp_vx, tmp_vy, tmp_vz;
28 sprintf(filename,
"%srho_%04i.bin",
output_dir, counter);
29 fd = fopen(filename,
"wb");
31 printf(
"-----------------------------------\n");
32 printf(
"The output directory does not exist\n");
33 printf(
"-----------------------------------\n");
37 fwrite(&ntemp, 1,
sizeof (
int), fd);
38 fwrite(&x, 1,
sizeof (
int), fd);
39 fwrite(&y, 1,
sizeof (
int), fd);
40 fwrite(&z, 1,
sizeof (
int), fd);
41 fwrite(&ntemp, 1,
sizeof (
int), fd);
43 fwrite(&ntemp, 1,
sizeof (
int), fd);
44 for (k = 0; k <
z; k++) {
45 for (j = 0; j <
y; j++) {
46 for (i = 0; i <
x; i++) {
49 fwrite(&data1, 1,
sizeof (data1), fd);
53 fwrite(&ntemp, 4, 1, fd);
56 sprintf(filename,
"%stemp_%04i.bin",
output_dir, counter);
57 fd = fopen(filename,
"wb");
59 printf(
"-----------------------------------\n");
60 printf(
"The output directory does not exist\n");
61 printf(
"-----------------------------------\n");
65 fwrite(&ntemp, 1,
sizeof (
int), fd);
66 fwrite(&x, 1,
sizeof (
int), fd);
67 fwrite(&y, 1,
sizeof (
int), fd);
68 fwrite(&z, 1,
sizeof (
int), fd);
69 fwrite(&ntemp, 1,
sizeof (
int), fd);
71 fwrite(&ntemp, 1,
sizeof (
int), fd);
72 for (k = 0; k <
z; k++) {
73 for (j = 0; j <
y; j++) {
74 for (i = 0; i <
x; i++) {
77 fwrite(&data1, 1,
sizeof (data1), fd);
81 fwrite(&ntemp, 1,
sizeof (
int), fd);
84 sprintf(filename,
"%spressure_%04i.bin",
output_dir, counter);
85 fd = fopen(filename,
"wb");
87 printf(
"-----------------------------------\n");
88 printf(
"The output directory does not exist\n");
89 printf(
"-----------------------------------\n");
93 fwrite(&ntemp, 1,
sizeof (
int), fd);
94 fwrite(&x, 1,
sizeof (
int), fd);
95 fwrite(&y, 1,
sizeof (
int), fd);
96 fwrite(&z, 1,
sizeof (
int), fd);
97 fwrite(&ntemp, 1,
sizeof (
int), fd);
98 ntemp = 4 * x * y *
z;
99 fwrite(&ntemp, 1,
sizeof (
int), fd);
100 for (k = 0; k <
z; k++) {
101 for (j = 0; j <
y; j++) {
102 for (i = 0; i <
x; i++) {
103 if (
dom[i][j][k] == 0) tmp =
pre[i][j][k];
104 if (
dom[i][j][k] == 1) tmp = 0.0;
106 fwrite(&data1, 1,
sizeof (data1), fd);
110 fwrite(&ntemp, 1,
sizeof (
int), fd);
113 sprintf(filename,
"%svel_%04i.bin",
output_dir, counter);
114 fd = fopen(filename,
"wb");
116 printf(
"-----------------------------------\n");
117 printf(
"The output directory does not exist\n");
118 printf(
"-----------------------------------\n");
122 fwrite(&ntemp, 1,
sizeof (
int), fd);
123 fwrite(&x, 1,
sizeof (
int), fd);
124 fwrite(&y, 1,
sizeof (
int), fd);
125 fwrite(&z, 1,
sizeof (
int), fd);
126 fwrite(&ntemp, 1,
sizeof (
int), fd);
127 ntemp = 4 * x * y *
z;
128 fwrite(&ntemp, 1,
sizeof (
int), fd);
129 for (i = 0; i <
x; i++) {
130 for (j = 0; j <
y; j++) {
131 for (k = 0; k <
z; k++) {
132 tmp_vx =
vy[i][j][k];
133 data1 = (float) tmp_vx;
134 fwrite(&data1, 1,
sizeof (data1), fd);
138 fwrite(&ntemp, 1,
sizeof (
int), fd);
139 fwrite(&ntemp, 1,
sizeof (
int), fd);
140 for (k = 0; k <
z; k++) {
141 for (j = 0; j <
y; j++) {
142 for (i = 0; i <
x; i++) {
143 tmp_vy =
vx[i][j][k];
144 data1 = (float) tmp_vy;
145 fwrite(&data1, 1,
sizeof (data1), fd);
149 fwrite(&ntemp, 1,
sizeof (
int), fd);
150 fwrite(&ntemp, 1,
sizeof (
int), fd);
151 for (k = 0; k <
z; k++) {
152 for (j = 0; j <
y; j++) {
153 for (i = 0; i <
x; i++) {
154 tmp_vz =
vz[i][j][k];
155 data1 = (float) tmp_vz;
156 fwrite(&data1, 1,
sizeof (data1), fd);
160 fwrite(&ntemp, 1,
sizeof (
int), fd);
164 sprintf(filename,
"%spressure_on_solid_%04i.bin",
output_dir, counter);
165 fd = fopen(filename,
"wb");
167 printf(
"-----------------------------------\n");
168 printf(
"The output directory does not exist\n");
169 printf(
"-----------------------------------\n");
173 fwrite(&ntemp, 1,
sizeof (
int), fd);
174 fwrite(&x, 1,
sizeof (
int), fd);
175 fwrite(&y, 1,
sizeof (
int), fd);
176 fwrite(&z, 1,
sizeof (
int), fd);
177 fwrite(&ntemp, 1,
sizeof (
int), fd);
178 ntemp = 4 * x * y *
z;
179 fwrite(&ntemp, 1,
sizeof (
int), fd);
180 for (k = 0; k <
z; k++) {
181 for (j = 0; j <
y; j++) {
182 for (i = 0; i <
x; i++) {
185 fwrite(&data1, 1,
sizeof (data1), fd);
189 fwrite(&ntemp, 1,
sizeof (
int), fd);
193 sprintf(filename,
"%sdB_map_%04i.bin",
output_dir, counter);
194 fd = fopen(filename,
"wb");
196 printf(
"-----------------------------------\n");
197 printf(
"The output directory does not exist\n");
198 printf(
"-----------------------------------\n");
202 fwrite(&ntemp, 1,
sizeof (
int), fd);
203 fwrite(&x, 1,
sizeof (
int), fd);
204 fwrite(&y, 1,
sizeof (
int), fd);
205 fwrite(&z, 1,
sizeof (
int), fd);
206 fwrite(&ntemp, 1,
sizeof (
int), fd);
207 ntemp = 4 * x * y *
z;
208 fwrite(&ntemp, 1,
sizeof (
int), fd);
209 for (k = 0; k <
z; k++) {
210 for (j = 0; j <
y; j++) {
211 for (i = 0; i <
x; i++) {
214 fwrite(&data1, 1,
sizeof (data1), fd);
218 fwrite(&ntemp, 1,
sizeof (
int), fd);
225 sprintf(filename,
"%smarker_%04i.bin",
output_dir, counter);
226 fd = fopen(filename,
"wb");
228 printf(
"-----------------------------------\n");
229 printf(
"The output directory does not exist\n");
230 printf(
"-----------------------------------\n");
234 fwrite(&ntemp, 1,
sizeof (
int), fd);
235 fwrite(&x, 1,
sizeof (
int), fd);
236 fwrite(&y, 1,
sizeof (
int), fd);
237 fwrite(&z, 1,
sizeof (
int), fd);
238 fwrite(&ntemp, 1,
sizeof (
int), fd);
239 ntemp = 4 * x * y *
z;
240 fwrite(&ntemp, 1,
sizeof (
int), fd);
241 for (k = 0; k <
z; k++) {
242 for (j = 0; j <
y; j++) {
243 for (i = 0; i <
x; i++) {
246 fwrite(&data1, 1,
sizeof (data1), fd);
250 fwrite(&ntemp, 1,
sizeof (
int), fd);