30 static void free_link_list(
struct link_list *r) {
33 for (p = r; p; p = q) {
41 if (boundary ==
NULL)
return;
68 if (boundary ==
NULL) {
85 boundary->
node->
n = 0;
93 boundary->
elem->
n = 0;
101 boundary->
surf->
n = 0;
116 static int check_group_name(
int n_grp_mesh,
char **grp_name_mesh,
117 const char *grp_name_ctrl) {
120 for (i = 0; i < n_grp_mesh; i++) {
121 if ((strcmp(grp_name_ctrl, grp_name_mesh[i])) == 0)
return i;
132 for (i = 0; i < group->
n_grp; i++) {
149 for (i = 0; i < group->
n_grp; i++) {
166 for (i = 0; i < group->
n_grp; i++) {
184 int node, index, n, i, j;
187 if (group->
n_grp == 0)
return 0;
199 for (i = 0; i < group->
n_grp; i++) {
205 j < mesh->node_group->grp_index[index + 1]; j++) {
215 boundary->
node->
n = n;
216 if (boundary->
node->
n == 0) {
244 int elem, index, n, i, j;
247 if (group->
n_grp == 0)
return 0;
259 for (i = 0; i < group->
n_grp; i++) {
265 j < mesh->elem_group->grp_index[index + 1]; j++) {
275 boundary->
elem->
n = n;
276 if (boundary->
elem->
n == 0) {
303 int elem, node, size, n, i, j;
315 for (n = 0, i = 0; i < boundary->
elem->
n; i++) {
320 if (mask[node - 1] < 0) {
321 mask[node - 1] = n++;
328 if (mask[i] >= 0) n++;
330 boundary->
node->
n = n;
331 if (boundary->
node->
n == 0) {
344 boundary->
node->
item[mask[i]] = i + 1;
355 for (i = 0; i < boundary->
elem->
n; i++) {
368 for (n = 0, i = 0; i < boundary->
elem->
n; i++) {
389 int size, index, elem, surf, is_exist,
n, i, j;
392 if (group->
n_grp == 0)
return 0;
406 for (
n = 0, i = 0; i < group->
n_grp; i++) {
412 j < mesh->surf_group->grp_index[index + 1]; j++) {
440 if (boundary->
surf->
n == 0) {
453 for (p = mask[i].
next; p; p = p->
next) {
461 free_link_list(mask[i].
next);
469 free_link_list(mask[i].
next);
479 int elem, surf, node, node_index, offset, size,
n, i, j;
490 for (
n = 0, i = 0; i < boundary->
surf->
n; i++) {
492 surf = boundary->
surf->
item[2 * i + 1];
497 for (j = 0; j < 3; j++) {
498 offset = hecmw_surf_node_table_tet1[surf - 1][j];
500 if (mask[node - 1] < 0) {
501 mask[node - 1] =
n++;
506 for (j = 0; j < 4; j++) {
507 offset = hecmw_surf_node_table_hex1[surf - 1][j];
509 if (mask[node - 1] < 0) {
510 mask[node - 1] =
n++;
522 if (mask[i] >= 0)
n++;
525 if (boundary->
node->
n == 0) {
538 boundary->
node->
item[mask[i]] = i + 1;
549 for (i = 0; i < boundary->
surf->
n; i++) {
564 for (
n = 0, i = 0; i < boundary->
surf->
n; i++) {
566 surf = boundary->
surf->
item[2 * i + 1];
570 for (j = 0; j < 3; j++) {
571 offset = hecmw_surf_node_table_tet1[surf - 1][j];
577 for (j = 0; j < 4; j++) {
578 offset = hecmw_surf_node_table_hex1[surf - 1][j];
600 const char *boundary_id,
int unit_specifier,
605 if (boundary_id ==
NULL) {
607 "HECMW_couple_set_boundary_info(): 'boundary_id' is NULL");
612 "HECMW_couple_set_boundary_info(): 'mesh' is NULL");
625 "In current version, node group is not supported");
638 "In current version, element group is not supported");
653 if (check_surf_group_name(
mesh, group))
goto error;
654 if (set_boundary_surf_by_surf(
mesh, group, boundary))
goto error;
655 if (set_boundary_node_by_surf(
mesh, boundary))
goto error;