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;
97 if (boundary_id ==
NULL) {
99 "HECMW_couple_set_bounding_box(): 'boundary_id' is NULL");
104 "HECMW_couple_set_bounding_box(): 'mesh' is NULL");
107 if (boundary ==
NULL) {
109 "HECMW_couple_set_bounding_box(): 'boundary' is NULL");
114 if ((bbox = alloc_struct_bbox()) ==
NULL)
return NULL;
119 if (bbox->
coef < 0.0)
goto error;
121 if (boundary->
node->
n == 0)
return bbox;
128 "In current version, node group is not supported");
150 "In current version, element group is not supported");
171 for (i = 0; i < boundary->
surf->
n; i++) {
176 coord_x =
mesh->
node[3 * (node - 1)];
177 coord_y =
mesh->
node[3 * (node - 1) + 1];
178 coord_z =
mesh->
node[3 * (node - 1) + 2];
180 if (coord_x < min_x) min_x = coord_x;
181 if (coord_y < min_y) min_y = coord_y;
182 if (coord_z < min_z) min_z = coord_z;
183 if (coord_x > max_x) max_x = coord_x;
184 if (coord_y > max_y) max_y = coord_y;
185 if (coord_z > max_z) max_z = coord_z;
203 half_coef = (bbox->
coef - 1.0) * 0.5;
208 if (length_x > half_coef) {
215 if (length_y > half_coef) {
222 if (length_z > half_coef) {
struct hecmw_couple_bounding_box * HECMW_couple_set_bounding_box(const char *boundary_id, const struct hecmwST_local_mesh *mesh, const struct hecmw_couple_boundary *boundary)
void HECMW_couple_free_bounding_box(struct hecmw_couple_bounding_box *bbox)
int HECMW_couple_ctrl_get_tolerance(const char *boundary_id, double *tolerance)
int HECMW_couple_ctrl_get_bbcoef(const char *boundary_id, double *bbcoef)
#define HECMW_COUPLE_ELEMENT_GROUP
#define HECMWCPL_E_NONSUPPORT_GEOMTYPE
#define HECMW_COUPLE_NODE_GROUP
#define HECMWCPL_E_INVALID_ARG
#define HECMW_COUPLE_SURFACE_GROUP
#define HECMWCPL_E_INVALID_GEOMTYPE
struct hecmwST_local_mesh * mesh
int HECMW_set_error(int errorno, const char *fmt,...)
#define HECMW_malloc(size)
struct hecmw_couple_boundary_item * node
struct hecmw_couple_boundary_item * surf
struct hecmw_couple_box * just
struct hecmw_couple_box * enlarged
long long * elem_node_index