21 #define FRAC_1_3 (0.33333333333333333)
23 #define FRAC_1_4 (0.25)
33 static void free_link_list(
struct link_list *r) {
36 for (p = r; p; p = q) {
49 i < boundary->elem_node_index[
id + 1]; i++) {
60 weight_list[node_id].
next = p;
73 i < boundary->elem_node_index[
id + 1]; i++) {
84 weight_list[node_id].
next = p;
94 int elem, n_item, size,
n, i;
98 if (weight_list ==
NULL) {
102 for (i = 0; i < boundary->
node->
n; i++) {
103 weight_list[i].
id = -1;
104 weight_list[i].
weight = 0.0;
111 for (i = 0; i < boundary->
surf->
n; i++) {
115 if (s2n_average_tet1(mesh, boundary, i, weight_list))
goto error;
117 if (s2n_average_hex1(mesh, boundary, i, weight_list))
goto error;
128 weight_info->
n = boundary->
node->
n;
139 for (
n = 0, i = 0; i < boundary->
node->
n; i++) {
140 for (p = weight_list[i].
next; p; p = p->
next) {
143 weight_info->
index[i + 1] =
n;
147 n_item = weight_info->
index[weight_info->
n];
149 if (weight_info->
id ==
NULL) {
158 for (
n = 0, i = 0; i < boundary->
node->
n; i++) {
159 for (p = weight_list[i].
next; p; p = p->
next) {
160 weight_info->
id[
n] = p->id;
161 weight_info->
weight[
n] = p->weight;
169 for (i = 0; i < boundary->
node->
n; i++) {
170 free_link_list(weight_list[i].
next);
177 for (i = 0; i < boundary->
node->
n; i++) {
178 free_link_list(weight_list[i].
next);
190 int elem, n_item, size,
n, i;
194 "HECMW_couple_s2n_by_area(): 'mesh' is NULL");
197 if (boundary ==
NULL) {
199 "HECMW_couple_s2n_by_area(): 'boundary' is NULL");
207 weight_info_list->
info = weight_info;
209 if (s2n_average(
mesh, boundary, weight_info))
goto error;
211 return weight_info_list;
#define HECMW_COUPLE_IP_SURF_TO_NODE
#define HECMWCPL_E_NONSUPPORT_ETYPE
#define HECMWCPL_E_INVALID_ARG
struct hecmw_couple_weight_list * HECMW_couple_s2n_average(const struct hecmwST_local_mesh *mesh, const struct hecmw_couple_boundary *boundary)
struct hecmw_couple_weight_list * HECMW_couple_alloc_weight_list(void)
struct hecmw_couple_weight * HECMW_couple_alloc_weight(void)
void HECMW_couple_free_weight(struct hecmw_couple_weight *p)
void HECMW_couple_free_weight_list(struct hecmw_couple_weight_list *r)
struct hecmwST_local_mesh * mesh
int HECMW_set_error(int errorno, const char *fmt,...)
#define HECMW_calloc(nmemb, size)
#define HECMW_malloc(size)
struct hecmw_couple_boundary_item * node
struct hecmw_couple_boundary_item * surf
struct hecmw_couple_weight * info