FrontISTR  5.7.0
Large-scale structural analysis program with finit element method
hecmw_dist_copy_f2c.c
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2019 FrontISTR Commons
3  * This software is released under the MIT License, see LICENSE.txt
4  *****************************************************************************/
5 
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <errno.h>
9 #include "hecmw_struct.h"
10 #include "hecmw_util.h"
11 
12 static struct hecmwST_local_mesh *mesh;
13 
14 /*-----------------------------------------------------------------------------
15  * SetFunc
16  */
17 
18 static int set_hecmw_flag_adapt(void *src) {
19  mesh->hecmw_flag_adapt = *((int *)src);
20  return 0;
21 }
22 
23 static int set_hecmw_flag_initcon(void *src) {
24  mesh->hecmw_flag_initcon = *((int *)src);
25  return 0;
26 }
27 
28 static int set_hecmw_flag_parttype(void *src) {
29  mesh->hecmw_flag_parttype = *((int *)src);
30  return 0;
31 }
32 
33 static int set_hecmw_flag_partdepth(void *src) {
34  mesh->hecmw_flag_partdepth = *((int *)src);
35  return 0;
36 }
37 
38 static int set_hecmw_flag_version(void *src) {
39  mesh->hecmw_flag_version = *((int *)src);
40  return 0;
41 }
42 
43 static int set_hecmw_flag_partcontact(void *src) {
44  mesh->hecmw_flag_partcontact = *((int *)src);
45  return 0;
46 }
47 
48 static int set_gridfile(void *src) {
49  void *dst = mesh->gridfile;
51  return 0;
52 }
53 
54 static int set_hecmw_n_file(void *src) {
55  mesh->hecmw_n_file = *((int *)src);
56  return 0;
57 }
58 
59 static int set_files(void *src) {
60  int i;
61 
62  if (mesh->hecmw_n_file <= 0) return 0;
63 
64  mesh->files = HECMW_calloc(mesh->hecmw_n_file, sizeof(*mesh->files));
65  if (mesh->files == NULL) {
66  HECMW_set_error(errno, "");
67  goto error;
68  }
69  for (i = 0; i < mesh->hecmw_n_file; i++) {
70  char *src_point = (char *)src + HECMW_FILENAME_LEN * i;
71  mesh->files[i] = HECMW_strcpy_f2c(src_point, HECMW_FILENAME_LEN);
72  if (mesh->files[i] == NULL) goto error;
73  }
74  return 0;
75 error:
76  if (mesh->files) {
77  for (i = 0; i < mesh->hecmw_n_file; i++) {
78  HECMW_free(mesh->files[i]);
79  }
80  }
81  HECMW_free(mesh->files);
82  mesh->files = NULL;
83  return -1;
84 }
85 
86 static int set_header(void *src) {
87  void *dst = mesh->header;
89  return 0;
90 }
91 
92 static int set_zero_temp(void *src) {
93  mesh->zero_temp = *((double *)src);
94  return 0;
95 }
96 
97 static int set_n_node(void *src) {
98  mesh->n_node = *((int *)src);
99  return 0;
100 }
101 
102 static int set_n_node_gross(void *src) {
103  mesh->n_node_gross = *((int *)src);
104  return 0;
105 }
106 
107 static int set_nn_middle(void *src) {
108  mesh->nn_middle = *((int *)src);
109  return 0;
110 }
111 
112 static int set_nn_internal(void *src) {
113  mesh->nn_internal = *((int *)src);
114  return 0;
115 }
116 
117 static int set_node_internal_list(void *src) {
118  int size;
119 
120  if (mesh->nn_internal <= 0) return 0;
121  size = sizeof(*mesh->node_internal_list) * mesh->nn_internal;
122  mesh->node_internal_list = HECMW_malloc(size);
123  if (mesh->node_internal_list == NULL) {
124  HECMW_set_error(errno, "");
125  return -1;
126  }
127  memcpy(mesh->node_internal_list, src, size);
128  return 0;
129 }
130 
131 static int set_node_ID(void *src) {
132  int size;
133 
134  if (mesh->n_node_gross <= 0) return 0;
135  size = sizeof(*mesh->node_ID) * 2 * mesh->n_node_gross;
136  mesh->node_ID = HECMW_malloc(size);
137  if (mesh->node_ID == NULL) {
138  HECMW_set_error(errno, "");
139  return -1;
140  }
141  memcpy(mesh->node_ID, src, size);
142  return 0;
143 }
144 
145 static int set_global_node_ID(void *src) {
146  int size;
147 
148  if (mesh->n_node_gross <= 0) return 0;
149  size = sizeof(*mesh->global_node_ID) * mesh->n_node_gross;
150  mesh->global_node_ID = HECMW_malloc(size);
151  if (mesh->global_node_ID == NULL) {
152  HECMW_set_error(errno, "");
153  return -1;
154  }
155  memcpy(mesh->global_node_ID, src, size);
156  return 0;
157 }
158 
159 static int set_node(void *src) {
160  int size;
161 
162  if (mesh->n_node_gross <= 0) return 0;
163  size = sizeof(*mesh->node) * 3 * mesh->n_node_gross;
164  mesh->node = HECMW_malloc(size);
165  if (mesh->node == NULL) {
166  HECMW_set_error(errno, "");
167  return -1;
168  }
169  memcpy(mesh->node, src, size);
170  return 0;
171 }
172 
173 static int set_n_dof(void *src) {
174  mesh->n_dof = *((int *)src);
175  return 0;
176 }
177 
178 static int set_n_dof_grp(void *src) {
179  mesh->n_dof_grp = *((int *)src);
180  return 0;
181 }
182 
183 static int set_n_dof_tot(void *src) {
184  mesh->n_dof_tot = *((int *)src);
185  return 0;
186 }
187 
188 static int set_node_dof_index(void *src) {
189  int size;
190 
191  if (mesh->n_dof_grp <= 0) return 0;
192  size = sizeof(*mesh->node_dof_index) * (mesh->n_dof_grp + 1);
193  mesh->node_dof_index = HECMW_malloc(size);
194  if (mesh->node_dof_index == NULL) {
195  HECMW_set_error(errno, "");
196  return -1;
197  }
198  memcpy(mesh->node_dof_index, src, size);
199  return 0;
200 }
201 
202 static int set_node_dof_item(void *src) {
203  int size;
204 
205  if (mesh->n_dof_grp <= 0) return 0;
206  size = sizeof(*mesh->node_dof_item) * mesh->n_dof_grp;
207  mesh->node_dof_item = HECMW_malloc(size);
208  if (mesh->node_dof_item == NULL) {
209  HECMW_set_error(errno, "");
210  return -1;
211  }
212  memcpy(mesh->node_dof_item, src, size);
213  return 0;
214 }
215 
216 static int set_node_val_index(void *src) {
217  int size;
218 
219  if (mesh->n_node_gross <= 0) return 0;
220  size = sizeof(*mesh->node_val_index) * (mesh->n_node_gross + 1);
221  mesh->node_val_index = HECMW_malloc(size);
222  if (mesh->node_val_index == NULL) {
223  HECMW_set_error(errno, "");
224  return -1;
225  }
226  memcpy(mesh->node_val_index, src, size);
227  return 0;
228 }
229 
230 static int set_node_val_item(void *src) {
231  int size;
232 
233  if (mesh->n_node_gross <= 0) return 0;
234  if (mesh->node_val_index == NULL) return 0;
235  if (mesh->node_val_index[mesh->n_node_gross] <= 0) return 0;
236 
237  size =
238  sizeof(*mesh->node_val_item) * mesh->node_val_index[mesh->n_node_gross];
239  mesh->node_val_item = HECMW_malloc(size);
240  if (mesh->node_val_item == NULL) {
241  HECMW_set_error(errno, "");
242  return -1;
243  }
244  memcpy(mesh->node_val_item, src, size);
245  return 0;
246 }
247 
248 static int set_node_init_val_index(void *src) {
249  int size;
250 
251  if (mesh->n_node_gross <= 0) return 0;
252  size = sizeof(*mesh->node_init_val_index) * (mesh->n_node_gross + 1);
253  mesh->node_init_val_index = HECMW_malloc(size);
254  if (mesh->node_init_val_index == NULL) {
255  HECMW_set_error(errno, "");
256  return -1;
257  }
258  memcpy(mesh->node_init_val_index, src, size);
259  return 0;
260 }
261 
262 static int set_node_init_val_item(void *src) {
263  int size;
264 
265  if (mesh->n_node_gross <= 0) return 0;
266  if (mesh->node_init_val_index == NULL) return 0;
267  if (mesh->node_init_val_index[mesh->n_node_gross] <= 0) return 0;
268 
269  size = sizeof(*mesh->node_init_val_item) *
270  mesh->node_init_val_index[mesh->n_node_gross];
271  mesh->node_init_val_item = HECMW_malloc(size);
272  if (mesh->node_init_val_item == NULL) {
273  HECMW_set_error(errno, "");
274  return -1;
275  }
276  memcpy(mesh->node_init_val_item, src, size);
277  return 0;
278 }
279 
280 static int set_n_elem(void *src) {
281  mesh->n_elem = *((int *)src);
282  return 0;
283 }
284 
285 static int set_n_elem_gross(void *src) {
286  mesh->n_elem_gross = *((int *)src);
287  return 0;
288 }
289 
290 static int set_ne_internal(void *src) {
291  mesh->ne_internal = *((int *)src);
292  return 0;
293 }
294 
295 static int set_elem_internal_list(void *src) {
296  int size;
297 
298  if (mesh->ne_internal <= 0) return 0;
299  size = sizeof(*mesh->elem_internal_list) * mesh->ne_internal;
300  mesh->elem_internal_list = HECMW_malloc(size);
301  if (mesh->elem_internal_list == NULL) {
302  HECMW_set_error(errno, "");
303  return -1;
304  }
305  memcpy(mesh->elem_internal_list, src, size);
306  return 0;
307 }
308 
309 static int set_elem_ID(void *src) {
310  int size;
311 
312  if (mesh->n_elem_gross <= 0) return 0;
313  size = sizeof(*mesh->elem_ID) * 2 * mesh->n_elem_gross;
314  mesh->elem_ID = HECMW_malloc(size);
315  if (mesh->elem_ID == NULL) {
316  HECMW_set_error(errno, "");
317  return -1;
318  }
319  memcpy(mesh->elem_ID, src, size);
320  return 0;
321 }
322 
323 static int set_global_elem_ID(void *src) {
324  int size;
325 
326  if (mesh->n_elem_gross <= 0) return 0;
327  size = sizeof(*mesh->global_elem_ID) * mesh->n_elem_gross;
328  mesh->global_elem_ID = HECMW_malloc(size);
329  if (mesh->global_elem_ID == NULL) {
330  HECMW_set_error(errno, "");
331  return -1;
332  }
333  memcpy(mesh->global_elem_ID, src, size);
334  return 0;
335 }
336 
337 static int set_elem_type(void *src) {
338  int size;
339 
340  if (mesh->n_elem_gross <= 0) return 0;
341  size = sizeof(*mesh->elem_type) * mesh->n_elem_gross;
342  mesh->elem_type = HECMW_malloc(size);
343  if (mesh->elem_type == NULL) {
344  HECMW_set_error(errno, "");
345  return -1;
346  }
347  memcpy(mesh->elem_type, src, size);
348  return 0;
349 }
350 
351 static int set_n_elem_type(void *src) {
352  mesh->n_elem_type = *((int *)src);
353  return 0;
354 }
355 
356 static int set_elem_type_index(void *src) {
357  int size;
358 
359  if (mesh->n_elem_type <= 0) return 0;
360  size = sizeof(*mesh->elem_type_index) * (mesh->n_elem_type + 1);
361  mesh->elem_type_index = HECMW_malloc(size);
362  if (mesh->elem_type_index == NULL) {
363  HECMW_set_error(errno, "");
364  return -1;
365  }
366  memcpy(mesh->elem_type_index, src, size);
367  return 0;
368 }
369 
370 static int set_elem_type_item(void *src) {
371  int size;
372 
373  if (mesh->n_elem_type <= 0) return 0;
374  size = sizeof(*mesh->elem_type_item) * mesh->n_elem_type;
375  mesh->elem_type_item = HECMW_malloc(size);
376  if (mesh->elem_type_item == NULL) {
377  HECMW_set_error(errno, "");
378  return -1;
379  }
380  memcpy(mesh->elem_type_item, src, size);
381  return 0;
382 }
383 
384 static int set_elem_node_index(void *src) {
385  int size;
386 
387  if (mesh->n_elem_gross <= 0) return 0;
388  size = sizeof(*mesh->elem_node_index) * (mesh->n_elem_gross + 1);
389  mesh->elem_node_index = HECMW_malloc(size);
390  if (mesh->elem_node_index == NULL) {
391  HECMW_set_error(errno, "");
392  return -1;
393  }
394  memcpy(mesh->elem_node_index, src, size);
395  return 0;
396 }
397 
398 static int set_elem_node_item(void *src) {
399  int size;
400 
401  if (mesh->n_elem_gross <= 0) return 0;
402  if (mesh->elem_node_index == NULL) return 0;
403  if (mesh->elem_node_index[mesh->n_elem_gross] <= 0) return 0;
404 
405  size =
406  sizeof(*mesh->elem_node_item) * mesh->elem_node_index[mesh->n_elem_gross];
407  mesh->elem_node_item = HECMW_malloc(size);
408  if (mesh->elem_node_item == NULL) {
409  HECMW_set_error(errno, "");
410  return -1;
411  }
412  memcpy(mesh->elem_node_item, src, size);
413  return 0;
414 }
415 
416 static int set_section_ID(void *src) {
417  int size;
418 
419  if (mesh->n_elem_gross <= 0) return 0;
420  size = sizeof(*mesh->section_ID) * mesh->n_elem_gross;
421  mesh->section_ID = HECMW_malloc(size);
422  if (mesh->section_ID == NULL) {
423  HECMW_set_error(errno, "");
424  return -1;
425  }
426  memcpy(mesh->section_ID, src, size);
427  return 0;
428 }
429 
430 static int set_n_elem_mat_ID(void *src) {
431  mesh->n_elem_mat_ID = *((int *)src);
432  return 0;
433 }
434 
435 static int set_elem_mat_ID_index(void *src) {
436  int size;
437 
438  if (mesh->n_elem_gross <= 0) return 0;
439  size = sizeof(*mesh->elem_mat_ID_index) * (mesh->n_elem_gross + 1);
440  mesh->elem_mat_ID_index = HECMW_malloc(size);
441  if (mesh->elem_mat_ID_index == NULL) {
442  HECMW_set_error(errno, "");
443  return -1;
444  }
445  memcpy(mesh->elem_mat_ID_index, src, size);
446  return 0;
447 }
448 
449 static int set_elem_mat_ID_item(void *src) {
450  int size;
451 
452  if (mesh->n_elem_gross <= 0) return 0;
453  if (mesh->elem_mat_ID_index == NULL) return 0;
454  if (mesh->elem_mat_ID_index[mesh->n_elem_gross] <= 0) return 0;
455 
456  size = sizeof(*mesh->elem_mat_ID_item) *
457  mesh->elem_mat_ID_index[mesh->n_elem_gross];
458  mesh->elem_mat_ID_item = HECMW_malloc(size);
459  if (mesh->elem_mat_ID_item == NULL) {
460  HECMW_set_error(errno, "");
461  return -1;
462  }
463  memcpy(mesh->elem_mat_ID_item, src, size);
464  return 0;
465 }
466 
467 static int set_elem_mat_int_index(void *src) {
468  int size;
469 
470  if (mesh->n_elem_gross <= 0) return 0;
471  size = sizeof(*mesh->elem_mat_int_index) * (mesh->n_elem_gross + 1);
472  mesh->elem_mat_int_index = HECMW_malloc(size);
473  if (mesh->elem_mat_int_index == NULL) {
474  HECMW_set_error(errno, "");
475  return -1;
476  }
477  memcpy(mesh->elem_mat_int_index, src, size);
478  return 0;
479 }
480 
481 static int set_elem_mat_int_val(void *src) {
482  int size;
483 
484  if (mesh->n_elem_gross <= 0) return 0;
485  if (mesh->elem_mat_int_index == NULL) return 0;
486  if (mesh->elem_mat_int_index[mesh->n_elem_gross] <= 0) return 0;
487 
488  size = sizeof(*mesh->elem_mat_int_val) *
489  mesh->elem_mat_int_index[mesh->n_elem_gross];
490  mesh->elem_mat_int_val = HECMW_malloc(size);
491  if (mesh->elem_mat_int_val == NULL) {
492  HECMW_set_error(errno, "");
493  return -1;
494  }
495  memcpy(mesh->elem_mat_int_val, src, size);
496  return 0;
497 }
498 
499 static int set_elem_val_index(void *src) {
500  int size;
501 
502  if (mesh->n_elem_gross <= 0) return 0;
503  size = sizeof(*mesh->elem_val_index) * (mesh->n_elem_gross + 1);
504  mesh->elem_val_index = HECMW_malloc(size);
505  if (mesh->elem_val_index == NULL) {
506  HECMW_set_error(errno, "");
507  return -1;
508  }
509  memcpy(mesh->elem_val_index, src, size);
510  return 0;
511 }
512 
513 static int set_elem_val_item(void *src) {
514  int size;
515 
516  if (mesh->n_elem_gross <= 0) return 0;
517  if (mesh->elem_val_index == NULL) return 0;
518  if (mesh->elem_val_index[mesh->n_elem_gross] <= 0) return 0;
519 
520  size =
521  sizeof(*mesh->elem_val_item) * mesh->elem_val_index[mesh->n_elem_gross];
522  mesh->elem_val_item = HECMW_malloc(size);
523  if (mesh->elem_val_item == NULL) {
524  HECMW_set_error(errno, "");
525  return -1;
526  }
527  memcpy(mesh->elem_val_item, src, size);
528  return 0;
529 }
530 
531 static int set_zero(void *src) {
532  mesh->zero = *((int *)src);
533  return 0;
534 }
535 
536 static int set_HECMW_COMM(void *src) {
537  mesh->HECMW_COMM = HECMW_Comm_f2c(*((HECMW_Fint *)src));
538  return 0;
539 }
540 
541 static int set_PETOT(void *src) {
542  mesh->PETOT = *((int *)src);
543  return 0;
544 }
545 
546 static int set_PEsmpTOT(void *src) {
547  mesh->PEsmpTOT = *((int *)src);
548  return 0;
549 }
550 
551 static int set_my_rank(void *src) {
552  mesh->my_rank = *((int *)src);
553  return 0;
554 }
555 
556 static int set_errnof(void *src) {
557  mesh->errnof = *((int *)src);
558  return 0;
559 }
560 
561 static int set_n_subdomain(void *src) {
562  mesh->n_subdomain = *((int *)src);
563  return 0;
564 }
565 
566 static int set_n_neighbor_pe(void *src) {
567  mesh->n_neighbor_pe = *((int *)src);
568  return 0;
569 }
570 
571 static int set_neighbor_pe(void *src) {
572  int size;
573 
574  if (mesh->n_neighbor_pe <= 0) return 0;
575  size = sizeof(*mesh->neighbor_pe) * mesh->n_neighbor_pe;
576  mesh->neighbor_pe = HECMW_malloc(size);
577  if (mesh->neighbor_pe == NULL) {
578  HECMW_set_error(errno, "");
579  return -1;
580  }
581  memcpy(mesh->neighbor_pe, src, size);
582  return 0;
583 }
584 
585 static int set_import_index(void *src) {
586  int size;
587 
588  if (mesh->n_neighbor_pe <= 0) return 0;
589  size = sizeof(*mesh->import_index) * (mesh->n_neighbor_pe + 1);
590  mesh->import_index = HECMW_malloc(size);
591  if (mesh->import_index == NULL) {
592  HECMW_set_error(errno, "");
593  return -1;
594  }
595  memcpy(mesh->import_index, src, size);
596  return 0;
597 }
598 
599 static int set_import_item(void *src) {
600  int size;
601 
602  if (mesh->n_neighbor_pe <= 0) return 0;
603  if (mesh->import_index == NULL) return 0;
604  if (mesh->import_index[mesh->n_neighbor_pe] <= 0) return 0;
605 
606  size = sizeof(*mesh->import_item) * mesh->import_index[mesh->n_neighbor_pe];
607  mesh->import_item = HECMW_malloc(size);
608  if (mesh->import_item == NULL) {
609  HECMW_set_error(errno, "");
610  return -1;
611  }
612  memcpy(mesh->import_item, src, size);
613  return 0;
614 }
615 
616 static int set_export_index(void *src) {
617  int size;
618 
619  if (mesh->n_neighbor_pe <= 0) return 0;
620  size = sizeof(*mesh->export_index) * (mesh->n_neighbor_pe + 1);
621  mesh->export_index = HECMW_malloc(size);
622  if (mesh->export_index == NULL) {
623  HECMW_set_error(errno, "");
624  return -1;
625  }
626  memcpy(mesh->export_index, src, size);
627  return 0;
628 }
629 
630 static int set_export_item(void *src) {
631  int size;
632 
633  if (mesh->n_neighbor_pe <= 0) return 0;
634  if (mesh->export_index == NULL) return 0;
635  if (mesh->export_index[mesh->n_neighbor_pe] <= 0) return 0;
636 
637  size = sizeof(*mesh->export_item) * mesh->export_index[mesh->n_neighbor_pe];
638  mesh->export_item = HECMW_malloc(size);
639  if (mesh->export_item == NULL) {
640  HECMW_set_error(errno, "");
641  return -1;
642  }
643  memcpy(mesh->export_item, src, size);
644  return 0;
645 }
646 
647 static int set_shared_index(void *src) {
648  int size;
649 
650  if (mesh->n_neighbor_pe <= 0) return 0;
651  size = sizeof(*mesh->shared_index) * (mesh->n_neighbor_pe + 1);
652  mesh->shared_index = HECMW_malloc(size);
653  if (mesh->shared_index == NULL) {
654  HECMW_set_error(errno, "");
655  return -1;
656  }
657  memcpy(mesh->shared_index, src, size);
658  return 0;
659 }
660 
661 static int set_shared_item(void *src) {
662  int size;
663 
664  if (mesh->n_neighbor_pe <= 0) return 0;
665  if (mesh->shared_index == NULL) return 0;
666  if (mesh->shared_index[mesh->n_neighbor_pe] <= 0) return 0;
667 
668  size = sizeof(*mesh->shared_item) * mesh->shared_index[mesh->n_neighbor_pe];
669  mesh->shared_item = HECMW_malloc(size);
670  memcpy(mesh->shared_item, src, size);
671  return 0;
672 }
673 
674 static int set_coarse_grid_level(void *src) {
675  mesh->coarse_grid_level = *((int *)src);
676  return 0;
677 }
678 
679 static int set_n_adapt(void *src) {
680  mesh->n_adapt = *((int *)src);
681  return 0;
682 }
683 
684 static int set_when_i_was_refined_node(void *src) {
685  int size;
686 
687  if (mesh->n_node_gross <= 0) return 0;
688  size = sizeof(*mesh->when_i_was_refined_node) * mesh->n_node_gross;
690  if (mesh->when_i_was_refined_node == NULL) {
691  HECMW_set_error(errno, "");
692  return -1;
693  }
694  memcpy(mesh->when_i_was_refined_node, src, size);
695  return 0;
696 }
697 
698 static int set_when_i_was_refined_elem(void *src) {
699  int size;
700 
701  if (mesh->n_elem_gross <= 0) return 0;
702  size = sizeof(*mesh->when_i_was_refined_elem) * mesh->n_elem_gross;
704  if (mesh->when_i_was_refined_elem == NULL) {
705  HECMW_set_error(errno, "");
706  return -1;
707  }
708  memcpy(mesh->when_i_was_refined_elem, src, size);
709  return 0;
710 }
711 
712 static int set_adapt_parent_type(void *src) {
713  int size;
714 
715  if (mesh->n_elem_gross <= 0) return 0;
716  size = sizeof(*mesh->adapt_parent_type) * mesh->n_elem_gross;
717  mesh->adapt_parent_type = HECMW_malloc(size);
718  if (mesh->adapt_parent_type == NULL) {
719  HECMW_set_error(errno, "");
720  return -1;
721  }
722  memcpy(mesh->adapt_parent_type, src, size);
723  return 0;
724 }
725 
726 static int set_adapt_type(void *src) {
727  int size;
728 
729  if (mesh->n_elem_gross <= 0) return 0;
730  size = sizeof(*mesh->adapt_type) * mesh->n_elem_gross;
731  mesh->adapt_type = HECMW_malloc(size);
732  if (mesh->adapt_type == NULL) {
733  HECMW_set_error(errno, "");
734  return -1;
735  }
736  memcpy(mesh->adapt_type, src, size);
737  return 0;
738 }
739 
740 static int set_adapt_level(void *src) {
741  int size;
742 
743  if (mesh->n_elem_gross <= 0) return 0;
744  size = sizeof(*mesh->adapt_level) * mesh->n_elem_gross;
745  mesh->adapt_level = HECMW_malloc(size);
746  if (mesh->adapt_level == NULL) {
747  HECMW_set_error(errno, "");
748  return -1;
749  }
750  memcpy(mesh->adapt_level, src, size);
751  return 0;
752 }
753 
754 static int set_adapt_parent(void *src) {
755  int size;
756 
757  if (mesh->n_elem_gross <= 0) return 0;
758  size = sizeof(*mesh->adapt_parent) * 2 * mesh->n_elem_gross;
759  mesh->adapt_parent = HECMW_malloc(size);
760  if (mesh->adapt_parent == NULL) {
761  HECMW_set_error(errno, "");
762  return -1;
763  }
764  memcpy(mesh->adapt_parent, src, size);
765  return 0;
766 }
767 
768 static int set_adapt_children_index(void *src) {
769  int size;
770 
771  if (mesh->n_elem_gross <= 0) return 0;
772  size = sizeof(*mesh->adapt_children_index) * (mesh->n_elem_gross + 1);
773  mesh->adapt_children_index = HECMW_malloc(size);
774  if (mesh->adapt_children_index == NULL) {
775  HECMW_set_error(errno, "");
776  return -1;
777  }
778  memcpy(mesh->adapt_children_index, src, size);
779  return 0;
780 }
781 
782 static int set_adapt_children_item(void *src) {
783  int size;
784 
785  if (mesh->n_elem_gross <= 0) return 0;
786  if (mesh->adapt_children_index == NULL) return 0;
787  if (mesh->adapt_children_index[mesh->n_elem_gross] <= 0) return 0;
788 
789  size = sizeof(*mesh->adapt_children_item) * 2 *
790  mesh->adapt_children_index[mesh->n_elem_gross];
791  mesh->adapt_children_item = HECMW_malloc(size);
792  if (mesh->adapt_children_item == NULL) {
793  HECMW_set_error(errno, "");
794  return -1;
795  }
796  memcpy(mesh->adapt_children_item, src, size);
797  return 0;
798 }
799 
800 static int set_n_refine(void *src) {
801  mesh->n_refine = *((int *)src);
802  return 0;
803 }
804 
805 static int set_node_old2new(void *src) {
806  int size;
807 
808  if (mesh->n_node_gross <= 0) return 0;
809  size = sizeof(*mesh->node_old2new) * mesh->n_node_gross;
810  mesh->node_old2new = HECMW_malloc(size);
811  if (mesh->node_old2new == NULL) {
812  HECMW_set_error(errno, "");
813  return -1;
814  }
815  memcpy(mesh->node_old2new, src, size);
816  return 0;
817 }
818 
819 static int set_node_new2old(void *src) {
820  int size;
821 
822  if (mesh->n_node_gross <= 0) return 0;
823  size = sizeof(*mesh->node_new2old) * mesh->n_node_gross;
824  mesh->node_new2old = HECMW_malloc(size);
825  if (mesh->node_new2old == NULL) {
826  HECMW_set_error(errno, "");
827  return -1;
828  }
829  memcpy(mesh->node_new2old, src, size);
830  return 0;
831 }
832 
833 static int set_elem_old2new(void *src) {
834  int size;
835 
836  if (mesh->n_elem_gross <= 0) return 0;
837  size = sizeof(*mesh->elem_old2new) * mesh->n_elem_gross;
838  mesh->elem_old2new = HECMW_malloc(size);
839  if (mesh->elem_old2new == NULL) {
840  HECMW_set_error(errno, "");
841  return -1;
842  }
843  memcpy(mesh->elem_old2new, src, size);
844  return 0;
845 }
846 
847 static int set_elem_new2old(void *src) {
848  int size;
849 
850  if (mesh->n_elem_gross <= 0) return 0;
851  size = sizeof(*mesh->elem_new2old) * mesh->n_elem_gross;
852  mesh->elem_new2old = HECMW_malloc(size);
853  if (mesh->elem_new2old == NULL) {
854  HECMW_set_error(errno, "");
855  return -1;
856  }
857  memcpy(mesh->elem_new2old, src, size);
858  return 0;
859 }
860 
861 static int set_n_node_refine_hist(void *src) {
862  int size;
863 
864  if (mesh->n_elem_gross <= 0) return 0;
865  size = sizeof(*mesh->n_node_refine_hist) * mesh->n_refine;
866  mesh->n_node_refine_hist = HECMW_malloc(size);
867  if (mesh->n_node_refine_hist == NULL) {
868  HECMW_set_error(errno, "");
869  return -1;
870  }
871  memcpy(mesh->n_node_refine_hist, src, size);
872  return 0;
873 }
874 
875 static int set_n_sect(void *src) {
876  mesh->section->n_sect = *((int *)src);
877  return 0;
878 }
879 
880 static int set_sect_type(void *src) {
881  int size;
882 
883  if (mesh->section->n_sect <= 0) return 0;
884  size = sizeof(*mesh->section->sect_type) * mesh->section->n_sect;
885  mesh->section->sect_type = HECMW_malloc(size);
886  if (mesh->section->sect_type == NULL) {
887  HECMW_set_error(errno, "");
888  return -1;
889  }
890  memcpy(mesh->section->sect_type, src, size);
891  return 0;
892 }
893 
894 static int set_sect_opt(void *src) {
895  int size;
896 
897  if (mesh->section->n_sect <= 0) return 0;
898  size = sizeof(*mesh->section->sect_opt) * mesh->section->n_sect;
899  mesh->section->sect_opt = HECMW_malloc(size);
900  if (mesh->section->sect_opt == NULL) {
901  HECMW_set_error(errno, "");
902  return -1;
903  }
904  memcpy(mesh->section->sect_opt, src, size);
905  return 0;
906 }
907 
908 static int set_sect_mat_ID_index(void *src) {
909  int size;
910 
911  if (mesh->section->n_sect <= 0) return 0;
912  size =
913  sizeof(*mesh->section->sect_mat_ID_index) * (mesh->section->n_sect + 1);
914  mesh->section->sect_mat_ID_index = HECMW_malloc(size);
915  if (mesh->section->sect_mat_ID_index == NULL) {
916  HECMW_set_error(errno, "");
917  return -1;
918  }
919  memcpy(mesh->section->sect_mat_ID_index, src, size);
920  return 0;
921 }
922 
923 static int set_sect_mat_ID_item(void *src) {
924  int size;
925 
926  if (mesh->section->n_sect <= 0) return 0;
927  if (mesh->section->sect_mat_ID_index == NULL) return 0;
928  if (mesh->section->sect_mat_ID_index[mesh->section->n_sect] <= 0) return 0;
929 
930  size = sizeof(*mesh->section->sect_mat_ID_item) *
931  mesh->section->sect_mat_ID_index[mesh->section->n_sect];
932  mesh->section->sect_mat_ID_item = HECMW_malloc(size);
933  if (mesh->section->sect_mat_ID_item == NULL) {
934  HECMW_set_error(errno, "");
935  return -1;
936  }
937  memcpy(mesh->section->sect_mat_ID_item, src, size);
938  return 0;
939 }
940 
941 static int set_sect_I_index(void *src) {
942  int size;
943 
944  if (mesh->section->n_sect <= 0) return 0;
945  size = sizeof(*mesh->section->sect_I_index) * (mesh->section->n_sect + 1);
946  mesh->section->sect_I_index = HECMW_malloc(size);
947  if (mesh->section->sect_I_index == NULL) {
948  HECMW_set_error(errno, "");
949  return -1;
950  }
951  memcpy(mesh->section->sect_I_index, src, size);
952  return 0;
953 }
954 
955 static int set_sect_I_item(void *src) {
956  int size;
957 
958  if (mesh->section->n_sect <= 0) return 0;
959  if (mesh->section->sect_I_index == NULL) return 0;
960  if (mesh->section->sect_I_index[mesh->section->n_sect] <= 0) return 0;
961 
962  size = sizeof(*mesh->section->sect_I_item) *
963  mesh->section->sect_I_index[mesh->section->n_sect];
964  mesh->section->sect_I_item = HECMW_malloc(size);
965  if (mesh->section->sect_I_item == NULL) {
966  HECMW_set_error(errno, "");
967  return -1;
968  }
969  memcpy(mesh->section->sect_I_item, src, size);
970  return 0;
971 }
972 
973 static int set_sect_R_index(void *src) {
974  int size;
975 
976  if (mesh->section->n_sect <= 0) return 0;
977  size = sizeof(*mesh->section->sect_R_index) * (mesh->section->n_sect + 1);
978  mesh->section->sect_R_index = HECMW_malloc(size);
979  if (mesh->section->sect_R_index == NULL) {
980  HECMW_set_error(errno, "");
981  return -1;
982  }
983  memcpy(mesh->section->sect_R_index, src, size);
984  return 0;
985 }
986 
987 static int set_sect_R_item(void *src) {
988  int size;
989 
990  if (mesh->section->n_sect <= 0) return 0;
991  if (mesh->section->sect_R_index == NULL) return 0;
992  if (mesh->section->sect_R_index[mesh->section->n_sect] <= 0) return 0;
993 
994  size = sizeof(*mesh->section->sect_R_item) *
995  mesh->section->sect_R_index[mesh->section->n_sect];
996  mesh->section->sect_R_item = HECMW_malloc(size);
997  if (mesh->section->sect_R_item == NULL) {
998  HECMW_set_error(errno, "");
999  return -1;
1000  }
1001  memcpy(mesh->section->sect_R_item, src, size);
1002  return 0;
1003 }
1004 
1005 static int set_n_mat(void *src) {
1006  mesh->material->n_mat = *((int *)src);
1007  return 0;
1008 }
1009 
1010 static int set_n_mat_item(void *src) {
1011  mesh->material->n_mat_item = *((int *)src);
1012  return 0;
1013 }
1014 
1015 static int set_n_mat_subitem(void *src) {
1016  mesh->material->n_mat_subitem = *((int *)src);
1017  return 0;
1018 }
1019 
1020 static int set_n_mat_table(void *src) {
1021  mesh->material->n_mat_table = *((int *)src);
1022  return 0;
1023 }
1024 
1025 static int set_mat_name(void *src) {
1026  int i;
1027  struct hecmwST_material *mat = mesh->material;
1028 
1029  if (mat->n_mat <= 0) return 0;
1030 
1031  mat->mat_name = HECMW_calloc(mat->n_mat, sizeof(*mat->mat_name));
1032  if (mat->mat_name == NULL) {
1033  HECMW_set_error(errno, "");
1034  goto error;
1035  }
1036  for (i = 0; i < mat->n_mat; i++) {
1037  char *src_point = (char *)src + HECMW_NAME_LEN * i;
1038  mat->mat_name[i] = HECMW_strcpy_f2c(src_point, HECMW_NAME_LEN);
1039  if (mat->mat_name[i] == NULL) goto error;
1040  }
1041  return 0;
1042 error:
1043  if (mat->mat_name) {
1044  for (i = 0; i < mat->n_mat; i++) {
1045  HECMW_free(mat->mat_name[i]);
1046  }
1047  }
1048  HECMW_free(mat->mat_name);
1049  mat->mat_name = NULL;
1050  return -1;
1051 }
1052 
1053 static int set_mat_item_index(void *src) {
1054  int size;
1055 
1056  if (mesh->material->n_mat <= 0) return 0;
1057  size = sizeof(*mesh->material->mat_item_index) * (mesh->material->n_mat + 1);
1058  mesh->material->mat_item_index = HECMW_malloc(size);
1059  if (mesh->material->mat_item_index == NULL) {
1060  HECMW_set_error(errno, "");
1061  return -1;
1062  }
1063  memcpy(mesh->material->mat_item_index, src, size);
1064  return 0;
1065 }
1066 
1067 static int set_mat_subitem_index(void *src) {
1068  int size;
1069 
1070  if (mesh->material->n_mat_item <= 0) return 0;
1071  size = sizeof(*mesh->material->mat_subitem_index) *
1072  (mesh->material->n_mat_item + 1);
1073  mesh->material->mat_subitem_index = HECMW_malloc(size);
1074  if (mesh->material->mat_subitem_index == NULL) {
1075  HECMW_set_error(errno, "");
1076  return -1;
1077  }
1078  memcpy(mesh->material->mat_subitem_index, src, size);
1079  return 0;
1080 }
1081 
1082 static int set_mat_table_index(void *src) {
1083  int size;
1084 
1085  if (mesh->material->n_mat_subitem <= 0) return 0;
1086  size = sizeof(*mesh->material->mat_table_index) *
1087  (mesh->material->n_mat_subitem + 1);
1088  mesh->material->mat_table_index = HECMW_malloc(size);
1089  if (mesh->material->mat_table_index == NULL) {
1090  HECMW_set_error(errno, "");
1091  return -1;
1092  }
1093  memcpy(mesh->material->mat_table_index, src, size);
1094  return 0;
1095 }
1096 
1097 static int set_mat_val(void *src) {
1098  int size;
1099 
1100  if (mesh->material->n_mat_table <= 0) return 0;
1101  size = sizeof(*mesh->material->mat_val) * mesh->material->n_mat_table;
1102  mesh->material->mat_val = HECMW_malloc(size);
1103  if (mesh->material->mat_val == NULL) {
1104  HECMW_set_error(errno, "");
1105  return -1;
1106  }
1107  memcpy(mesh->material->mat_val, src, size);
1108  return 0;
1109 }
1110 
1111 static int set_mat_temp(void *src) {
1112  int size;
1113 
1114  if (mesh->material->n_mat_table <= 0) return 0;
1115  size = sizeof(*mesh->material->mat_temp) * mesh->material->n_mat_table;
1116  mesh->material->mat_temp = HECMW_malloc(size);
1117  if (mesh->material->mat_temp == NULL) {
1118  HECMW_set_error(errno, "");
1119  return -1;
1120  }
1121  memcpy(mesh->material->mat_temp, src, size);
1122  return 0;
1123 }
1124 
1125 static int set_n_mpc(void *src) {
1126  mesh->mpc->n_mpc = *((int *)src);
1127  return 0;
1128 }
1129 
1130 static int set_mpc_index(void *src) {
1131  int size;
1132 
1133  if (mesh->mpc->n_mpc <= 0) return 0;
1134  size = sizeof(*mesh->mpc->mpc_index) * (mesh->mpc->n_mpc + 1);
1135  mesh->mpc->mpc_index = HECMW_malloc(size);
1136  if (mesh->mpc->mpc_index == NULL) {
1137  HECMW_set_error(errno, "");
1138  return -1;
1139  }
1140  memcpy(mesh->mpc->mpc_index, src, size);
1141  return 0;
1142 }
1143 
1144 static int set_mpc_item(void *src) {
1145  int size;
1146 
1147  if (mesh->mpc->n_mpc <= 0) return 0;
1148  if (mesh->mpc->mpc_index == NULL) return 0;
1149  if (mesh->mpc->mpc_index[mesh->mpc->n_mpc] <= 0) return 0;
1150 
1151  size = sizeof(*mesh->mpc->mpc_item) * mesh->mpc->mpc_index[mesh->mpc->n_mpc];
1152  mesh->mpc->mpc_item = HECMW_malloc(size);
1153  if (mesh->mpc->mpc_item == NULL) {
1154  HECMW_set_error(errno, "");
1155  return -1;
1156  }
1157  memcpy(mesh->mpc->mpc_item, src, size);
1158  return 0;
1159 }
1160 
1161 static int set_mpc_dof(void *src) {
1162  int size;
1163 
1164  if (mesh->mpc->n_mpc <= 0) return 0;
1165  if (mesh->mpc->mpc_index == NULL) return 0;
1166  if (mesh->mpc->mpc_index[mesh->mpc->n_mpc] <= 0) return 0;
1167 
1168  size = sizeof(*mesh->mpc->mpc_dof) * mesh->mpc->mpc_index[mesh->mpc->n_mpc];
1169  mesh->mpc->mpc_dof = HECMW_malloc(size);
1170  if (mesh->mpc->mpc_dof == NULL) {
1171  HECMW_set_error(errno, "");
1172  return -1;
1173  }
1174  memcpy(mesh->mpc->mpc_dof, src, size);
1175  return 0;
1176 }
1177 
1178 static int set_mpc_val(void *src) {
1179  int size;
1180 
1181  if (mesh->mpc->n_mpc <= 0) return 0;
1182  if (mesh->mpc->mpc_index == NULL) return 0;
1183  if (mesh->mpc->mpc_index[mesh->mpc->n_mpc] <= 0) return 0;
1184 
1185  size = sizeof(*mesh->mpc->mpc_val) * mesh->mpc->mpc_index[mesh->mpc->n_mpc];
1186  mesh->mpc->mpc_val = HECMW_malloc(size);
1187  if (mesh->mpc->mpc_val == NULL) {
1188  HECMW_set_error(errno, "");
1189  return -1;
1190  }
1191  memcpy(mesh->mpc->mpc_val, src, size);
1192  return 0;
1193 }
1194 
1195 static int set_mpc_const(void *src) {
1196  int size;
1197 
1198  if (mesh->mpc->n_mpc <= 0) return 0;
1199 
1200  size = sizeof(*mesh->mpc->mpc_const) * mesh->mpc->n_mpc;
1201  mesh->mpc->mpc_const = HECMW_malloc(size);
1202  if (mesh->mpc->mpc_const == NULL) {
1203  HECMW_set_error(errno, "");
1204  return -1;
1205  }
1206  memcpy(mesh->mpc->mpc_const, src, size);
1207  return 0;
1208 }
1209 
1210 static int set_n_amp(void *src) {
1211  mesh->amp->n_amp = *((int *)src);
1212  return 0;
1213 }
1214 
1215 static int set_amp_name(void *src) {
1216  int i;
1217  struct hecmwST_amplitude *amp = mesh->amp;
1218 
1219  if (amp->n_amp <= 0) return 0;
1220 
1221  amp->amp_name = HECMW_calloc(amp->n_amp, sizeof(*amp->amp_name));
1222  if (amp->amp_name == NULL) {
1223  HECMW_set_error(errno, "");
1224  goto error;
1225  }
1226  for (i = 0; i < amp->n_amp; i++) {
1227  char *src_point = (char *)src + HECMW_NAME_LEN * i;
1228  amp->amp_name[i] = HECMW_strcpy_f2c(src_point, HECMW_NAME_LEN);
1229  if (amp->amp_name[i] == NULL) goto error;
1230  }
1231  return 0;
1232 error:
1233  if (amp->amp_name) {
1234  for (i = 0; i < amp->n_amp; i++) {
1235  HECMW_free(amp->amp_name[i]);
1236  }
1237  }
1238  HECMW_free(amp->amp_name);
1239  amp->amp_name = NULL;
1240  return -1;
1241 }
1242 
1243 static int set_amp_type_definition(void *src) {
1244  int size;
1245 
1246  if (mesh->amp->n_amp <= 0) return 0;
1247  size = sizeof(*mesh->amp->amp_type_definition) * mesh->amp->n_amp;
1248  mesh->amp->amp_type_definition = HECMW_malloc(size);
1249  if (mesh->amp->amp_type_definition == NULL) {
1250  HECMW_set_error(errno, "");
1251  return -1;
1252  }
1253  memcpy(mesh->amp->amp_type_definition, src, size);
1254  return 0;
1255 }
1256 
1257 static int set_amp_type_time(void *src) {
1258  int size;
1259 
1260  if (mesh->amp->n_amp <= 0) return 0;
1261  size = sizeof(*mesh->amp->amp_type_time) * mesh->amp->n_amp;
1262  mesh->amp->amp_type_time = HECMW_malloc(size);
1263  if (mesh->amp->amp_type_time == NULL) {
1264  HECMW_set_error(errno, "");
1265  return -1;
1266  }
1267  memcpy(mesh->amp->amp_type_time, src, size);
1268  return 0;
1269 }
1270 
1271 static int set_amp_type_value(void *src) {
1272  int size;
1273 
1274  if (mesh->amp->n_amp <= 0) return 0;
1275  size = sizeof(*mesh->amp->amp_type_value) * mesh->amp->n_amp;
1276  mesh->amp->amp_type_value = HECMW_malloc(size);
1277  if (mesh->amp->amp_type_value == NULL) {
1278  HECMW_set_error(errno, "");
1279  return -1;
1280  }
1281  memcpy(mesh->amp->amp_type_value, src, size);
1282  return 0;
1283 }
1284 
1285 static int set_amp_index(void *src) {
1286  int size;
1287 
1288  if (mesh->amp->n_amp <= 0) return 0;
1289  size = sizeof(*mesh->amp->amp_index) * (mesh->amp->n_amp + 1);
1290  mesh->amp->amp_index = HECMW_malloc(size);
1291  if (mesh->amp->amp_index == NULL) {
1292  HECMW_set_error(errno, "");
1293  return -1;
1294  }
1295  memcpy(mesh->amp->amp_index, src, size);
1296  return 0;
1297 }
1298 
1299 static int set_amp_val(void *src) {
1300  int size;
1301 
1302  if (mesh->amp->n_amp <= 0) return 0;
1303  if (mesh->amp->amp_index == NULL) return 0;
1304  if (mesh->amp->amp_index[mesh->amp->n_amp] <= 0) return 0;
1305 
1306  size = sizeof(*mesh->amp->amp_val) * mesh->amp->amp_index[mesh->amp->n_amp];
1307  mesh->amp->amp_val = HECMW_malloc(size);
1308  if (mesh->amp->amp_val == NULL) {
1309  HECMW_set_error(errno, "");
1310  return -1;
1311  }
1312  memcpy(mesh->amp->amp_val, src, size);
1313  return 0;
1314 }
1315 
1316 static int set_amp_table(void *src) {
1317  int size;
1318 
1319  if (mesh->amp->n_amp <= 0) return 0;
1320  if (mesh->amp->amp_index == NULL) return 0;
1321  if (mesh->amp->amp_index[mesh->amp->n_amp] <= 0) return 0;
1322 
1323  size = sizeof(*mesh->amp->amp_table) * mesh->amp->amp_index[mesh->amp->n_amp];
1324  mesh->amp->amp_table = HECMW_malloc(size);
1325  if (mesh->amp->amp_table == NULL) {
1326  HECMW_set_error(errno, "");
1327  return -1;
1328  }
1329  memcpy(mesh->amp->amp_table, src, size);
1330  return 0;
1331 }
1332 
1333 static int set_ngrp_n_grp(void *src) {
1334  mesh->node_group->n_grp = *((int *)src);
1335  return 0;
1336 }
1337 
1338 static int set_ngrp_n_bc(void *src) {
1339  mesh->node_group->n_bc = *((int *)src);
1340  return 0;
1341 }
1342 
1343 static int set_ngrp_grp_name(void *src) {
1344  int i;
1345  struct hecmwST_node_grp *grp = mesh->node_group;
1346 
1347  if (grp->n_grp <= 0) return 0;
1348 
1349  grp->grp_name = HECMW_calloc(grp->n_grp, sizeof(*grp->grp_name));
1350  if (grp->grp_name == NULL) {
1351  HECMW_set_error(errno, "");
1352  goto error;
1353  }
1354  for (i = 0; i < grp->n_grp; i++) {
1355  char *src_point = (char *)src + HECMW_NAME_LEN * i;
1356  grp->grp_name[i] = HECMW_strcpy_f2c(src_point, HECMW_NAME_LEN);
1357  if (grp->grp_name[i] == NULL) goto error;
1358  }
1359  return 0;
1360 error:
1361  if (grp->grp_name) {
1362  for (i = 0; i < grp->n_grp; i++) {
1363  HECMW_free(grp->grp_name[i]);
1364  }
1365  }
1366  HECMW_free(grp->grp_name);
1367  grp->grp_name = NULL;
1368  return -1;
1369 }
1370 
1371 static int set_ngrp_grp_index(void *src) {
1372  int size;
1373 
1374  if (mesh->node_group->n_grp <= 0) return 0;
1375  size = sizeof(*mesh->node_group->grp_index) * (mesh->node_group->n_grp + 1);
1376  mesh->node_group->grp_index = HECMW_malloc(size);
1377  if (mesh->node_group->grp_index == NULL) {
1378  HECMW_set_error(errno, "");
1379  return -1;
1380  }
1381  memcpy(mesh->node_group->grp_index, src, size);
1382  return 0;
1383 }
1384 
1385 static int set_ngrp_grp_item(void *src) {
1386  int size;
1387 
1388  if (mesh->node_group->n_grp <= 0) return 0;
1389  if (mesh->node_group->grp_index == NULL) return 0;
1390  if (mesh->node_group->grp_index[mesh->node_group->n_grp] <= 0) return 0;
1391 
1392  size = sizeof(*mesh->node_group->grp_item) *
1393  mesh->node_group->grp_index[mesh->node_group->n_grp];
1394  mesh->node_group->grp_item = HECMW_malloc(size);
1395  if (mesh->node_group->grp_item == NULL) {
1396  HECMW_set_error(errno, "");
1397  return -1;
1398  }
1399  memcpy(mesh->node_group->grp_item, src, size);
1400  return 0;
1401 }
1402 
1403 static int set_ngrp_bc_grp_ID(void *src) {
1404  int size;
1405 
1406  if (mesh->node_group->n_bc <= 0) return 0;
1407  size = sizeof(*mesh->node_group->bc_grp_ID) * mesh->node_group->n_bc;
1408  mesh->node_group->bc_grp_ID = HECMW_malloc(size);
1409  if (mesh->node_group->bc_grp_ID == NULL) {
1410  HECMW_set_error(errno, "");
1411  return -1;
1412  }
1413  memcpy(mesh->node_group->bc_grp_ID, src, size);
1414  return 0;
1415 }
1416 
1417 static int set_ngrp_bc_grp_type(void *src) {
1418  int size;
1419 
1420  if (mesh->node_group->n_bc <= 0) return 0;
1421  size = sizeof(*mesh->node_group->bc_grp_type) * mesh->node_group->n_bc;
1422  mesh->node_group->bc_grp_type = HECMW_malloc(size);
1423  if (mesh->node_group->bc_grp_type == NULL) {
1424  HECMW_set_error(errno, "");
1425  return -1;
1426  }
1427  memcpy(mesh->node_group->bc_grp_type, src, size);
1428  return 0;
1429 }
1430 
1431 static int set_ngrp_bc_grp_index(void *src) {
1432  int size;
1433 
1434  if (mesh->node_group->n_bc <= 0) return 0;
1435  size = sizeof(*mesh->node_group->bc_grp_index) * mesh->node_group->n_bc;
1436  mesh->node_group->bc_grp_index = HECMW_malloc(size);
1437  if (mesh->node_group->bc_grp_index == NULL) {
1438  HECMW_set_error(errno, "");
1439  return -1;
1440  }
1441  memcpy(mesh->node_group->bc_grp_index, src, size);
1442  return 0;
1443 }
1444 
1445 static int set_ngrp_bc_grp_dof(void *src) {
1446  int size;
1447 
1448  if (mesh->node_group->n_bc <= 0) return 0;
1449  size = sizeof(*mesh->node_group->bc_grp_dof) * mesh->node_group->n_bc;
1450  mesh->node_group->bc_grp_dof = HECMW_malloc(size);
1451  if (mesh->node_group->bc_grp_dof == NULL) {
1452  HECMW_set_error(errno, "");
1453  return -1;
1454  }
1455  memcpy(mesh->node_group->bc_grp_dof, src, size);
1456  return 0;
1457 }
1458 
1459 static int set_ngrp_bc_grp_val(void *src) {
1460  int size;
1461 
1462  if (mesh->node_group->n_bc <= 0) return 0;
1463  size = sizeof(*mesh->node_group->bc_grp_val) * mesh->node_group->n_bc;
1464  mesh->node_group->bc_grp_val = HECMW_malloc(size);
1465  if (mesh->node_group->bc_grp_val == NULL) {
1466  HECMW_set_error(errno, "");
1467  return -1;
1468  }
1469  memcpy(mesh->node_group->bc_grp_val, src, size);
1470  return 0;
1471 }
1472 
1473 static int set_egrp_n_grp(void *src) {
1474  mesh->elem_group->n_grp = *((int *)src);
1475  return 0;
1476 }
1477 
1478 static int set_egrp_n_bc(void *src) {
1479  mesh->elem_group->n_bc = *((int *)src);
1480  return 0;
1481 }
1482 
1483 static int set_egrp_grp_name(void *src) {
1484  int i;
1485  struct hecmwST_elem_grp *grp = mesh->elem_group;
1486 
1487  if (grp->n_grp <= 0) return 0;
1488 
1489  grp->grp_name = HECMW_calloc(grp->n_grp, sizeof(*grp->grp_name));
1490  if (grp->grp_name == NULL) {
1491  HECMW_set_error(errno, "");
1492  goto error;
1493  }
1494  for (i = 0; i < grp->n_grp; i++) {
1495  char *src_point = (char *)src + HECMW_NAME_LEN * i;
1496  grp->grp_name[i] = HECMW_strcpy_f2c(src_point, HECMW_NAME_LEN);
1497  if (grp->grp_name[i] == NULL) goto error;
1498  }
1499  return 0;
1500 error:
1501  if (grp->grp_name) {
1502  for (i = 0; i < grp->n_grp; i++) {
1503  HECMW_free(grp->grp_name[i]);
1504  }
1505  }
1506  HECMW_free(grp->grp_name);
1507  grp->grp_name = NULL;
1508  return -1;
1509 }
1510 
1511 static int set_egrp_grp_index(void *src) {
1512  int size;
1513 
1514  if (mesh->elem_group->n_grp <= 0) return 0;
1515  size = sizeof(*mesh->elem_group->grp_index) * (mesh->elem_group->n_grp + 1);
1516  mesh->elem_group->grp_index = HECMW_malloc(size);
1517  if (mesh->elem_group->grp_index == NULL) {
1518  HECMW_set_error(errno, "");
1519  return -1;
1520  }
1521  memcpy(mesh->elem_group->grp_index, src, size);
1522  return 0;
1523 }
1524 
1525 static int set_egrp_grp_item(void *src) {
1526  int size;
1527 
1528  if (mesh->elem_group->n_grp <= 0) return 0;
1529  if (mesh->elem_group->grp_index == NULL) return 0;
1530  if (mesh->elem_group->grp_index[mesh->elem_group->n_grp] <= 0) return 0;
1531 
1532  size = sizeof(*mesh->elem_group->grp_item) *
1533  mesh->elem_group->grp_index[mesh->elem_group->n_grp];
1534  mesh->elem_group->grp_item = HECMW_malloc(size);
1535  if (mesh->elem_group->grp_item == NULL) {
1536  HECMW_set_error(errno, "");
1537  return -1;
1538  }
1539  memcpy(mesh->elem_group->grp_item, src, size);
1540  return 0;
1541 }
1542 
1543 static int set_egrp_bc_grp_ID(void *src) {
1544  int size;
1545 
1546  if (mesh->elem_group->n_bc <= 0) return 0;
1547  size = sizeof(*mesh->elem_group->bc_grp_ID) * mesh->elem_group->n_bc;
1548  mesh->elem_group->bc_grp_ID = HECMW_malloc(size);
1549  if (mesh->elem_group->bc_grp_ID == NULL) {
1550  HECMW_set_error(errno, "");
1551  return -1;
1552  }
1553  memcpy(mesh->elem_group->bc_grp_ID, src, size);
1554  return 0;
1555 }
1556 
1557 static int set_egrp_bc_grp_type(void *src) {
1558  int size;
1559 
1560  if (mesh->elem_group->n_bc <= 0) return 0;
1561  size = sizeof(*mesh->elem_group->bc_grp_type) * mesh->elem_group->n_bc;
1562  mesh->elem_group->bc_grp_type = HECMW_malloc(size);
1563  if (mesh->elem_group->bc_grp_type == NULL) {
1564  HECMW_set_error(errno, "");
1565  return -1;
1566  }
1567  memcpy(mesh->elem_group->bc_grp_type, src, size);
1568  return 0;
1569 }
1570 
1571 static int set_egrp_bc_grp_index(void *src) {
1572  int size;
1573 
1574  if (mesh->elem_group->n_bc <= 0) return 0;
1575  size = sizeof(*mesh->elem_group->bc_grp_index) * mesh->elem_group->n_bc;
1576  mesh->elem_group->bc_grp_index = HECMW_malloc(size);
1577  if (mesh->elem_group->bc_grp_index == NULL) {
1578  HECMW_set_error(errno, "");
1579  return -1;
1580  }
1581  memcpy(mesh->elem_group->bc_grp_index, src, size);
1582  return 0;
1583 }
1584 
1585 static int set_egrp_bc_grp_val(void *src) {
1586  int size;
1587 
1588  if (mesh->elem_group->n_bc <= 0) return 0;
1589  size = sizeof(*mesh->elem_group->bc_grp_val) * mesh->elem_group->n_bc;
1590  mesh->elem_group->bc_grp_val = HECMW_malloc(size);
1591  if (mesh->elem_group->bc_grp_val == NULL) {
1592  HECMW_set_error(errno, "");
1593  return -1;
1594  }
1595  memcpy(mesh->elem_group->bc_grp_val, src, size);
1596  return 0;
1597 }
1598 
1599 static int set_sgrp_n_grp(void *src) {
1600  mesh->surf_group->n_grp = *((int *)src);
1601  return 0;
1602 }
1603 
1604 static int set_sgrp_n_bc(void *src) {
1605  mesh->surf_group->n_bc = *((int *)src);
1606  return 0;
1607 }
1608 
1609 static int set_sgrp_grp_name(void *src) {
1610  int i;
1611  struct hecmwST_surf_grp *grp = mesh->surf_group;
1612 
1613  if (grp->n_grp <= 0) return 0;
1614 
1615  grp->grp_name = HECMW_calloc(grp->n_grp, sizeof(*grp->grp_name));
1616  if (grp->grp_name == NULL) {
1617  HECMW_set_error(errno, "");
1618  goto error;
1619  }
1620  for (i = 0; i < grp->n_grp; i++) {
1621  char *src_point = (char *)src + HECMW_NAME_LEN * i;
1622  grp->grp_name[i] = HECMW_strcpy_f2c(src_point, HECMW_NAME_LEN);
1623  if (grp->grp_name[i] == NULL) goto error;
1624  }
1625  return 0;
1626 error:
1627  if (grp->grp_name) {
1628  for (i = 0; i < grp->n_grp; i++) {
1629  HECMW_free(grp->grp_name[i]);
1630  }
1631  }
1632  HECMW_free(grp->grp_name);
1633  grp->grp_name = NULL;
1634  return -1;
1635 }
1636 
1637 static int set_sgrp_grp_index(void *src) {
1638  int size;
1639 
1640  if (mesh->surf_group->n_grp <= 0) return 0;
1641  size = sizeof(*mesh->surf_group->grp_index) * (mesh->surf_group->n_grp + 1);
1642  mesh->surf_group->grp_index = HECMW_malloc(size);
1643  if (mesh->surf_group->grp_index == NULL) {
1644  HECMW_set_error(errno, "");
1645  return -1;
1646  }
1647  memcpy(mesh->surf_group->grp_index, src, size);
1648  return 0;
1649 }
1650 
1651 static int set_sgrp_grp_item(void *src) {
1652  int size;
1653 
1654  if (mesh->surf_group->n_grp <= 0) return 0;
1655  if (mesh->surf_group->grp_index == NULL) return 0;
1656  if (mesh->surf_group->grp_index[mesh->surf_group->n_grp] <= 0) return 0;
1657 
1658  size = sizeof(*mesh->surf_group->grp_item) * 2 *
1659  mesh->surf_group->grp_index[mesh->surf_group->n_grp];
1660  mesh->surf_group->grp_item = HECMW_malloc(size);
1661  if (mesh->surf_group->grp_item == NULL) {
1662  HECMW_set_error(errno, "");
1663  return -1;
1664  }
1665  memcpy(mesh->surf_group->grp_item, src, size);
1666  return 0;
1667 }
1668 
1669 static int set_sgrp_bc_grp_ID(void *src) {
1670  int size;
1671 
1672  if (mesh->surf_group->n_bc <= 0) return 0;
1673  size = sizeof(*mesh->surf_group->bc_grp_ID) * mesh->surf_group->n_bc;
1674  mesh->surf_group->bc_grp_ID = HECMW_malloc(size);
1675  if (mesh->surf_group->bc_grp_ID == NULL) {
1676  HECMW_set_error(errno, "");
1677  return -1;
1678  }
1679  memcpy(mesh->surf_group->bc_grp_ID, src, size);
1680  return 0;
1681 }
1682 
1683 static int set_sgrp_bc_grp_type(void *src) {
1684  int size;
1685 
1686  if (mesh->surf_group->n_bc <= 0) return 0;
1687  size = sizeof(*mesh->surf_group->bc_grp_type) * mesh->surf_group->n_bc;
1688  mesh->surf_group->bc_grp_type = HECMW_malloc(size);
1689  if (mesh->surf_group->bc_grp_type == NULL) {
1690  HECMW_set_error(errno, "");
1691  return -1;
1692  }
1693  memcpy(mesh->surf_group->bc_grp_type, src, size);
1694  return 0;
1695 }
1696 
1697 static int set_sgrp_bc_grp_index(void *src) {
1698  int size;
1699 
1700  if (mesh->surf_group->n_bc <= 0) return 0;
1701  size = sizeof(*mesh->surf_group->bc_grp_index) * 2 * mesh->surf_group->n_bc;
1702  mesh->surf_group->bc_grp_index = HECMW_malloc(size);
1703  if (mesh->surf_group->bc_grp_index == NULL) {
1704  HECMW_set_error(errno, "");
1705  return -1;
1706  }
1707  memcpy(mesh->surf_group->bc_grp_index, src, size);
1708  return 0;
1709 }
1710 
1711 static int set_sgrp_bc_grp_val(void *src) {
1712  int size;
1713 
1714  if (mesh->surf_group->n_bc <= 0) return 0;
1715  size = sizeof(*mesh->surf_group->bc_grp_val) * mesh->surf_group->n_bc;
1716  mesh->surf_group->bc_grp_val = HECMW_malloc(size);
1717  if (mesh->surf_group->bc_grp_val == NULL) {
1718  HECMW_set_error(errno, "");
1719  return -1;
1720  }
1721  memcpy(mesh->surf_group->bc_grp_val, src, size);
1722  return 0;
1723 }
1724 
1725 static int set_contact_pair_n_pair(void *src) {
1726  mesh->contact_pair->n_pair = *((int *)src);
1727  return 0;
1728 }
1729 
1730 static int set_contact_pair_name(void *src) {
1731  int i;
1732  struct hecmwST_contact_pair *cpair = mesh->contact_pair;
1733 
1734  if (cpair->n_pair <= 0) return 0;
1735 
1736  cpair->name = HECMW_calloc(cpair->n_pair, sizeof(*cpair->name));
1737  if (cpair->name == NULL) {
1738  HECMW_set_error(errno, "");
1739  goto error;
1740  }
1741  for (i = 0; i < cpair->n_pair; i++) {
1742  char *src_point = (char *)src + HECMW_NAME_LEN * i;
1743  cpair->name[i] = HECMW_strcpy_f2c(src_point, HECMW_NAME_LEN);
1744  if (cpair->name[i] == NULL) goto error;
1745  }
1746  return 0;
1747 error:
1748  if (cpair->name) {
1749  for (i = 0; i < cpair->n_pair; i++) {
1750  HECMW_free(cpair->name[i]);
1751  }
1752  }
1753  HECMW_free(cpair->name);
1754  cpair->name = NULL;
1755  return -1;
1756 }
1757 
1758 static int set_contact_pair_type(void *src) {
1759  int size;
1760 
1761  if (mesh->contact_pair->n_pair <= 0) return 0;
1762  size = sizeof(*mesh->contact_pair->type) * (mesh->contact_pair->n_pair);
1763  mesh->contact_pair->type = HECMW_malloc(size);
1764  if (mesh->contact_pair->type == NULL) {
1765  HECMW_set_error(errno, "");
1766  return -1;
1767  }
1768  memcpy(mesh->contact_pair->type, src, size);
1769  return 0;
1770 }
1771 
1772 static int set_contact_pair_slave_grp_id(void *src) {
1773  int size;
1774 
1775  if (mesh->contact_pair->n_pair <= 0) return 0;
1776  size =
1777  sizeof(*mesh->contact_pair->slave_grp_id) * (mesh->contact_pair->n_pair);
1778  mesh->contact_pair->slave_grp_id = HECMW_malloc(size);
1779  if (mesh->contact_pair->slave_grp_id == NULL) {
1780  HECMW_set_error(errno, "");
1781  return -1;
1782  }
1783  memcpy(mesh->contact_pair->slave_grp_id, src, size);
1784  return 0;
1785 }
1786 
1787 static int set_contact_pair_slave_orisgrp_id(void *src) {
1788  int size;
1789 
1790  if (mesh->contact_pair->n_pair <= 0) return 0;
1791  size =
1792  sizeof(*mesh->contact_pair->slave_orisgrp_id) * (mesh->contact_pair->n_pair);
1794  if (mesh->contact_pair->slave_orisgrp_id == NULL) {
1795  HECMW_set_error(errno, "");
1796  return -1;
1797  }
1798  memcpy(mesh->contact_pair->slave_orisgrp_id, src, size);
1799  return 0;
1800 }
1801 
1802 static int set_contact_pair_master_grp_id(void *src) {
1803  int size;
1804 
1805  if (mesh->contact_pair->n_pair <= 0) return 0;
1806  size =
1807  sizeof(*mesh->contact_pair->master_grp_id) * (mesh->contact_pair->n_pair);
1808  mesh->contact_pair->master_grp_id = HECMW_malloc(size);
1809  if (mesh->contact_pair->master_grp_id == NULL) {
1810  HECMW_set_error(errno, "");
1811  return -1;
1812  }
1813  memcpy(mesh->contact_pair->master_grp_id, src, size);
1814  return 0;
1815 }
1816 
1817 /*-----------------------------------------------------------------------------
1818  * SetFunc table
1819  */
1820 
1821 typedef int (*SetFunc)(void *);
1822 
1823 static struct func_table {
1824  char *struct_name;
1825  char *var_name;
1826  SetFunc set_func;
1827 } functions[] = {
1828  /* { Struct name, Variable name, memcpy function } */
1829  {"hecmwST_local_mesh", "hecmw_flag_adapt", set_hecmw_flag_adapt},
1830  {"hecmwST_local_mesh", "hecmw_flag_initcon", set_hecmw_flag_initcon},
1831  {"hecmwST_local_mesh", "hecmw_flag_parttype", set_hecmw_flag_parttype},
1832  {"hecmwST_local_mesh", "hecmw_flag_partdepth", set_hecmw_flag_partdepth},
1833  {"hecmwST_local_mesh", "hecmw_flag_version", set_hecmw_flag_version},
1834  {"hecmwST_local_mesh", "hecmw_flag_partcontact",
1835  set_hecmw_flag_partcontact},
1836 
1837  {"hecmwST_local_mesh", "gridfile", set_gridfile},
1838  {"hecmwST_local_mesh", "hecmw_n_file", set_hecmw_n_file},
1839  {"hecmwST_local_mesh", "files", set_files},
1840  {"hecmwST_local_mesh", "header", set_header},
1841  {"hecmwST_local_mesh", "zero_temp", set_zero_temp},
1842 
1843  {"hecmwST_local_mesh", "n_node", set_n_node},
1844  {"hecmwST_local_mesh", "n_node_gross", set_n_node_gross},
1845  {"hecmwST_local_mesh", "nn_middle", set_nn_middle},
1846  {"hecmwST_local_mesh", "nn_internal", set_nn_internal},
1847  {"hecmwST_local_mesh", "node_internal_list", set_node_internal_list},
1848  {"hecmwST_local_mesh", "node_ID", set_node_ID},
1849  {"hecmwST_local_mesh", "global_node_ID", set_global_node_ID},
1850  {"hecmwST_local_mesh", "node", set_node},
1851  {"hecmwST_local_mesh", "n_dof", set_n_dof},
1852  {"hecmwST_local_mesh", "n_dof_grp", set_n_dof_grp},
1853  {"hecmwST_local_mesh", "n_dof_tot", set_n_dof_tot},
1854  {"hecmwST_local_mesh", "node_dof_index", set_node_dof_index},
1855  {"hecmwST_local_mesh", "node_dof_item", set_node_dof_item},
1856  {"hecmwST_local_mesh", "node_val_index", set_node_val_index},
1857  {"hecmwST_local_mesh", "node_val_item", set_node_val_item},
1858  {"hecmwST_local_mesh", "node_init_val_index", set_node_init_val_index},
1859  {"hecmwST_local_mesh", "node_init_val_item", set_node_init_val_item},
1860  {"hecmwST_local_mesh", "n_elem", set_n_elem},
1861  {"hecmwST_local_mesh", "n_elem_gross", set_n_elem_gross},
1862  {"hecmwST_local_mesh", "ne_internal", set_ne_internal},
1863  {"hecmwST_local_mesh", "elem_internal_list", set_elem_internal_list},
1864  {"hecmwST_local_mesh", "elem_ID", set_elem_ID},
1865  {"hecmwST_local_mesh", "global_elem_ID", set_global_elem_ID},
1866  {"hecmwST_local_mesh", "elem_type", set_elem_type},
1867  {"hecmwST_local_mesh", "n_elem_type", set_n_elem_type},
1868  {"hecmwST_local_mesh", "elem_type_index", set_elem_type_index},
1869  {"hecmwST_local_mesh", "elem_type_item", set_elem_type_item},
1870  {"hecmwST_local_mesh", "elem_node_index", set_elem_node_index},
1871  {"hecmwST_local_mesh", "elem_node_item", set_elem_node_item},
1872  {"hecmwST_local_mesh", "section_ID", set_section_ID},
1873  {"hecmwST_local_mesh", "n_elem_mat_ID", set_n_elem_mat_ID},
1874  {"hecmwST_local_mesh", "elem_mat_ID_index", set_elem_mat_ID_index},
1875  {"hecmwST_local_mesh", "elem_mat_ID_item", set_elem_mat_ID_item},
1876  {"hecmwST_local_mesh", "elem_mat_int_index", set_elem_mat_int_index},
1877  {"hecmwST_local_mesh", "elem_mat_int_val", set_elem_mat_int_val},
1878  {"hecmwST_local_mesh", "elem_val_index", set_elem_val_index},
1879  {"hecmwST_local_mesh", "elem_val_item", set_elem_val_item},
1880 
1881  {"hecmwST_local_mesh", "zero", set_zero},
1882  {"hecmwST_local_mesh", "HECMW_COMM", set_HECMW_COMM},
1883  {"hecmwST_local_mesh", "PETOT", set_PETOT},
1884  {"hecmwST_local_mesh", "PEsmpTOT", set_PEsmpTOT},
1885  {"hecmwST_local_mesh", "my_rank", set_my_rank},
1886  {"hecmwST_local_mesh", "errnof", set_errnof},
1887  {"hecmwST_local_mesh", "n_subdomain", set_n_subdomain},
1888  {"hecmwST_local_mesh", "n_neighbor_pe", set_n_neighbor_pe},
1889  {"hecmwST_local_mesh", "neighbor_pe", set_neighbor_pe},
1890  {"hecmwST_local_mesh", "import_index", set_import_index},
1891  {"hecmwST_local_mesh", "import_item", set_import_item},
1892  {"hecmwST_local_mesh", "export_index", set_export_index},
1893  {"hecmwST_local_mesh", "export_item", set_export_item},
1894  {"hecmwST_local_mesh", "shared_index", set_shared_index},
1895  {"hecmwST_local_mesh", "shared_item", set_shared_item},
1896 
1897  {"hecmwST_local_mesh", "coarse_grid_level", set_coarse_grid_level},
1898  {"hecmwST_local_mesh", "n_adapt", set_n_adapt},
1899  {"hecmwST_local_mesh", "when_i_was_refined_node",
1900  set_when_i_was_refined_node},
1901  {"hecmwST_local_mesh", "when_i_was_refined_elem",
1902  set_when_i_was_refined_elem},
1903  {"hecmwST_local_mesh", "adapt_parent_type", set_adapt_parent_type},
1904  {"hecmwST_local_mesh", "adapt_type", set_adapt_type},
1905  {"hecmwST_local_mesh", "adapt_level", set_adapt_level},
1906  {"hecmwST_local_mesh", "adapt_parent", set_adapt_parent},
1907  {"hecmwST_local_mesh", "adapt_children_index", set_adapt_children_index},
1908  {"hecmwST_local_mesh", "adapt_children_item", set_adapt_children_item},
1909 
1910  {"hecmwST_local_mesh", "n_refine", set_n_refine},
1911  {"hecmwST_local_mesh", "node_old2new", set_node_old2new},
1912  {"hecmwST_local_mesh", "node_new2old", set_node_new2old},
1913  {"hecmwST_local_mesh", "elem_old2new", set_elem_old2new},
1914  {"hecmwST_local_mesh", "elem_new2old", set_elem_new2old},
1915  {"hecmwST_local_mesh", "n_node_refine_hist", set_n_node_refine_hist},
1916 
1917  {"hecmwST_section", "n_sect", set_n_sect},
1918  {"hecmwST_section", "sect_type", set_sect_type},
1919  {"hecmwST_section", "sect_opt", set_sect_opt},
1920  {"hecmwST_section", "sect_mat_ID_index", set_sect_mat_ID_index},
1921  {"hecmwST_section", "sect_mat_ID_item", set_sect_mat_ID_item},
1922  {"hecmwST_section", "sect_I_index", set_sect_I_index},
1923  {"hecmwST_section", "sect_I_item", set_sect_I_item},
1924  {"hecmwST_section", "sect_R_index", set_sect_R_index},
1925  {"hecmwST_section", "sect_R_item", set_sect_R_item},
1926 
1927  {"hecmwST_material", "n_mat", set_n_mat},
1928  {"hecmwST_material", "n_mat_item", set_n_mat_item},
1929  {"hecmwST_material", "n_mat_subitem", set_n_mat_subitem},
1930  {"hecmwST_material", "n_mat_table", set_n_mat_table},
1931  {"hecmwST_material", "mat_name", set_mat_name},
1932  {"hecmwST_material", "mat_item_index", set_mat_item_index},
1933  {"hecmwST_material", "mat_subitem_index", set_mat_subitem_index},
1934  {"hecmwST_material", "mat_table_index", set_mat_table_index},
1935  {"hecmwST_material", "mat_val", set_mat_val},
1936  {"hecmwST_material", "mat_temp", set_mat_temp},
1937 
1938  {"hecmwST_mpc", "n_mpc", set_n_mpc},
1939  {"hecmwST_mpc", "mpc_index", set_mpc_index},
1940  {"hecmwST_mpc", "mpc_item", set_mpc_item},
1941  {"hecmwST_mpc", "mpc_dof", set_mpc_dof},
1942  {"hecmwST_mpc", "mpc_val", set_mpc_val},
1943  {"hecmwST_mpc", "mpc_const", set_mpc_const},
1944 
1945  {"hecmwST_amplitude", "n_amp", set_n_amp},
1946  {"hecmwST_amplitude", "amp_name", set_amp_name},
1947  {"hecmwST_amplitude", "amp_type_definition", set_amp_type_definition},
1948  {"hecmwST_amplitude", "amp_type_time", set_amp_type_time},
1949  {"hecmwST_amplitude", "amp_type_value", set_amp_type_value},
1950  {"hecmwST_amplitude", "amp_index", set_amp_index},
1951  {"hecmwST_amplitude", "amp_val", set_amp_val},
1952  {"hecmwST_amplitude", "amp_table", set_amp_table},
1953 
1954  {"hecmwST_node_grp", "n_grp", set_ngrp_n_grp},
1955  {"hecmwST_node_grp", "grp_name", set_ngrp_grp_name},
1956  {"hecmwST_node_grp", "grp_index", set_ngrp_grp_index},
1957  {"hecmwST_node_grp", "grp_item", set_ngrp_grp_item},
1958  {"hecmwST_node_grp", "n_bc", set_ngrp_n_bc},
1959  {"hecmwST_node_grp", "bc_grp_ID", set_ngrp_bc_grp_ID},
1960  {"hecmwST_node_grp", "bc_grp_type", set_ngrp_bc_grp_type},
1961  {"hecmwST_node_grp", "bc_grp_index", set_ngrp_bc_grp_index},
1962  {"hecmwST_node_grp", "bc_grp_dof", set_ngrp_bc_grp_dof},
1963  {"hecmwST_node_grp", "bc_grp_val", set_ngrp_bc_grp_val},
1964 
1965  {"hecmwST_elem_grp", "n_grp", set_egrp_n_grp},
1966  {"hecmwST_elem_grp", "grp_name", set_egrp_grp_name},
1967  {"hecmwST_elem_grp", "grp_index", set_egrp_grp_index},
1968  {"hecmwST_elem_grp", "grp_item", set_egrp_grp_item},
1969  {"hecmwST_elem_grp", "n_bc", set_egrp_n_bc},
1970  {"hecmwST_elem_grp", "bc_grp_ID", set_egrp_bc_grp_ID},
1971  {"hecmwST_elem_grp", "bc_grp_type", set_egrp_bc_grp_type},
1972  {"hecmwST_elem_grp", "bc_grp_index", set_egrp_bc_grp_index},
1973  {"hecmwST_elem_grp", "bc_grp_val", set_egrp_bc_grp_val},
1974 
1975  {"hecmwST_surf_grp", "n_grp", set_sgrp_n_grp},
1976  {"hecmwST_surf_grp", "grp_name", set_sgrp_grp_name},
1977  {"hecmwST_surf_grp", "grp_index", set_sgrp_grp_index},
1978  {"hecmwST_surf_grp", "grp_item", set_sgrp_grp_item},
1979  {"hecmwST_surf_grp", "n_bc", set_sgrp_n_bc},
1980  {"hecmwST_surf_grp", "bc_grp_ID", set_sgrp_bc_grp_ID},
1981  {"hecmwST_surf_grp", "bc_grp_type", set_sgrp_bc_grp_type},
1982  {"hecmwST_surf_grp", "bc_grp_index", set_sgrp_bc_grp_index},
1983  {"hecmwST_surf_grp", "bc_grp_val", set_sgrp_bc_grp_val},
1984 
1985  {"hecmwST_contact_pair", "n_pair", set_contact_pair_n_pair},
1986  {"hecmwST_contact_pair", "name", set_contact_pair_name},
1987  {"hecmwST_contact_pair", "type", set_contact_pair_type},
1988  {"hecmwST_contact_pair", "slave_grp_id", set_contact_pair_slave_grp_id},
1989  {"hecmwST_contact_pair", "slave_orisgrp_id", set_contact_pair_slave_orisgrp_id},
1990  {"hecmwST_contact_pair", "master_grp_id", set_contact_pair_master_grp_id},
1991 };
1992 
1993 static const int NFUNC = sizeof(functions) / sizeof(functions[0]);
1994 
1995 static SetFunc get_set_func(char *struct_name, char *var_name) {
1996  int i;
1997 
1998  for (i = 0; i < NFUNC; i++) {
1999  if (strcmp(functions[i].struct_name, struct_name) == 0 &&
2000  strcmp(functions[i].var_name, var_name) == 0) {
2001  return functions[i].set_func;
2002  }
2003  }
2004  return NULL;
2005 }
2006 
2008  struct hecmwST_local_mesh tmp;
2009 
2010  tmp = *local_mesh;
2011  memset(local_mesh, 0, sizeof(*local_mesh));
2012  local_mesh->section = tmp.section;
2013  memset(local_mesh->section, 0, sizeof(*local_mesh->section));
2014  local_mesh->material = tmp.material;
2015  memset(local_mesh->material, 0, sizeof(*local_mesh->material));
2016  local_mesh->mpc = tmp.mpc;
2017  memset(local_mesh->mpc, 0, sizeof(*local_mesh->mpc));
2018  local_mesh->amp = tmp.amp;
2019  memset(local_mesh->amp, 0, sizeof(*local_mesh->amp));
2020  local_mesh->node_group = tmp.node_group;
2021  memset(local_mesh->node_group, 0, sizeof(*local_mesh->node_group));
2022  local_mesh->elem_group = tmp.elem_group;
2023  memset(local_mesh->elem_group, 0, sizeof(*local_mesh->elem_group));
2024  local_mesh->surf_group = tmp.surf_group;
2025  memset(local_mesh->surf_group, 0, sizeof(*local_mesh->surf_group));
2026  local_mesh->contact_pair = tmp.contact_pair;
2027  memset(local_mesh->contact_pair, 0, sizeof(*local_mesh->contact_pair));
2028 
2029  mesh = local_mesh;
2030  return 0;
2031 }
2032 
2034  mesh = NULL;
2035  return 0;
2036 }
2037 
2038 /*----------------------------------------------------------------------------*/
2039 
2040 void hecmw_dist_copy_f2c_set_if(char *struct_name, char *var_name, void *src,
2041  int *err, int slen, int vlen) {
2042  SetFunc func;
2043  char sname[HECMW_NAME_LEN + 1];
2044  char vname[HECMW_NAME_LEN + 1];
2045 
2046  *err = 1;
2047 
2048  if (mesh == NULL) {
2051  "HECMW_dist_copy_f2c_set_if(): 'mesh' has not initialized yet");
2052  return;
2053  }
2054  if (struct_name == NULL) {
2056  "HECMW_dist_copy_f2c_set_if(): 'sname' is NULL");
2057  return;
2058  }
2059  if (var_name == NULL) {
2061  "HECMW_dist_copy_f2c_set_if(): 'vname' is NULL");
2062  return;
2063  }
2064 
2065  if (HECMW_strcpy_f2c_r(struct_name, slen, sname, sizeof(sname)) == NULL) {
2066  return;
2067  }
2068  if (HECMW_strcpy_f2c_r(var_name, vlen, vname, sizeof(vname)) == NULL) {
2069  return;
2070  }
2071 
2072  func = get_set_func(sname, vname);
2073  if (func == NULL) {
2075  "HECMW_dist_copy_f2c_set_if(): SetFunc not found");
2076  return;
2077  }
2078 
2079  if ((*func)(src)) return;
2080 
2081  *err = 0;
2082 }
2083 
2084 void hecmw_dist_copy_f2c_set_if_(char *struct_name, char *var_name, void *src,
2085  int *err, int slen, int vlen) {
2086  hecmw_dist_copy_f2c_set_if(struct_name, var_name, src, err, slen, vlen);
2087 }
2088 
2089 void hecmw_dist_copy_f2c_set_if__(char *struct_name, char *var_name, void *src,
2090  int *err, int slen, int vlen) {
2091  hecmw_dist_copy_f2c_set_if(struct_name, var_name, src, err, slen, vlen);
2092 }
2093 
2094 void HECMW_DIST_COPY_F2C_SET_IF(char *struct_name, char *var_name, void *src,
2095  int *err, int slen, int vlen) {
2096  hecmw_dist_copy_f2c_set_if(struct_name, var_name, src, err, slen, vlen);
2097 }
hecmw_dist_copy_f2c_set_if
void hecmw_dist_copy_f2c_set_if(char *struct_name, char *var_name, void *src, int *err, int slen, int vlen)
Definition: hecmw_dist_copy_f2c.c:2040
hecmwST_local_mesh::my_rank
int my_rank
Definition: hecmw_struct.h:212
hecmwST_local_mesh::mpc
struct hecmwST_mpc * mpc
Definition: hecmw_struct.h:247
hecmwST_local_mesh::global_node_ID
int * global_node_ID
Definition: hecmw_struct.h:168
hecmwST_local_mesh::section_ID
int * section_ID
Definition: hecmw_struct.h:197
hecmwST_local_mesh::hecmw_flag_partcontact
int hecmw_flag_partcontact
Definition: hecmw_struct.h:148
hecmwST_local_mesh::hecmw_n_file
int hecmw_n_file
Definition: hecmw_struct.h:155
hecmwST_local_mesh::shared_index
int * shared_index
Definition: hecmw_struct.h:221
hecmwST_local_mesh::errnof
int errnof
Definition: hecmw_struct.h:213
hecmwST_node_grp::bc_grp_dof
int * bc_grp_dof
Definition: hecmw_struct.h:88
hecmwST_amplitude::amp_val
double * amp_val
Definition: hecmw_struct.h:71
hecmwST_local_mesh::nn_middle
int nn_middle
Definition: hecmw_struct.h:163
hecmwST_node_grp::n_grp
int n_grp
Definition: hecmw_struct.h:76
hecmwST_section::sect_R_index
int * sect_R_index
Definition: hecmw_struct.h:34
hecmwST_amplitude::amp_index
int * amp_index
Definition: hecmw_struct.h:70
hecmwST_local_mesh::node_new2old
int * node_new2old
Definition: hecmw_struct.h:240
hecmwST_local_mesh::n_dof_tot
int n_dof_tot
Definition: hecmw_struct.h:173
HECMW_Fint
MPI_Fint HECMW_Fint
Definition: hecmw_config.h:42
hecmwST_material::n_mat_subitem
int n_mat_subitem
Definition: hecmw_struct.h:38
hecmwST_surf_grp::bc_grp_ID
int * bc_grp_ID
Definition: hecmw_struct.h:113
hecmwST_local_mesh::hecmw_flag_partdepth
int hecmw_flag_partdepth
Definition: hecmw_struct.h:146
hecmwST_material::n_mat_table
int n_mat_table
Definition: hecmw_struct.h:39
hecmwST_elem_grp::bc_grp_index
int * bc_grp_index
Definition: hecmw_struct.h:102
hecmwST_local_mesh::elem_node_item
int * elem_node_item
Definition: hecmw_struct.h:196
HECMW_malloc
#define HECMW_malloc(size)
Definition: hecmw_malloc.h:20
hecmwST_local_mesh::elem_old2new
int * elem_old2new
Definition: hecmw_struct.h:241
hecmwST_amplitude::amp_table
double * amp_table
Definition: hecmw_struct.h:72
hecmwST_local_mesh::shared_item
int * shared_item
Definition: hecmw_struct.h:222
hecmwST_local_mesh::gridfile
char gridfile[HECMW_FILENAME_LEN+1]
Definition: hecmw_struct.h:154
hecmwST_local_mesh::elem_mat_int_val
double * elem_mat_int_val
Definition: hecmw_struct.h:203
hecmwST_local_mesh::elem_group
struct hecmwST_elem_grp * elem_group
Definition: hecmw_struct.h:250
hecmwST_local_mesh::elem_new2old
int * elem_new2old
Definition: hecmw_struct.h:242
hecmwST_local_mesh::adapt_parent
int * adapt_parent
Definition: hecmw_struct.h:233
hecmwST_local_mesh::n_node_gross
int n_node_gross
Definition: hecmw_struct.h:162
hecmwST_local_mesh::elem_mat_int_index
int * elem_mat_int_index
Definition: hecmw_struct.h:202
hecmwST_local_mesh::adapt_parent_type
int * adapt_parent_type
Definition: hecmw_struct.h:229
hecmwST_section::sect_I_index
int * sect_I_index
Definition: hecmw_struct.h:32
hecmwST_node_grp::bc_grp_val
double * bc_grp_val
Definition: hecmw_struct.h:89
hecmwST_local_mesh::elem_type_item
int * elem_type_item
Definition: hecmw_struct.h:194
hecmwST_local_mesh::node_ID
int * node_ID
Definition: hecmw_struct.h:167
hecmwST_local_mesh::hecmw_flag_parttype
int hecmw_flag_parttype
Definition: hecmw_struct.h:142
HECMW_DIST_COPY_F2C_SET_IF
void HECMW_DIST_COPY_F2C_SET_IF(char *struct_name, char *var_name, void *src, int *err, int slen, int vlen)
Definition: hecmw_dist_copy_f2c.c:2094
hecmwST_mpc::mpc_item
int * mpc_item
Definition: hecmw_struct.h:51
hecmwST_local_mesh
Definition: hecmw_struct.h:139
hecmwST_local_mesh::elem_ID
int * elem_ID
Definition: hecmw_struct.h:189
hecmwST_local_mesh::adapt_type
int * adapt_type
Definition: hecmw_struct.h:230
hecmwST_surf_grp::bc_grp_val
double * bc_grp_val
Definition: hecmw_struct.h:118
hecmwST_amplitude::amp_type_time
int * amp_type_time
Definition: hecmw_struct.h:64
hecmwST_amplitude::amp_type_value
int * amp_type_value
Definition: hecmw_struct.h:67
hecmwST_local_mesh::elem_type
int * elem_type
Definition: hecmw_struct.h:191
hecmwST_mpc::mpc_val
double * mpc_val
Definition: hecmw_struct.h:53
hecmwST_local_mesh::n_elem
int n_elem
Definition: hecmw_struct.h:184
hecmwST_surf_grp::grp_index
int * grp_index
Definition: hecmw_struct.h:109
hecmwST_material::mat_subitem_index
int * mat_subitem_index
Definition: hecmw_struct.h:42
hecmwST_local_mesh::neighbor_pe
int * neighbor_pe
Definition: hecmw_struct.h:216
hecmwST_local_mesh::ne_internal
int ne_internal
Definition: hecmw_struct.h:186
hecmwST_mpc::mpc_const
double * mpc_const
Definition: hecmw_struct.h:54
hecmwST_local_mesh::export_item
int * export_item
Definition: hecmw_struct.h:220
hecmwST_local_mesh::node_dof_item
int * node_dof_item
Definition: hecmw_struct.h:175
hecmwST_mpc::mpc_dof
int * mpc_dof
Definition: hecmw_struct.h:52
hecmwST_local_mesh::export_index
int * export_index
Definition: hecmw_struct.h:219
hecmwST_elem_grp::bc_grp_val
double * bc_grp_val
Definition: hecmw_struct.h:103
hecmwST_material::mat_table_index
int * mat_table_index
Definition: hecmw_struct.h:43
hecmwST_local_mesh::import_item
int * import_item
Definition: hecmw_struct.h:218
hecmwST_surf_grp::grp_item
int * grp_item
Definition: hecmw_struct.h:111
hecmwST_local_mesh::node_val_index
int * node_val_index
Definition: hecmw_struct.h:177
hecmwST_local_mesh::node_old2new
int * node_old2new
Definition: hecmw_struct.h:239
HECMW_calloc
#define HECMW_calloc(nmemb, size)
Definition: hecmw_malloc.h:21
HECMW_dist_copy_f2c_finalize
int HECMW_dist_copy_f2c_finalize(void)
Definition: hecmw_dist_copy_f2c.c:2033
hecmwST_local_mesh::coarse_grid_level
int coarse_grid_level
Definition: hecmw_struct.h:225
hecmwST_local_mesh::n_node
int n_node
Definition: hecmw_struct.h:161
hecmw_struct.h
hecmwST_local_mesh::node
double * node
Definition: hecmw_struct.h:170
hecmwST_section::sect_opt
int * sect_opt
Definition: hecmw_struct.h:23
hecmwST_amplitude
Definition: hecmw_struct.h:57
hecmwST_elem_grp
Definition: hecmw_struct.h:92
hecmwST_contact_pair::slave_orisgrp_id
int * slave_orisgrp_id
Definition: hecmw_struct.h:129
hecmwST_local_mesh::n_node_refine_hist
int * n_node_refine_hist
Definition: hecmw_struct.h:243
hecmwST_local_mesh::PETOT
int PETOT
Definition: hecmw_struct.h:210
hecmwST_local_mesh::when_i_was_refined_elem
int * when_i_was_refined_elem
Definition: hecmw_struct.h:228
hecmwST_local_mesh::node_dof_index
int * node_dof_index
Definition: hecmw_struct.h:174
hecmwST_local_mesh::n_elem_mat_ID
int n_elem_mat_ID
Definition: hecmw_struct.h:200
hecmwST_contact_pair::n_pair
int n_pair
Definition: hecmw_struct.h:122
HECMW_NAME_LEN
#define HECMW_NAME_LEN
Definition: hecmw_config.h:70
hecmwST_section::sect_mat_ID_index
int * sect_mat_ID_index
Definition: hecmw_struct.h:30
hecmwST_amplitude::n_amp
int n_amp
Definition: hecmw_struct.h:58
hecmwST_local_mesh::material
struct hecmwST_material * material
Definition: hecmw_struct.h:246
hecmwST_local_mesh::node_val_item
double * node_val_item
Definition: hecmw_struct.h:178
hecmwST_local_mesh::elem_mat_ID_index
int * elem_mat_ID_index
Definition: hecmw_struct.h:198
hecmwST_material::mat_temp
double * mat_temp
Definition: hecmw_struct.h:45
hecmwST_local_mesh::hecmw_flag_adapt
int hecmw_flag_adapt
Definition: hecmw_struct.h:140
hecmwST_mpc::n_mpc
int n_mpc
Definition: hecmw_struct.h:49
hecmwST_surf_grp::n_grp
int n_grp
Definition: hecmw_struct.h:107
hecmwST_local_mesh::amp
struct hecmwST_amplitude * amp
Definition: hecmw_struct.h:248
hecmwST_local_mesh::zero_temp
double zero_temp
Definition: hecmw_struct.h:158
hecmwST_surf_grp::bc_grp_index
int * bc_grp_index
Definition: hecmw_struct.h:117
hecmwST_local_mesh::node_internal_list
int * node_internal_list
Definition: hecmw_struct.h:165
hecmwST_local_mesh::elem_val_index
int * elem_val_index
Definition: hecmw_struct.h:204
hecmwST_local_mesh::adapt_level
int * adapt_level
Definition: hecmw_struct.h:231
hecmwST_local_mesh::elem_node_index
int * elem_node_index
Definition: hecmw_struct.h:195
hecmwST_local_mesh::n_elem_type
int n_elem_type
Definition: hecmw_struct.h:192
hecmwST_section::sect_type
int * sect_type
Definition: hecmw_struct.h:17
hecmwST_node_grp::n_bc
int n_bc
Definition: hecmw_struct.h:81
hecmwST_section::n_sect
int n_sect
Definition: hecmw_struct.h:15
hecmw_dist_copy_f2c_set_if__
void hecmw_dist_copy_f2c_set_if__(char *struct_name, char *var_name, void *src, int *err, int slen, int vlen)
Definition: hecmw_dist_copy_f2c.c:2089
hecmwST_local_mesh::PEsmpTOT
int PEsmpTOT
Definition: hecmw_struct.h:211
hecmwST_elem_grp::grp_item
int * grp_item
Definition: hecmw_struct.h:96
hecmwST_node_grp::grp_index
int * grp_index
Definition: hecmw_struct.h:78
hecmwST_elem_grp::grp_name
char ** grp_name
Definition: hecmw_struct.h:94
hecmwST_section::sect_I_item
int * sect_I_item
Definition: hecmw_struct.h:33
hecmwST_local_mesh::hecmw_flag_initcon
int hecmw_flag_initcon
Definition: hecmw_struct.h:141
hecmwST_local_mesh::adapt_children_index
int * adapt_children_index
Definition: hecmw_struct.h:234
hecmwST_local_mesh::elem_type_index
int * elem_type_index
Definition: hecmw_struct.h:193
HECMW_ALL_E0101
#define HECMW_ALL_E0101
Definition: hecmw_msgno.h:8
hecmwST_contact_pair::type
int * type
Definition: hecmw_struct.h:124
hecmwST_node_grp::grp_item
int * grp_item
Definition: hecmw_struct.h:79
hecmwST_local_mesh::elem_val_item
double * elem_val_item
Definition: hecmw_struct.h:205
hecmwST_amplitude::amp_name
char ** amp_name
Definition: hecmw_struct.h:59
hecmwST_section::sect_mat_ID_item
int * sect_mat_ID_item
Definition: hecmw_struct.h:31
hecmwST_material::n_mat
int n_mat
Definition: hecmw_struct.h:36
hecmwST_node_grp
Definition: hecmw_struct.h:75
hecmwST_local_mesh::elem_mat_ID_item
int * elem_mat_ID_item
Definition: hecmw_struct.h:199
hecmwST_node_grp::bc_grp_ID
int * bc_grp_ID
Definition: hecmw_struct.h:82
hecmwST_local_mesh::n_refine
int n_refine
Definition: hecmw_struct.h:238
hecmwST_node_grp::bc_grp_type
int * bc_grp_type
Definition: hecmw_struct.h:84
hecmwST_material::n_mat_item
int n_mat_item
Definition: hecmw_struct.h:37
hecmwST_local_mesh::when_i_was_refined_node
int * when_i_was_refined_node
Definition: hecmw_struct.h:227
hecmwST_material::mat_name
char ** mat_name
Definition: hecmw_struct.h:40
hecmw_dist_copy_f2c_set_if_
void hecmw_dist_copy_f2c_set_if_(char *struct_name, char *var_name, void *src, int *err, int slen, int vlen)
Definition: hecmw_dist_copy_f2c.c:2084
hecmwST_local_mesh::nn_internal
int nn_internal
Definition: hecmw_struct.h:164
hecmwST_elem_grp::bc_grp_ID
int * bc_grp_ID
Definition: hecmw_struct.h:99
hecmwST_local_mesh::node_init_val_item
double * node_init_val_item
Definition: hecmw_struct.h:181
hecmwST_local_mesh::n_adapt
int n_adapt
Definition: hecmw_struct.h:226
HECMW_ALL_E0102
#define HECMW_ALL_E0102
Definition: hecmw_msgno.h:9
hecmwST_surf_grp
Definition: hecmw_struct.h:106
HECMW_strcpy_f2c
char * HECMW_strcpy_f2c(const char *fstr, int flen)
Definition: hecmw_lib_fc.c:11
hecmwST_contact_pair
Definition: hecmw_struct.h:121
hecmwST_material::mat_item_index
int * mat_item_index
Definition: hecmw_struct.h:41
hecmwST_contact_pair::slave_grp_id
int * slave_grp_id
Definition: hecmw_struct.h:128
hecmwST_local_mesh::n_dof
int n_dof
Definition: hecmw_struct.h:171
HECMW_strcpy_f2c_r
char * HECMW_strcpy_f2c_r(const char *fstr, int flen, char *buf, int bufsize)
Definition: hecmw_lib_fc.c:45
hecmwST_local_mesh::n_subdomain
int n_subdomain
Definition: hecmw_struct.h:214
hecmwST_local_mesh::import_index
int * import_index
Definition: hecmw_struct.h:217
hecmwST_local_mesh::hecmw_flag_version
int hecmw_flag_version
Definition: hecmw_struct.h:147
SetFunc
int(* SetFunc)(void *)
Definition: hecmw_dist_copy_f2c.c:1821
hecmwST_surf_grp::n_bc
int n_bc
Definition: hecmw_struct.h:112
hecmwST_local_mesh::zero
int zero
Definition: hecmw_struct.h:208
hecmwST_elem_grp::n_bc
int n_bc
Definition: hecmw_struct.h:98
HECMW_set_error
int HECMW_set_error(int errorno, const char *fmt,...)
Definition: hecmw_error.c:37
hecmwST_contact_pair::name
char ** name
Definition: hecmw_struct.h:123
hecmwST_local_mesh::files
char ** files
Definition: hecmw_struct.h:156
hecmwST_elem_grp::n_grp
int n_grp
Definition: hecmw_struct.h:93
HECMW_dist_copy_f2c_init
int HECMW_dist_copy_f2c_init(struct hecmwST_local_mesh *local_mesh)
Definition: hecmw_dist_copy_f2c.c:2007
hecmwST_material::mat_val
double * mat_val
Definition: hecmw_struct.h:44
hecmwST_local_mesh::section
struct hecmwST_section * section
Definition: hecmw_struct.h:245
hecmwST_elem_grp::grp_index
int * grp_index
Definition: hecmw_struct.h:95
hecmwST_node_grp::grp_name
char ** grp_name
Definition: hecmw_struct.h:77
hecmwST_node_grp::bc_grp_index
int * bc_grp_index
Definition: hecmw_struct.h:87
NULL
#define NULL
Definition: hecmw_io_nastran.c:30
HECMW_free
#define HECMW_free(ptr)
Definition: hecmw_malloc.h:24
hecmwST_elem_grp::bc_grp_type
int * bc_grp_type
Definition: hecmw_struct.h:101
hecmwST_local_mesh::n_elem_gross
int n_elem_gross
Definition: hecmw_struct.h:185
hecmwST_local_mesh::adapt_children_item
int * adapt_children_item
Definition: hecmw_struct.h:235
hecmwST_material
Definition: hecmw_struct.h:35
hecmwST_section::sect_R_item
double * sect_R_item
Definition: hecmw_struct.h:35
hecmwST_local_mesh::header
char header[HECMW_HEADER_LEN+1]
Definition: hecmw_struct.h:157
HECMW_FILENAME_LEN
#define HECMW_FILENAME_LEN
Definition: hecmw_config.h:72
hecmwST_mpc::mpc_index
int * mpc_index
Definition: hecmw_struct.h:50
hecmwST_surf_grp::grp_name
char ** grp_name
Definition: hecmw_struct.h:108
hecmwST_local_mesh::n_neighbor_pe
int n_neighbor_pe
Definition: hecmw_struct.h:215
hecmwST_local_mesh::global_elem_ID
int * global_elem_ID
Definition: hecmw_struct.h:190
hecmwST_local_mesh::surf_group
struct hecmwST_surf_grp * surf_group
Definition: hecmw_struct.h:251
hecmwST_local_mesh::n_dof_grp
int n_dof_grp
Definition: hecmw_struct.h:172
hecmwST_local_mesh::node_group
struct hecmwST_node_grp * node_group
Definition: hecmw_struct.h:249
hecmw_util.h
hecmwST_contact_pair::master_grp_id
int * master_grp_id
Definition: hecmw_struct.h:130
hecmwST_local_mesh::node_init_val_index
int * node_init_val_index
Definition: hecmw_struct.h:180
hecmwST_local_mesh::contact_pair
struct hecmwST_contact_pair * contact_pair
Definition: hecmw_struct.h:252
HECMW_HEADER_LEN
#define HECMW_HEADER_LEN
Definition: hecmw_config.h:68
hecmwST_local_mesh::HECMW_COMM
HECMW_Comm HECMW_COMM
Definition: hecmw_struct.h:209
HECMW_Comm_f2c
HECMW_Comm HECMW_Comm_f2c(HECMW_Fint comm)
Definition: hecmw_comm.c:723
hecmwST_surf_grp::bc_grp_type
int * bc_grp_type
Definition: hecmw_struct.h:115
hecmwST_amplitude::amp_type_definition
int * amp_type_definition
Definition: hecmw_struct.h:61
hecmwST_local_mesh::elem_internal_list
int * elem_internal_list
Definition: hecmw_struct.h:187