25 double tmp, tmp_vx, tmp_vy, tmp_vz;
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);
42 ntemp = 4 * x * y *
z;
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_ic.bin",
output_dir);
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);
70 ntemp = 4 * x * y *
z;
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_ic.bin",
output_dir);
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_ic.bin",
output_dir);
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);
128 fwrite(&ntemp, 1,
sizeof (
int), fd);
129 for (k = 0; k <
z; k++) {
130 for (j = 0; j <
y; j++) {
131 for (i = 0; i <
x; i++) {
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_ic.bin",
output_dir);
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);
194 sprintf(filename,
"%sdB_map_ic_ic.bin",
output_dir);
195 fd = fopen(filename,
"wb");
197 printf(
"-----------------------------------\n");
198 printf(
"The output directory does not exist\n");
199 printf(
"-----------------------------------\n");
203 fwrite(&ntemp, 1,
sizeof (
int), fd);
204 fwrite(&x, 1,
sizeof (
int), fd);
205 fwrite(&y, 1,
sizeof (
int), fd);
206 fwrite(&z, 1,
sizeof (
int), fd);
207 fwrite(&ntemp, 1,
sizeof (
int), fd);
208 ntemp = 4 * x * y *
z;
209 fwrite(&ntemp, 1,
sizeof (
int), fd);
210 for (k = 0; k <
z; k++) {
211 for (j = 0; j <
y; j++) {
212 for (i = 0; i <
x; i++) {
215 fwrite(&data1, 1,
sizeof (data1), fd);
219 fwrite(&ntemp, 1,
sizeof (
int), fd);
227 sprintf(filename,
"%smarker_ic.bin",
output_dir);
228 fd = fopen(filename,
"wb");
230 printf(
"-----------------------------------\n");
231 printf(
"The output directory does not exist\n");
232 printf(
"-----------------------------------\n");
236 fwrite(&ntemp, 1,
sizeof (
int), fd);
237 fwrite(&x, 1,
sizeof (
int), fd);
238 fwrite(&y, 1,
sizeof (
int), fd);
239 fwrite(&z, 1,
sizeof (
int), fd);
240 fwrite(&ntemp, 1,
sizeof (
int), fd);
241 ntemp = 4 * x * y *
z;
242 fwrite(&ntemp, 1,
sizeof (
int), fd);
243 for (k = 0; k <
z; k++) {
244 for (j = 0; j <
y; j++) {
245 for (i = 0; i <
x; i++) {
248 fwrite(&data1, 1,
sizeof (data1), fd);
252 fwrite(&ntemp, 1,
sizeof (
int), fd);