25 long long int tmp1, tmp1_vx, tmp1_vy, tmp1_vz;
26 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");
36 fprintf(fd,
"# AmiraMesh BINARY 1.0\n");
37 fprintf(fd,
"\n# Dimensions in x-, y-, and z-direction\n");
38 fprintf(fd,
"define Lattice %i %i %i\n\n", x, y, z);
39 fprintf(fd,
"Parameters {\n CoordType \"uniform\"\n");
40 fprintf(fd,
" # BoundingBox is xmin xmax ymin ymax zmin zmax\n");
42 fprintf(fd,
"}\n\nLattice { double ScalarField } = @1\n\n");
44 for (k = 0; k <
z; k++) {
45 for (j = 0; j <
y; j++) {
46 for (i = 0; i <
x; i++) {
48 tmp1 =
ntohll(*((
long long int*) & tmp));
49 fwrite(&tmp1, 1,
sizeof (
double), fd);
55 sprintf(filename,
"%spressure_ic.am",
output_dir);
56 fd = fopen(filename,
"wb");
58 printf(
"-----------------------------------\n");
59 printf(
"The output directory does not exist\n");
60 printf(
"-----------------------------------\n");
63 fprintf(fd,
"# AmiraMesh BINARY 1.0\n");
64 fprintf(fd,
"\n# Dimensions in x-, y-, and z-direction\n");
65 fprintf(fd,
"define Lattice %i %i %i\n\n", x, y, z);
66 fprintf(fd,
"Parameters {\n CoordType \"uniform\"\n");
67 fprintf(fd,
" # BoundingBox is xmin xmax ymin ymax zmin zmax\n");
69 fprintf(fd,
"}\n\nLattice { double ScalarField } = @1\n\n");
71 for (k = 0; k <
z; k++) {
72 for (j = 0; j <
y; j++) {
73 for (i = 0; i <
x; i++) {
74 if (
dom[i][j][k] == 0) tmp =
pre[i][j][k];
75 if (
dom[i][j][k] == 1) tmp = 0.0;
76 tmp1 =
ntohll(*((
long long int*) & tmp));
77 fwrite(&tmp1, 1,
sizeof (
double), fd);
84 fd = fopen(filename,
"wb");
86 printf(
"-----------------------------------\n");
87 printf(
"The output directory does not exist\n");
88 printf(
"-----------------------------------\n");
91 fprintf(fd,
"# AmiraMesh BINARY 1.0\n");
92 fprintf(fd,
"\n# Dimensions in x-, y-, and z-direction\n");
93 fprintf(fd,
"define Lattice %i %i %i\n\n", x, y, z);
94 fprintf(fd,
"Parameters {\n CoordType \"uniform\"\n");
95 fprintf(fd,
" # BoundingBox is xmin xmax ymin ymax zmin zmax\n");
97 fprintf(fd,
"}\n\nLattice { double ScalarField } = @1\n\n");
99 for (k = 0; k <
z; k++) {
100 for (j = 0; j <
y; j++) {
101 for (i = 0; i <
x; i++) {
103 tmp1 =
ntohll(*((
long long int*) & tmp));
104 fwrite(&tmp1, 1,
sizeof (
double), fd);
111 fd = fopen(filename,
"wb");
113 printf(
"-----------------------------------\n");
114 printf(
"The output directory does not exist\n");
115 printf(
"-----------------------------------\n");
118 fprintf(fd,
"# AmiraMesh BINARY 1.0\n");
119 fprintf(fd,
"\n# Dimensions in x-, y-, and z-direction\n");
120 fprintf(fd,
"define Lattice %i %i %i\n\n", x, y, z);
121 fprintf(fd,
"Parameters {\n CoordType \"uniform\"\n");
122 fprintf(fd,
" # BoundingBox is xmin xmax ymin ymax zmin zmax\n");
124 fprintf(fd,
"}\n\nLattice { double[3] ScalarField } = @1\n\n");
126 for (k = 0; k <
z; k++) {
127 for (j = 0; j <
y; j++) {
128 for (i = 0; i <
x; i++) {
129 tmp_vx =
vx[i][j][k];
130 tmp1_vx =
ntohll(*((
long long int*) & tmp_vx));
131 tmp_vy =
vy[i][j][k];
132 tmp1_vy =
ntohll(*((
long long int*) & tmp_vy));
133 tmp_vz =
vz[i][j][k];
134 tmp1_vz =
ntohll(*((
long long int*) & tmp_vz));
136 fwrite(&tmp1_vx, 1,
sizeof (
double), fd);
137 fwrite(&tmp1_vy, 1,
sizeof (
double), fd);
138 fwrite(&tmp1_vz, 1,
sizeof (
double), fd);
145 sprintf(filename,
"%spressure_on_solid_ic.am",
output_dir);
146 fd = fopen(filename,
"wb");
148 printf(
"-----------------------------------\n");
149 printf(
"The output directory does not exist\n");
150 printf(
"-----------------------------------\n");
153 fprintf(fd,
"# AmiraMesh BINARY 1.0\n");
154 fprintf(fd,
"\n# Dimensions in x-, y-, and z-direction\n");
155 fprintf(fd,
"define Lattice %i %i %i\n\n", x, y, z);
156 fprintf(fd,
"Parameters {\n CoordType \"uniform\"\n");
157 fprintf(fd,
" # BoundingBox is xmin xmax ymin ymax zmin zmax\n");
159 fprintf(fd,
"}\n\nLattice { double ScalarField } = @1\n\n");
161 for (k = 0; k <
z; k++) {
162 for (j = 0; j <
y; j++) {
163 for (i = 0; i <
x; i++) {
165 tmp1 =
ntohll(*((
long long int*) & tmp));
166 fwrite(&tmp1, 1,
sizeof (
double), fd);
173 sprintf(filename,
"%sdB_map_ic.am",
output_dir);
174 fd = fopen(filename,
"wb");
176 printf(
"-----------------------------------\n");
177 printf(
"The output directory does not exist\n");
178 printf(
"-----------------------------------\n");
181 fprintf(fd,
"# AmiraMesh BINARY 1.0\n");
182 fprintf(fd,
"\n# Dimensions in x-, y-, and z-direction\n");
183 fprintf(fd,
"define Lattice %i %i %i\n\n", x, y, z);
184 fprintf(fd,
"Parameters {\n CoordType \"uniform\"\n");
185 fprintf(fd,
" # BoundingBox is xmin xmax ymin ymax zmin zmax\n");
187 fprintf(fd,
"}\n\nLattice { double ScalarField } = @1\n\n");
189 for (k = 0; k <
z; k++) {
190 for (j = 0; j <
y; j++) {
191 for (i = 0; i <
x; i++) {
193 tmp1 =
ntohll(*((
long long int*) & tmp));
194 fwrite(&tmp1, 1,
sizeof (
double), fd);
203 sprintf(filename,
"%smarker_ic.am",
output_dir);
204 fd = fopen(filename,
"wb");
206 printf(
"-----------------------------------\n");
207 printf(
"The output directory does not exist\n");
208 printf(
"-----------------------------------\n");
211 fprintf(fd,
"# AmiraMesh BINARY 1.0\n");
212 fprintf(fd,
"\n# Dimensions in x-, y-, and z-direction\n");
213 fprintf(fd,
"define Lattice %i %i %i\n\n", x, y, z);
214 fprintf(fd,
"Parameters {\n CoordType \"uniform\"\n");
215 fprintf(fd,
" # BoundingBox is xmin xmax ymin ymax zmin zmax\n");
217 fprintf(fd,
"}\n\nLattice { double ScalarField } = @1\n\n");
219 for (k = 0; k <
z; k++) {
220 for (j = 0; j <
y; j++) {
221 for (i = 0; i <
x; i++) {
223 tmp1 =
ntohll(*((
long long int*) & tmp));
224 fwrite(&tmp1, 1,
sizeof (
double), fd);