22 #define INFINITE (1.0E+37)
28 if (bbox ==
NULL)
return;
92 double length_x, length_y, length_z, coord_x, coord_y, coord_z, half_coef;
93 double min_x, min_y, min_z, max_x, max_y, max_z;
96 if (boundary_id ==
NULL) {
98 "HECMW_couple_set_bounding_box(): 'boundary_id' is NULL");
103 "HECMW_couple_set_bounding_box(): 'mesh' is NULL");
106 if (boundary ==
NULL) {
108 "HECMW_couple_set_bounding_box(): 'boundary' is NULL");
113 if ((bbox = alloc_struct_bbox()) ==
NULL)
return NULL;
118 if (bbox->
coef < 0.0)
goto error;
120 if (boundary->
node->
n == 0)
return bbox;
127 "In current version, node group is not supported");
149 "In current version, element group is not supported");
170 for (i = 0; i < boundary->
surf->
n; i++) {
175 coord_x =
mesh->
node[3 * (node - 1)];
176 coord_y =
mesh->
node[3 * (node - 1) + 1];
177 coord_z =
mesh->
node[3 * (node - 1) + 2];
179 if (coord_x < min_x) min_x = coord_x;
180 if (coord_y < min_y) min_y = coord_y;
181 if (coord_z < min_z) min_z = coord_z;
182 if (coord_x > max_x) max_x = coord_x;
183 if (coord_y > max_y) max_y = coord_y;
184 if (coord_z > max_z) max_z = coord_z;
202 half_coef = (bbox->
coef - 1.0) * 0.5;
207 if (length_x > half_coef) {
214 if (length_y > half_coef) {
221 if (length_z > half_coef) {