16 static int conv_index_ucd2hec_rod1[] = {0, 1};
18 static int conv_index_ucd2hec_rod2[] = {0, -1, 2};
20 static int conv_index_ucd2hec_tri1[] = {0, 1, 2};
22 static int conv_index_ucd2hec_tri2[] = {0, 1, 2, -1, -1, -1};
24 static int conv_index_ucd2hec_qua1[] = {0, 1, 2, 3};
26 static int conv_index_ucd2hec_qua2[] = {0, 1, 2, 3, -1, -1, -1, -1};
28 static int conv_index_ucd2hec_tet1[] = {0, 3, 2, 1};
30 static int conv_index_ucd2hec_tet2[] = {0, 3, 2, 1, -1, -1, -1, -1, -1, -1};
32 static int conv_index_ucd2hec_pri1[] = {3, 4, 5, 0, 1, 2};
34 static int conv_index_ucd2hec_pri2[] = {3, 4, 5, 0, 1, 2, -1, -1,
35 -1, -1, -1, -1, -1, -1, -1};
37 static int conv_index_ucd2hec_hex1[] = {4, 5, 6, 7, 0, 1, 2, 3};
39 static int conv_index_ucd2hec_hex2[] = {4, 5, 6, 7, 0, 1, 2, 3, -1, -1,
40 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
42 static int conv_index_ucd2hec_pyr1[] = {4, 0, 1, 2, 3};
44 static int conv_index_ucd2hec_pyr2[] = {4, 0, 1, 2, 3, -1, -1,
45 -1, -1, -1, -1, -1, -1};
47 static int conv_index_ucd2hec_mst1[] = {0, 1, 2, 3};
49 static int conv_index_ucd2hec_mst2[] = {0, 1, 2, 3, -1, -1, -1, -1};
51 static int conv_index_ucd2hec_msq1[] = {0, 1, 2, 3, 4};
53 static int conv_index_ucd2hec_msq2[] = {0, 1, 2, 3, 4, -1, -1, -1, -1};
55 static int conv_index_ucd2hec_jtt1[] = {3, 4, 5, 0, 1, 2};
57 static int conv_index_ucd2hec_jtt2[] = {3, 4, 5, 0, 1, 2,
58 -1, -1, -1, -1, -1, -1};
60 static int conv_index_ucd2hec_jtq1[] = {4, 5, 6, 7, 0, 1, 2, 3};
62 static int conv_index_ucd2hec_jtq2[] = {4, 5, 6, 7, 0, 1, 2, 3,
63 -1, -1, -1, -1, -1, -1, -1, -1};
66 static int conv_index_ucd2hec_bem1[] = {
70 static int conv_index_ucd2hec_bem2[] = {
75 static int conv_index_ucd2hec_sht1[] = {0, 1, 2};
77 static int conv_index_ucd2hec_sht2[] = {0, 1, 2, -1, -1, -1};
79 static int conv_index_ucd2hec_shq1[] = {0, 1, 2, 3};
81 static int conv_index_ucd2hec_shq2[] = {0, 1, 2, 3, -1, -1, -1, -1};
83 static int conv_index_ucd2hec_ln[] = {0, 1};
85 static int conv_index_ucd2hec_ptt1[] = {0, 1, 2};
87 static int conv_index_ucd2hec_ptt2[] = {0, 1, 2, -1, -1, -1};
89 static int conv_index_ucd2hec_ptq1[] = {0, 1, 2, 3};
91 static int conv_index_ucd2hec_ptq2[] = {0, 1, 2, 3, -1, -1, -1, -1};
95 const char *ofname,
int flag_oldUCD) {
96 int nn_item = 0, ne_item = 0;
105 if (result ==
NULL) {
109 if (ofname ==
NULL) {
111 "output file name is not set");
115 if ((fp = fopen(ofname,
"w")) ==
NULL) {
120 for (nn_item = 0, i = 0; i < result->
nn_component; i++) {
121 nn_item += result->
nn_dof[i];
123 for (ne_item = 0, i = 0; i < result->
ne_component; i++) {
124 ne_item += result->
ne_dof[i];
132 fprintf(fp,
"# File Format : multi-step UCD data for unstructured mesh\n");
136 fprintf(fp,
"%d\n", 1);
137 fprintf(fp,
"data\n");
138 fprintf(fp,
"step%d\n", 1);
144 fprintf(fp,
"%d %.7lE %.7lE %.7lE\n", i + 1,
mesh->
node[3 * i],
152 fprintf(fp,
"%d %d %s", i + 1, 0,
156 if (conv_index_ucd2hec_rod1[j] >= 0) {
165 fprintf(fp,
"%d %d %s", i + 1, 0,
169 if (conv_index_ucd2hec_rod2[j] >= 0) {
178 fprintf(fp,
"%d %d %s", i + 1, 0,
182 if (conv_index_ucd2hec_tri1[j] >= 0) {
191 fprintf(fp,
"%d %d %s", i + 1, 0,
195 if (conv_index_ucd2hec_tri2[j] >= 0) {
204 fprintf(fp,
"%d %d %s", i + 1, 0,
208 if (conv_index_ucd2hec_qua1[j] >= 0) {
217 fprintf(fp,
"%d %d %s", i + 1, 0,
221 if (conv_index_ucd2hec_qua2[j] >= 0) {
230 fprintf(fp,
"%d %d %s", i + 1, 0,
234 if (conv_index_ucd2hec_tet1[j] >= 0) {
243 fprintf(fp,
"%d %d %s", i + 1, 0,
247 if (conv_index_ucd2hec_tet2[j] >= 0) {
256 fprintf(fp,
"%d %d %s", i + 1, 0,
260 if (conv_index_ucd2hec_pri1[j] >= 0) {
269 fprintf(fp,
"%d %d %s", i + 1, 0,
273 if (conv_index_ucd2hec_pri2[j] >= 0) {
282 fprintf(fp,
"%d %d %s", i + 1, 0,
286 if (conv_index_ucd2hec_hex1[j] >= 0) {
295 fprintf(fp,
"%d %d %s", i + 1, 0,
299 if (conv_index_ucd2hec_hex2[j] >= 0) {
308 fprintf(fp,
"%d %d %s", i + 1, 0,
312 if (conv_index_ucd2hec_pyr1[j] >= 0) {
321 fprintf(fp,
"%d %d %s", i + 1, 0,
325 if (conv_index_ucd2hec_pyr2[j] >= 0) {
334 fprintf(fp,
"%d %d %s", i + 1, 0,
338 if (conv_index_ucd2hec_mst1[j] >= 0) {
347 fprintf(fp,
"%d %d %s", i + 1, 0,
351 if (conv_index_ucd2hec_mst2[j] >= 0) {
360 fprintf(fp,
"%d %d %s", i + 1, 0,
364 if (conv_index_ucd2hec_msq1[j] >= 0) {
373 fprintf(fp,
"%d %d %s", i + 1, 0,
377 if (conv_index_ucd2hec_msq2[j] >= 0) {
386 fprintf(fp,
"%d %d %s", i + 1, 0,
390 if (conv_index_ucd2hec_rod1[j] >= 0) {
399 fprintf(fp,
"%d %d %s", i + 1, 0,
403 if (conv_index_ucd2hec_jtt1[j] >= 0) {
412 fprintf(fp,
"%d %d %s", i + 1, 0,
416 if (conv_index_ucd2hec_jtt2[j] >= 0) {
425 fprintf(fp,
"%d %d %s", i + 1, 0,
429 if (conv_index_ucd2hec_jtq1[j] >= 0) {
438 fprintf(fp,
"%d %d %s", i + 1, 0,
442 if (conv_index_ucd2hec_jtq2[j] >= 0) {
451 fprintf(fp,
"%d %d %s", i + 1, 0,
455 if (conv_index_ucd2hec_sht1[j] >= 0) {
464 fprintf(fp,
"%d %d %s", i + 1, 0,
468 if (conv_index_ucd2hec_sht2[j] >= 0) {
477 fprintf(fp,
"%d %d %s", i + 1, 0,
481 if (conv_index_ucd2hec_shq1[j] >= 0) {
490 fprintf(fp,
"%d %d %s", i + 1, 0,
494 if (conv_index_ucd2hec_shq2[j] >= 0) {
538 fprintf(fp,
"%d %d %s", i + 1, 0,
542 if (conv_index_ucd2hec_ln[j] >= 0) {
551 fprintf(fp,
"%d %d %s", i + 1, 0,
555 if (conv_index_ucd2hec_ptt1[j] >= 0) {
564 fprintf(fp,
"%d %d %s", i + 1, 0,
568 if (conv_index_ucd2hec_ptt2[j] >= 0) {
577 fprintf(fp,
"%d %d %s", i + 1, 0,
581 if (conv_index_ucd2hec_ptq1[j] >= 0) {
590 fprintf(fp,
"%d %d %s", i + 1, 0,
594 if (conv_index_ucd2hec_ptq2[j] >= 0) {
610 fprintf(fp,
"%d %d\n", nn_item, ne_item);
616 fprintf(fp,
" %d", result->
nn_dof[i]);
621 fprintf(fp,
"%s, unit_unknown\n", result->
node_label[i]);
625 fprintf(fp,
"%d", i + 1);
626 for (j = 0; j < nn_item; j++) {
627 fprintf(fp,
" %.7lE", result->
node_val_item[nn_item * i + j]);
636 fprintf(fp,
" %d", result->
ne_dof[i]);
641 fprintf(fp,
"%s, unit_unknown\n", result->
elem_label[i]);
645 fprintf(fp,
"%d", i + 1);
646 for (j = 0; j < ne_item; j++) {
647 fprintf(fp,
" %.7lE", result->
elem_val_item[ne_item * i + j]);
660 const char *ofname) {
662 return ucd_print(
mesh, result, ofname, flag_oldUCD);
667 const char *ofname) {
669 return ucd_print(
mesh, result, ofname, flag_oldUCD);