20 static int convert_longlong_to_int_ary(
const long long *src,
int *dst,
21 size_t n,
const char *name) {
24 for (i = 0; i < n; i++) {
25 if (src[i] > INT_MAX || src[i] < INT_MIN) {
27 "mesh copy(C->Fortran): %s[%zu]=%lld exceeds INT range",
28 name ? name :
"array", i, src[i]);
41 static int set_hecmw_flag_adapt(
void *dst) {
47 memcpy(dst, src, size);
52 static int set_hecmw_flag_initcon(
void *dst) {
58 memcpy(dst, src, size);
63 static int set_hecmw_flag_parttype(
void *dst) {
69 memcpy(dst, src, size);
74 static int set_hecmw_flag_partdepth(
void *dst) {
80 memcpy(dst, src, size);
84 static int set_hecmw_flag_version(
void *dst) {
90 memcpy(dst, src, size);
95 static int set_hecmw_flag_partcontact(
void *dst) {
101 memcpy(dst, src, size);
106 static int set_gridfile(
void *dst) {
115 static int set_hecmw_n_file(
void *dst) {
121 memcpy(dst, src, size);
126 static int set_files(
void *dst) {
133 char *src = mesh->
files[i];
140 static int set_header(
void *dst) {
149 static int set_zero_temp(
void *dst) {
155 memcpy(dst, src, size);
160 static int set_n_node(
void *dst) {
165 size =
sizeof(mesh->
n_node);
166 memcpy(dst, src, size);
171 static int set_n_node_gross(
void *dst) {
177 memcpy(dst, src, size);
182 static int set_nn_middle(
void *dst) {
188 memcpy(dst, src, size);
193 static int set_nn_internal(
void *dst) {
199 memcpy(dst, src, size);
204 static int set_node_internal_list(
void *dst) {
212 memcpy(dst, src, size);
217 static int set_node_ID(
void *dst) {
225 memcpy(dst, src, size);
230 static int set_global_node_ID(
void *dst) {
238 memcpy(dst, src, size);
243 static int set_node(
void *dst) {
251 memcpy(dst, src, size);
256 static int set_n_dof(
void *dst) {
261 size =
sizeof(mesh->
n_dof);
262 memcpy(dst, src, size);
267 static int set_n_dof_grp(
void *dst) {
273 memcpy(dst, src, size);
278 static int set_n_dof_tot(
void *dst) {
284 memcpy(dst, src, size);
289 static int set_node_dof_index(
void *dst) {
297 memcpy(dst, src, size);
302 static int set_node_dof_item(
void *dst) {
310 memcpy(dst, src, size);
315 static int set_node_val_index(
void *dst) {
323 memcpy(dst, src, size);
328 static int set_node_val_item(
void *dst) {
337 memcpy(dst, src, size);
342 static int set_node_init_val_index(
void *dst) {
350 memcpy(dst, src, size);
355 static int set_node_init_val_item(
void *dst) {
364 memcpy(dst, src, size);
369 static int set_n_elem(
void *dst) {
374 size =
sizeof(mesh->
n_elem);
375 memcpy(dst, src, size);
380 static int set_n_elem_gross(
void *dst) {
386 memcpy(dst, src, size);
391 static int set_ne_internal(
void *dst) {
397 memcpy(dst, src, size);
402 static int set_elem_internal_list(
void *dst) {
410 memcpy(dst, src, size);
415 static int set_elem_ID(
void *dst) {
423 memcpy(dst, src, size);
428 static int set_global_elem_ID(
void *dst) {
436 memcpy(dst, src, size);
441 static int set_elem_type(
void *dst) {
449 memcpy(dst, src, size);
454 static int set_n_elem_type(
void *dst) {
460 memcpy(dst, src, size);
465 static int set_elem_type_index(
void *dst) {
473 memcpy(dst, src, size);
478 static int set_elem_type_item(
void *dst) {
486 memcpy(dst, src, size);
491 static int set_elem_node_index(
void *dst) {
492 int *dst_int = (
int *)dst;
499 "elem_node_index") != 0) {
506 static int set_elem_node_item(
void *dst) {
515 memcpy(dst, src, size);
520 static int set_section_ID(
void *dst) {
528 memcpy(dst, src, size);
533 static int set_n_elem_mat_ID(
void *dst) {
539 memcpy(dst, src, size);
544 static int set_elem_mat_ID_index(
void *dst) {
552 memcpy(dst, src, size);
557 static int set_elem_mat_ID_item(
void *dst) {
566 memcpy(dst, src, size);
571 static int set_elem_mat_int_index(
void *dst) {
579 memcpy(dst, src, size);
584 static int set_elem_mat_int_val(
void *dst) {
593 memcpy(dst, src, size);
598 static int set_elem_val_index(
void *dst) {
606 memcpy(dst, src, size);
611 static int set_elem_val_item(
void *dst) {
620 memcpy(dst, src, size);
625 static int set_zero(
void *dst) {
630 size =
sizeof(mesh->
zero);
631 memcpy(dst, src, size);
636 static int set_HECMW_COMM(
void *dst) {
644 memcpy(dst, src, size);
649 static int set_PETOT(
void *dst) {
654 size =
sizeof(mesh->
PETOT);
655 memcpy(dst, src, size);
660 static int set_PEsmpTOT(
void *dst) {
666 memcpy(dst, src, size);
671 static int set_my_rank(
void *dst) {
677 memcpy(dst, src, size);
682 static int set_errnof(
void *dst) {
687 size =
sizeof(mesh->
errnof);
688 memcpy(dst, src, size);
693 static int set_n_subdomain(
void *dst) {
699 memcpy(dst, src, size);
704 static int set_n_neighbor_pe(
void *dst) {
710 memcpy(dst, src, size);
715 static int set_neighbor_pe(
void *dst) {
723 memcpy(dst, src, size);
728 static int set_import_index(
void *dst) {
736 memcpy(dst, src, size);
741 static int set_import_item(
void *dst) {
749 memcpy(dst, src, size);
754 static int set_export_index(
void *dst) {
762 memcpy(dst, src, size);
767 static int set_export_item(
void *dst) {
775 memcpy(dst, src, size);
780 static int set_shared_index(
void *dst) {
788 memcpy(dst, src, size);
793 static int set_shared_item(
void *dst) {
801 memcpy(dst, src, size);
806 static int set_coarse_grid_level(
void *dst) {
812 memcpy(dst, src, size);
817 static int set_n_adapt(
void *dst) {
823 memcpy(dst, src, size);
828 static int set_when_i_was_refined_node(
void *dst) {
836 memcpy(dst, src, size);
841 static int set_when_i_was_refined_elem(
void *dst) {
849 memcpy(dst, src, size);
854 static int set_adapt_parent_type(
void *dst) {
862 memcpy(dst, src, size);
867 static int set_adapt_type(
void *dst) {
875 memcpy(dst, src, size);
880 static int set_adapt_level(
void *dst) {
888 memcpy(dst, src, size);
893 static int set_adapt_parent(
void *dst) {
901 memcpy(dst, src, size);
906 static int set_adapt_children_index(
void *dst) {
914 memcpy(dst, src, size);
919 static int set_adapt_children_item(
void *dst) {
928 memcpy(dst, src, size);
933 static int set_n_refine(
void *dst) {
939 memcpy(dst, src, size);
944 static int set_node_old2new(
void *dst) {
952 memcpy(dst, src, size);
957 static int set_node_new2old(
void *dst) {
965 memcpy(dst, src, size);
970 static int set_elem_old2new(
void *dst) {
978 memcpy(dst, src, size);
983 static int set_elem_new2old(
void *dst) {
991 memcpy(dst, src, size);
996 static int set_n_node_refine_hist(
void *dst) {
1005 memcpy(dst, src, size);
1010 static int set_n_sect(
void *dst) {
1016 size =
sizeof(sect->
n_sect);
1017 memcpy(dst, src, size);
1022 static int set_sect_type(
void *dst) {
1027 if (sect->
n_sect <= 0)
return 0;
1031 memcpy(dst, src, size);
1036 static int set_sect_opt(
void *dst) {
1041 if (sect->
n_sect <= 0)
return 0;
1045 memcpy(dst, src, size);
1050 static int set_sect_mat_ID_index(
void *dst) {
1055 if (sect->
n_sect <= 0)
return 0;
1059 memcpy(dst, src, size);
1064 static int set_sect_mat_ID_item(
void *dst) {
1069 if (sect->
n_sect <= 0)
return 0;
1074 memcpy(dst, src, size);
1079 static int set_sect_I_index(
void *dst) {
1084 if (sect->
n_sect <= 0)
return 0;
1088 memcpy(dst, src, size);
1093 static int set_sect_I_item(
void *dst) {
1098 if (sect->
n_sect <= 0)
return 0;
1103 memcpy(dst, src, size);
1108 static int set_sect_R_index(
void *dst) {
1113 if (sect->
n_sect <= 0)
return 0;
1117 memcpy(dst, src, size);
1122 static int set_sect_R_item(
void *dst) {
1127 if (sect->
n_sect <= 0)
return 0;
1131 memcpy(dst, src, size);
1136 static int set_n_mat(
void *dst) {
1142 size =
sizeof(mat->
n_mat);
1143 memcpy(dst, src, size);
1148 static int set_n_mat_item(
void *dst) {
1155 memcpy(dst, src, size);
1160 static int set_n_mat_subitem(
void *dst) {
1167 memcpy(dst, src, size);
1172 static int set_n_mat_table(
void *dst) {
1179 memcpy(dst, src, size);
1184 static int set_mat_name(
void *dst) {
1188 if (mat->
n_mat <= 0)
return 0;
1190 for (i = 0; i < mat->
n_mat; i++) {
1199 static int set_mat_item_index(
void *dst) {
1204 if (mat->
n_mat <= 0)
return 0;
1208 memcpy(dst, src, size);
1213 static int set_mat_subitem_index(
void *dst) {
1222 memcpy(dst, src, size);
1227 static int set_mat_table_index(
void *dst) {
1236 memcpy(dst, src, size);
1241 static int set_mat_val(
void *dst) {
1246 if (mat->
n_mat <= 0)
return 0;
1250 memcpy(dst, src, size);
1255 static int set_mat_temp(
void *dst) {
1260 if (mat->
n_mat <= 0)
return 0;
1264 memcpy(dst, src, size);
1269 static int set_n_mpc(
void *dst) {
1275 size =
sizeof(mpc->
n_mpc);
1276 memcpy(dst, src, size);
1281 static int set_mpc_index(
void *dst) {
1286 if (mpc->
n_mpc <= 0)
return 0;
1290 memcpy(dst, src, size);
1295 static int set_mpc_item(
void *dst) {
1300 if (mpc->
n_mpc <= 0)
return 0;
1304 memcpy(dst, src, size);
1309 static int set_mpc_dof(
void *dst) {
1314 if (mpc->
n_mpc <= 0)
return 0;
1318 memcpy(dst, src, size);
1323 static int set_mpc_val(
void *dst) {
1328 if (mpc->
n_mpc <= 0)
return 0;
1332 memcpy(dst, src, size);
1337 static int set_mpc_const(
void *dst) {
1342 if (mpc->
n_mpc <= 0)
return 0;
1346 memcpy(dst, src, size);
1351 static int set_n_amp(
void *dst) {
1357 size =
sizeof(amp->
n_amp);
1358 memcpy(dst, src, size);
1363 static int set_amp_name(
void *dst) {
1367 if (amp->
n_amp <= 0)
return 0;
1369 for (i = 0; i < amp->
n_amp; i++) {
1378 static int set_amp_type_definition(
void *dst) {
1383 if (amp->
n_amp <= 0)
return 0;
1387 memcpy(dst, src, size);
1392 static int set_amp_type_time(
void *dst) {
1397 if (amp->
n_amp <= 0)
return 0;
1401 memcpy(dst, src, size);
1406 static int set_amp_type_value(
void *dst) {
1411 if (amp->
n_amp <= 0)
return 0;
1415 memcpy(dst, src, size);
1420 static int set_amp_index(
void *dst) {
1425 if (amp->
n_amp <= 0)
return 0;
1429 memcpy(dst, src, size);
1434 static int set_amp_val(
void *dst) {
1439 if (amp->
n_amp <= 0)
return 0;
1443 memcpy(dst, src, size);
1448 static int set_amp_table(
void *dst) {
1453 if (amp->
n_amp <= 0)
return 0;
1457 memcpy(dst, src, size);
1462 static int set_ngrp_n_grp(
void *dst) {
1468 size =
sizeof(grp->
n_grp);
1469 memcpy(dst, src, size);
1474 static int set_ngrp_n_bc(
void *dst) {
1480 size =
sizeof(grp->
n_bc);
1481 memcpy(dst, src, size);
1486 static int set_ngrp_grp_name(
void *dst) {
1490 if (grp->
n_grp <= 0)
return 0;
1492 for (i = 0; i < grp->
n_grp; i++) {
1501 static int set_ngrp_grp_index(
void *dst) {
1506 if (grp->
n_grp <= 0)
return 0;
1510 memcpy(dst, src, size);
1515 static int set_ngrp_grp_item(
void *dst) {
1520 if (grp->
n_grp <= 0)
return 0;
1524 memcpy(dst, src, size);
1529 static int set_ngrp_bc_grp_ID(
void *dst) {
1534 if (grp->
n_bc <= 0)
return 0;
1538 memcpy(dst, src, size);
1543 static int set_ngrp_bc_grp_type(
void *dst) {
1548 if (grp->
n_bc <= 0)
return 0;
1552 memcpy(dst, src, size);
1557 static int set_ngrp_bc_grp_index(
void *dst) {
1562 if (grp->
n_bc <= 0)
return 0;
1566 memcpy(dst, src, size);
1571 static int set_ngrp_bc_grp_dof(
void *dst) {
1576 if (grp->
n_bc <= 0)
return 0;
1580 memcpy(dst, src, size);
1585 static int set_ngrp_bc_grp_val(
void *dst) {
1590 if (grp->
n_bc <= 0)
return 0;
1594 memcpy(dst, src, size);
1599 static int set_egrp_n_grp(
void *dst) {
1605 size =
sizeof(grp->
n_grp);
1606 memcpy(dst, src, size);
1611 static int set_egrp_n_bc(
void *dst) {
1617 size =
sizeof(grp->
n_bc);
1618 memcpy(dst, src, size);
1623 static int set_egrp_grp_name(
void *dst) {
1627 if (grp->
n_grp <= 0)
return 0;
1629 for (i = 0; i < grp->
n_grp; i++) {
1638 static int set_egrp_grp_index(
void *dst) {
1643 if (grp->
n_grp <= 0)
return 0;
1647 memcpy(dst, src, size);
1652 static int set_egrp_grp_item(
void *dst) {
1657 if (grp->
n_grp <= 0)
return 0;
1661 memcpy(dst, src, size);
1666 static int set_egrp_bc_grp_ID(
void *dst) {
1671 if (grp->
n_bc <= 0)
return 0;
1675 memcpy(dst, src, size);
1680 static int set_egrp_bc_grp_type(
void *dst) {
1685 if (grp->
n_bc <= 0)
return 0;
1689 memcpy(dst, src, size);
1694 static int set_egrp_bc_grp_index(
void *dst) {
1699 if (grp->
n_bc <= 0)
return 0;
1703 memcpy(dst, src, size);
1708 static int set_egrp_bc_grp_val(
void *dst) {
1713 if (grp->
n_bc <= 0)
return 0;
1717 memcpy(dst, src, size);
1722 static int set_sgrp_n_grp(
void *dst) {
1728 size =
sizeof(grp->
n_grp);
1729 memcpy(dst, src, size);
1734 static int set_sgrp_n_bc(
void *dst) {
1740 size =
sizeof(grp->
n_bc);
1741 memcpy(dst, src, size);
1746 static int set_sgrp_grp_name(
void *dst) {
1750 if (grp->
n_grp <= 0)
return 0;
1752 for (i = 0; i < grp->
n_grp; i++) {
1761 static int set_sgrp_grp_index(
void *dst) {
1766 if (grp->
n_grp <= 0)
return 0;
1770 memcpy(dst, src, size);
1775 static int set_sgrp_grp_item(
void *dst) {
1780 if (grp->
n_grp <= 0)
return 0;
1784 memcpy(dst, src, size);
1789 static int set_sgrp_bc_grp_ID(
void *dst) {
1794 if (grp->
n_bc <= 0)
return 0;
1798 memcpy(dst, src, size);
1803 static int set_sgrp_bc_grp_type(
void *dst) {
1808 if (grp->
n_bc <= 0)
return 0;
1812 memcpy(dst, src, size);
1817 static int set_sgrp_bc_grp_index(
void *dst) {
1822 if (grp->
n_bc <= 0)
return 0;
1826 memcpy(dst, src, size);
1831 static int set_sgrp_bc_grp_val(
void *dst) {
1836 if (grp->
n_bc <= 0)
return 0;
1840 memcpy(dst, src, size);
1845 static int set_contact_pair_n_pair(
void *dst) {
1851 size =
sizeof(cpair->
n_pair);
1852 memcpy(dst, src, size);
1857 static int set_contact_pair_name(
void *dst) {
1861 if (cpair->
n_pair <= 0)
return 0;
1863 for (i = 0; i < cpair->
n_pair; i++) {
1865 char *src = cpair->
name[i];
1872 static int set_contact_pair_type(
void *dst) {
1877 if (cpair->
n_pair <= 0)
return 0;
1880 size =
sizeof(*cpair->
type) * (cpair->
n_pair);
1881 memcpy(dst, src, size);
1886 static int set_contact_pair_slave_grp_id(
void *dst) {
1891 if (cpair->
n_pair <= 0)
return 0;
1895 memcpy(dst, src, size);
1900 static int set_contact_pair_slave_orisgrp_id(
void *dst) {
1905 if (cpair->
n_pair <= 0)
return 0;
1909 memcpy(dst, src, size);
1914 static int set_contact_pair_master_grp_id(
void *dst) {
1919 if (cpair->
n_pair <= 0)
return 0;
1923 memcpy(dst, src, size);
1928 static int set_refine_origin_index(
void *dst) {
1933 src = reforg->
index;
1935 memcpy(dst, src, size);
1940 static int set_refine_origin_item_index(
void *dst) {
1947 memcpy(dst, src, size);
1952 static int set_refine_origin_item_item(
void *dst) {
1960 memcpy(dst, src, size);
1967 static int is_alloc_node_internal_list(
void) {
1971 static int is_alloc_node_val_index(
void) {
1975 static int is_alloc_node_val_item(
void) {
return mesh->
node_val_item ? 1 : 0; }
1977 static int is_alloc_node_init_val_index(
void) {
1981 static int is_alloc_node_init_val_item(
void) {
1985 static int is_alloc_elem_internal_list(
void) {
1989 static int is_alloc_elem_mat_int_index(
void) {
1993 static int is_alloc_elem_mat_int_val(
void) {
1997 static int is_alloc_elem_val_index(
void) {
2001 static int is_alloc_elem_val_item(
void) {
return mesh->
elem_val_item ? 1 : 0; }
2003 static int is_alloc_node_old2new(
void) {
return mesh->
node_old2new ? 1 : 0; }
2005 static int is_alloc_node_new2old(
void) {
return mesh->
node_new2old ? 1 : 0; }
2007 static int is_alloc_elem_old2new(
void) {
return mesh->
elem_old2new ? 1 : 0; }
2009 static int is_alloc_elem_new2old(
void) {
return mesh->
elem_new2old ? 1 : 0; }
2011 static int is_alloc_n_node_refine_hist(
void) {
2015 static int is_alloc_when_i_was_refined_node(
void) {
2019 static int is_alloc_when_i_was_refined_elem(
void) {
2023 static int is_alloc_adapt_parent_type(
void) {
2027 static int is_alloc_adapt_type(
void) {
return mesh->
adapt_type ? 1 : 0; }
2029 static int is_alloc_adapt_level(
void) {
return mesh->
adapt_level ? 1 : 0; }
2031 static int is_alloc_adapt_parent(
void) {
return mesh->
adapt_parent ? 1 : 0; }
2033 static int is_alloc_adapt_children_index(
void) {
2037 static int is_alloc_adapt_children_item(
void) {
2041 static int is_alloc_ngrp_bc_grp_ID(
void) {
2045 static int is_alloc_ngrp_bc_grp_type(
void) {
2049 static int is_alloc_ngrp_bc_grp_index(
void) {
2053 static int is_alloc_ngrp_bc_grp_dof(
void) {
2057 static int is_alloc_ngrp_bc_grp_val(
void) {
2061 static int is_alloc_egrp_bc_grp_ID(
void) {
2065 static int is_alloc_egrp_bc_grp_type(
void) {
2069 static int is_alloc_egrp_bc_grp_index(
void) {
2073 static int is_alloc_egrp_bc_grp_val(
void) {
2077 static int is_alloc_sgrp_bc_grp_ID(
void) {
2081 static int is_alloc_sgrp_bc_grp_type(
void) {
2085 static int is_alloc_sgrp_bc_grp_index(
void) {
2089 static int is_alloc_sgrp_bc_grp_val(
void) {
2100 static struct func_table {
2109 {
"hecmwST_local_mesh",
"hecmw_flag_adapt", set_hecmw_flag_adapt,
NULL},
2110 {
"hecmwST_local_mesh",
"hecmw_flag_initcon", set_hecmw_flag_initcon,
2112 {
"hecmwST_local_mesh",
"hecmw_flag_parttype", set_hecmw_flag_parttype,
2114 {
"hecmwST_local_mesh",
"hecmw_flag_partdepth", set_hecmw_flag_partdepth,
2116 {
"hecmwST_local_mesh",
"hecmw_flag_version", set_hecmw_flag_version,
2118 {
"hecmwST_local_mesh",
"hecmw_flag_partcontact",
2119 set_hecmw_flag_partcontact,
NULL},
2121 {
"hecmwST_local_mesh",
"gridfile", set_gridfile,
NULL},
2122 {
"hecmwST_local_mesh",
"hecmw_n_file", set_hecmw_n_file,
NULL},
2123 {
"hecmwST_local_mesh",
"files", set_files,
NULL},
2124 {
"hecmwST_local_mesh",
"header", set_header,
NULL},
2125 {
"hecmwST_local_mesh",
"zero_temp", set_zero_temp,
NULL},
2127 {
"hecmwST_local_mesh",
"n_node", set_n_node,
NULL},
2128 {
"hecmwST_local_mesh",
"n_node_gross", set_n_node_gross,
NULL},
2129 {
"hecmwST_local_mesh",
"nn_middle", set_nn_middle,
NULL},
2130 {
"hecmwST_local_mesh",
"nn_internal", set_nn_internal,
NULL},
2131 {
"hecmwST_local_mesh",
"node_internal_list", set_node_internal_list,
2132 is_alloc_node_internal_list},
2133 {
"hecmwST_local_mesh",
"node_ID", set_node_ID,
NULL},
2134 {
"hecmwST_local_mesh",
"global_node_ID", set_global_node_ID,
NULL},
2135 {
"hecmwST_local_mesh",
"node", set_node,
NULL},
2136 {
"hecmwST_local_mesh",
"n_dof", set_n_dof,
NULL},
2137 {
"hecmwST_local_mesh",
"n_dof_grp", set_n_dof_grp,
NULL},
2138 {
"hecmwST_local_mesh",
"n_dof_tot", set_n_dof_tot,
NULL},
2139 {
"hecmwST_local_mesh",
"node_dof_index", set_node_dof_index,
NULL},
2140 {
"hecmwST_local_mesh",
"node_dof_item", set_node_dof_item,
NULL},
2141 {
"hecmwST_local_mesh",
"node_val_index", set_node_val_index,
2142 is_alloc_node_val_index},
2143 {
"hecmwST_local_mesh",
"node_val_item", set_node_val_item,
2144 is_alloc_node_val_item},
2145 {
"hecmwST_local_mesh",
"node_init_val_index", set_node_init_val_index,
2146 is_alloc_node_init_val_index},
2147 {
"hecmwST_local_mesh",
"node_init_val_item", set_node_init_val_item,
2148 is_alloc_node_init_val_item},
2149 {
"hecmwST_local_mesh",
"n_elem", set_n_elem,
NULL},
2150 {
"hecmwST_local_mesh",
"n_elem_gross", set_n_elem_gross,
NULL},
2151 {
"hecmwST_local_mesh",
"ne_internal", set_ne_internal,
NULL},
2152 {
"hecmwST_local_mesh",
"elem_internal_list", set_elem_internal_list,
2153 is_alloc_elem_internal_list},
2154 {
"hecmwST_local_mesh",
"elem_ID", set_elem_ID,
NULL},
2155 {
"hecmwST_local_mesh",
"global_elem_ID", set_global_elem_ID,
NULL},
2156 {
"hecmwST_local_mesh",
"elem_type", set_elem_type,
NULL},
2157 {
"hecmwST_local_mesh",
"n_elem_type", set_n_elem_type,
NULL},
2158 {
"hecmwST_local_mesh",
"elem_type_index", set_elem_type_index,
NULL},
2159 {
"hecmwST_local_mesh",
"elem_type_item", set_elem_type_item,
NULL},
2160 {
"hecmwST_local_mesh",
"elem_node_index", set_elem_node_index,
NULL},
2161 {
"hecmwST_local_mesh",
"elem_node_item", set_elem_node_item,
NULL},
2162 {
"hecmwST_local_mesh",
"section_ID", set_section_ID,
NULL},
2163 {
"hecmwST_local_mesh",
"n_elem_mat_ID", set_n_elem_mat_ID,
NULL},
2164 {
"hecmwST_local_mesh",
"elem_mat_ID_index", set_elem_mat_ID_index,
2166 {
"hecmwST_local_mesh",
"elem_mat_ID_item", set_elem_mat_ID_item,
NULL},
2167 {
"hecmwST_local_mesh",
"elem_mat_int_index", set_elem_mat_int_index,
2168 is_alloc_elem_mat_int_index},
2169 {
"hecmwST_local_mesh",
"elem_mat_int_val", set_elem_mat_int_val,
2170 is_alloc_elem_mat_int_val},
2171 {
"hecmwST_local_mesh",
"elem_val_index", set_elem_val_index,
2172 is_alloc_elem_val_index},
2173 {
"hecmwST_local_mesh",
"elem_val_item", set_elem_val_item,
2174 is_alloc_elem_val_item},
2176 {
"hecmwST_local_mesh",
"zero", set_zero,
NULL},
2177 {
"hecmwST_local_mesh",
"HECMW_COMM", set_HECMW_COMM,
NULL},
2178 {
"hecmwST_local_mesh",
"PETOT", set_PETOT,
NULL},
2179 {
"hecmwST_local_mesh",
"PEsmpTOT", set_PEsmpTOT,
NULL},
2180 {
"hecmwST_local_mesh",
"my_rank", set_my_rank,
NULL},
2181 {
"hecmwST_local_mesh",
"errnof", set_errnof,
NULL},
2182 {
"hecmwST_local_mesh",
"n_subdomain", set_n_subdomain,
NULL},
2183 {
"hecmwST_local_mesh",
"n_neighbor_pe", set_n_neighbor_pe,
NULL},
2184 {
"hecmwST_local_mesh",
"neighbor_pe", set_neighbor_pe,
NULL},
2185 {
"hecmwST_local_mesh",
"import_index", set_import_index,
NULL},
2186 {
"hecmwST_local_mesh",
"import_item", set_import_item,
NULL},
2187 {
"hecmwST_local_mesh",
"export_index", set_export_index,
NULL},
2188 {
"hecmwST_local_mesh",
"export_item", set_export_item,
NULL},
2189 {
"hecmwST_local_mesh",
"shared_index", set_shared_index,
NULL},
2190 {
"hecmwST_local_mesh",
"shared_item", set_shared_item,
NULL},
2192 {
"hecmwST_local_mesh",
"coarse_grid_level", set_coarse_grid_level,
2194 {
"hecmwST_local_mesh",
"n_adapt", set_n_adapt,
NULL},
2195 {
"hecmwST_local_mesh",
"when_i_was_refined_node",
2196 set_when_i_was_refined_node, is_alloc_when_i_was_refined_node},
2197 {
"hecmwST_local_mesh",
"when_i_was_refined_elem",
2198 set_when_i_was_refined_elem, is_alloc_when_i_was_refined_elem},
2199 {
"hecmwST_local_mesh",
"adapt_parent_type", set_adapt_parent_type,
2200 is_alloc_adapt_parent_type},
2201 {
"hecmwST_local_mesh",
"adapt_type", set_adapt_type,
2202 is_alloc_adapt_type},
2203 {
"hecmwST_local_mesh",
"adapt_level", set_adapt_level,
2204 is_alloc_adapt_level},
2205 {
"hecmwST_local_mesh",
"adapt_parent", set_adapt_parent,
2206 is_alloc_adapt_parent},
2207 {
"hecmwST_local_mesh",
"adapt_children_index", set_adapt_children_index,
2208 is_alloc_adapt_children_index},
2209 {
"hecmwST_local_mesh",
"adapt_children_item", set_adapt_children_item,
2210 is_alloc_adapt_children_item},
2212 {
"hecmwST_local_mesh",
"n_refine", set_n_refine,
NULL},
2213 {
"hecmwST_local_mesh",
"node_old2new", set_node_old2new,
2214 is_alloc_node_old2new},
2215 {
"hecmwST_local_mesh",
"node_new2old", set_node_new2old,
2216 is_alloc_node_new2old},
2217 {
"hecmwST_local_mesh",
"elem_old2new", set_elem_old2new,
2218 is_alloc_elem_old2new},
2219 {
"hecmwST_local_mesh",
"elem_new2old", set_elem_new2old,
2220 is_alloc_elem_new2old},
2221 {
"hecmwST_local_mesh",
"n_node_refine_hist", set_n_node_refine_hist,
2222 is_alloc_n_node_refine_hist},
2224 {
"hecmwST_section",
"n_sect", set_n_sect,
NULL},
2225 {
"hecmwST_section",
"sect_type", set_sect_type,
NULL},
2226 {
"hecmwST_section",
"sect_opt", set_sect_opt,
NULL},
2227 {
"hecmwST_section",
"sect_mat_ID_index", set_sect_mat_ID_index,
NULL},
2228 {
"hecmwST_section",
"sect_mat_ID_item", set_sect_mat_ID_item,
NULL},
2229 {
"hecmwST_section",
"sect_I_index", set_sect_I_index,
NULL},
2230 {
"hecmwST_section",
"sect_I_item", set_sect_I_item,
NULL},
2231 {
"hecmwST_section",
"sect_R_index", set_sect_R_index,
NULL},
2232 {
"hecmwST_section",
"sect_R_item", set_sect_R_item,
NULL},
2234 {
"hecmwST_material",
"n_mat", set_n_mat,
NULL},
2235 {
"hecmwST_material",
"n_mat_item", set_n_mat_item,
NULL},
2236 {
"hecmwST_material",
"n_mat_subitem", set_n_mat_subitem,
NULL},
2237 {
"hecmwST_material",
"n_mat_table", set_n_mat_table,
NULL},
2238 {
"hecmwST_material",
"mat_name", set_mat_name,
NULL},
2239 {
"hecmwST_material",
"mat_item_index", set_mat_item_index,
NULL},
2240 {
"hecmwST_material",
"mat_subitem_index", set_mat_subitem_index,
NULL},
2241 {
"hecmwST_material",
"mat_table_index", set_mat_table_index,
NULL},
2242 {
"hecmwST_material",
"mat_val", set_mat_val,
NULL},
2243 {
"hecmwST_material",
"mat_temp", set_mat_temp,
NULL},
2245 {
"hecmwST_mpc",
"n_mpc", set_n_mpc,
NULL},
2246 {
"hecmwST_mpc",
"mpc_index", set_mpc_index,
NULL},
2247 {
"hecmwST_mpc",
"mpc_item", set_mpc_item,
NULL},
2248 {
"hecmwST_mpc",
"mpc_dof", set_mpc_dof,
NULL},
2249 {
"hecmwST_mpc",
"mpc_val", set_mpc_val,
NULL},
2250 {
"hecmwST_mpc",
"mpc_const", set_mpc_const,
NULL},
2252 {
"hecmwST_amplitude",
"n_amp", set_n_amp,
NULL},
2253 {
"hecmwST_amplitude",
"amp_name", set_amp_name,
NULL},
2254 {
"hecmwST_amplitude",
"amp_type_definition", set_amp_type_definition,
2256 {
"hecmwST_amplitude",
"amp_type_time", set_amp_type_time,
NULL},
2257 {
"hecmwST_amplitude",
"amp_type_value", set_amp_type_value,
NULL},
2258 {
"hecmwST_amplitude",
"amp_index", set_amp_index,
NULL},
2259 {
"hecmwST_amplitude",
"amp_val", set_amp_val,
NULL},
2260 {
"hecmwST_amplitude",
"amp_table", set_amp_table,
NULL},
2262 {
"hecmwST_node_grp",
"n_grp", set_ngrp_n_grp,
NULL},
2263 {
"hecmwST_node_grp",
"grp_name", set_ngrp_grp_name,
NULL},
2264 {
"hecmwST_node_grp",
"grp_index", set_ngrp_grp_index,
NULL},
2265 {
"hecmwST_node_grp",
"grp_item", set_ngrp_grp_item,
NULL},
2266 {
"hecmwST_node_grp",
"n_bc", set_ngrp_n_bc,
NULL},
2267 {
"hecmwST_node_grp",
"bc_grp_ID", set_ngrp_bc_grp_ID,
2268 is_alloc_ngrp_bc_grp_ID},
2269 {
"hecmwST_node_grp",
"bc_grp_type", set_ngrp_bc_grp_type,
2270 is_alloc_ngrp_bc_grp_type},
2271 {
"hecmwST_node_grp",
"bc_grp_index", set_ngrp_bc_grp_index,
2272 is_alloc_ngrp_bc_grp_index},
2273 {
"hecmwST_node_grp",
"bc_grp_dof", set_ngrp_bc_grp_dof,
2274 is_alloc_ngrp_bc_grp_dof},
2275 {
"hecmwST_node_grp",
"bc_grp_val", set_ngrp_bc_grp_val,
2276 is_alloc_ngrp_bc_grp_val},
2278 {
"hecmwST_elem_grp",
"n_grp", set_egrp_n_grp,
NULL},
2279 {
"hecmwST_elem_grp",
"grp_name", set_egrp_grp_name,
NULL},
2280 {
"hecmwST_elem_grp",
"grp_index", set_egrp_grp_index,
NULL},
2281 {
"hecmwST_elem_grp",
"grp_item", set_egrp_grp_item,
NULL},
2282 {
"hecmwST_elem_grp",
"n_bc", set_egrp_n_bc,
NULL},
2283 {
"hecmwST_elem_grp",
"bc_grp_ID", set_egrp_bc_grp_ID,
2284 is_alloc_egrp_bc_grp_ID},
2285 {
"hecmwST_elem_grp",
"bc_grp_type", set_egrp_bc_grp_type,
2286 is_alloc_egrp_bc_grp_type},
2287 {
"hecmwST_elem_grp",
"bc_grp_index", set_egrp_bc_grp_index,
2288 is_alloc_egrp_bc_grp_index},
2289 {
"hecmwST_elem_grp",
"bc_grp_val", set_egrp_bc_grp_val,
2290 is_alloc_egrp_bc_grp_val},
2292 {
"hecmwST_surf_grp",
"n_grp", set_sgrp_n_grp,
NULL},
2293 {
"hecmwST_surf_grp",
"grp_name", set_sgrp_grp_name,
NULL},
2294 {
"hecmwST_surf_grp",
"grp_index", set_sgrp_grp_index,
NULL},
2295 {
"hecmwST_surf_grp",
"grp_item", set_sgrp_grp_item,
NULL},
2296 {
"hecmwST_surf_grp",
"n_bc", set_sgrp_n_bc,
NULL},
2297 {
"hecmwST_surf_grp",
"bc_grp_ID", set_sgrp_bc_grp_ID,
2298 is_alloc_sgrp_bc_grp_ID},
2299 {
"hecmwST_surf_grp",
"bc_grp_type", set_sgrp_bc_grp_type,
2300 is_alloc_sgrp_bc_grp_type},
2301 {
"hecmwST_surf_grp",
"bc_grp_index", set_sgrp_bc_grp_index,
2302 is_alloc_sgrp_bc_grp_index},
2303 {
"hecmwST_surf_grp",
"bc_grp_val", set_sgrp_bc_grp_val,
2304 is_alloc_sgrp_bc_grp_val},
2306 {
"hecmwST_contact_pair",
"n_pair", set_contact_pair_n_pair,
NULL},
2307 {
"hecmwST_contact_pair",
"name", set_contact_pair_name,
NULL},
2308 {
"hecmwST_contact_pair",
"type", set_contact_pair_type,
NULL},
2309 {
"hecmwST_contact_pair",
"slave_grp_id", set_contact_pair_slave_grp_id,
2311 {
"hecmwST_contact_pair",
"slave_orisgrp_id", set_contact_pair_slave_orisgrp_id,
2313 {
"hecmwST_contact_pair",
"master_grp_id",
2314 set_contact_pair_master_grp_id,
NULL},
2315 {
"hecmwST_refine_origin",
"index", set_refine_origin_index,
NULL},
2316 {
"hecmwST_refine_origin",
"item_index", set_refine_origin_item_index,
2318 {
"hecmwST_refine_origin",
"item_item", set_refine_origin_item_item,
2322 static const int NFUNC =
sizeof(functions) /
sizeof(functions[0]);
2328 for (i = 0; i < NFUNC; i++) {
2329 if (strcmp(functions[i].struct_name, struct_name) == 0 &&
2330 strcmp(functions[i].var_name, var_name) == 0) {
2331 return functions[i].is_allocated_func;
2337 static SetFunc get_set_func(
char *struct_name,
char *var_name) {
2340 for (i = 0; i < NFUNC; i++) {
2341 if (strcmp(functions[i].struct_name, struct_name) == 0 &&
2342 strcmp(functions[i].var_name, var_name) == 0) {
2343 return functions[i].set_func;
2365 int *is_allocated,
int *err,
int len_struct,
2375 "mesh copy(C->Fortran): confirm allocation : 'mesh' has "
2376 "not initialized yet");
2379 if (struct_name ==
NULL) {
2382 "mesh copy(C->Fortran): confirm allocation: 'struct_name' is NULL");
2385 if (var_name ==
NULL) {
2388 "mesh copy(C->Fortran): confirm allocation: 'var_name' is NULL");
2391 if (is_allocated ==
NULL) {
2394 "mesh copy(C->Fortran): confirm allocation: 'is_allocated' is NULL");
2406 func = get_is_allocated_func(sname, vname);
2409 "HECMW_mesh_is_allocated(): IsAllocatedFunc not found");
2425 int *err,
int len_struct,
int len_var) {
2434 "mesh copy(C->Fortran): 'mesh' has not initialized yet");
2437 if (struct_name ==
NULL) {
2441 if (var_name ==
NULL) {
2458 func = get_set_func(sname, vname);
2461 "mesh copy(C->Fortran): SetFunc not found");
HECMW_Fint HECMW_Comm_c2f(HECMW_Comm comm)
#define HECMW_FILENAME_LEN
int HECMW_dist_copy_c2f_init(struct hecmwST_local_mesh *local_mesh)
void hecmw_dist_copy_c2f_isalloc_if(char *struct_name, char *var_name, int *is_allocated, int *err, int len_struct, int len_var)
int(* IsAllocatedFunc)(void)
int HECMW_dist_copy_c2f_finalize(void)
void hecmw_dist_copy_c2f_set_if(char *struct_name, char *var_name, void *dst, int *err, int len_struct, int len_var)
int HECMW_set_error(int errorno, const char *fmt,...)
int HECMW_strcpy_c2f(const char *cstr, char *fstr, int flen)
char * HECMW_strcpy_f2c_r(const char *fstr, int flen, char *buf, int bufsize)
int * amp_type_definition
struct hecmwST_section * section
int * adapt_children_item
double * elem_mat_int_val
int * adapt_children_index
struct hecmwST_amplitude * amp
struct hecmwST_material * material
struct hecmwST_refine_origin * refine_origin
struct hecmwST_node_grp * node_group
double * node_init_val_item
struct hecmwST_contact_pair * contact_pair
struct hecmwST_surf_grp * surf_group
long long * elem_node_index
char gridfile[HECMW_FILENAME_LEN+1]
char header[HECMW_HEADER_LEN+1]
int hecmw_flag_partcontact
struct hecmwST_elem_grp * elem_group
int * node_init_val_index
int * when_i_was_refined_node
int * when_i_was_refined_elem