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;