FrontISTR  5.7.0
Large-scale structural analysis program with finit element method
fstr_rmerge_util.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 
10 #include "fstr_rmerge_util.h"
11 
12 #include <stdio.h>
13 #include <string.h>
14 #include <stdlib.h>
15 
16 #include "hecmw_util.h"
17 #include "hecmw_dist_free.h"
18 #include "hecmw_io_dist.h"
19 #include "hecmw_io_get_mesh.h"
20 #include "hecmw_etype.h"
21 
22 static FILE* Log_FP;
23 
27 void fstr_set_log_fp(FILE *log_fp) {
28  Log_FP = log_fp;
29 }
30 
34 void fstr_out_log(const char* fmt, ...) {
35  va_list arg;
36  va_start(arg, fmt);
37  vfprintf(Log_FP, fmt, arg);
38  va_end(arg);
39 }
40 
45 static int get_dist_fname(char* name_ID, char* fheader, int* fg_single,
46  int* refine, int nrank, int irank) {
47  struct hecmw_ctrl_meshfiles* files;
48 
49  files = HECMW_ctrl_get_meshfiles_header_sub(name_ID, nrank, irank);
50  if (!files) return -1;
51 
52  if (files->n_mesh == 1) {
53  strcpy(fheader, files->meshfiles[0].filename);
54  if (files->meshfiles[0].type == HECMW_CTRL_FTYPE_HECMW_DIST) {
55  *fg_single = 0;
56  } else {
57  *fg_single = 1;
58  }
59  *refine = files->meshfiles[0].refine;
60  fstr_out_log("refine number is %d\n", *refine);
61  } else {
63  return -1;
64  }
65 
67  return 0;
68 }
69 
70 static int get_area_n(char* fheader) {
71  FILE* fp;
72  char buff[HECMW_FILENAME_LEN + 1];
73  int area = 0;
74 
75  while (1) {
76  sprintf(buff, "%s.%d", fheader, area);
77  fstr_out_log("try open : %s ... ", buff);
78  fp = fopen(buff, "r");
79  if (!fp) {
80  fstr_out_log("fail\n");
81  fstr_out_log("area number is %d\n", area);
82  return area;
83  } else {
84  fstr_out_log("success\n");
85  fclose(fp);
86  }
87  area++;
88  }
89 }
90 
96  int nrank,
97  int* area_number,
98  int* refine) {
99  int i;
100  int area_n;
101  int fg_single;
102  char fheader[HECMW_HEADER_LEN + 1];
103  char fname[HECMW_FILENAME_LEN + 1];
104  struct hecmwST_local_mesh** mesh;
105 
106  if (get_dist_fname(name_ID, fheader, &fg_single, refine, nrank, 0)) return NULL;
107 
108  if (fg_single) {
109  fstr_out_log("mesh file type is NOT HECMW_DIST.\n");
110  area_n = 1;
111  fstr_out_log("area number is %d\n", area_n);
112  mesh = HECMW_malloc(area_n * sizeof(struct hecmwST_local_mesh*));
113  mesh[0] = HECMW_get_mesh(name_ID);
114  if (!mesh[0]) return NULL;
115  } else {
116  fstr_out_log("mesh file type is HECMW_DIST.\n");
117  if (nrank == 0) {
118  area_n = get_area_n(fheader);
119  } else {
120  area_n = nrank;
121  }
122  if (area_n == 0) return NULL;
123  mesh = HECMW_malloc(area_n * sizeof(struct hecmwST_local_mesh*));
124  for (i = 0; i < area_n; i++) {
125  if (nrank == 0) {
126  sprintf(fname, "%s.%d", fheader, i);
127  } else {
128  get_dist_fname(name_ID, fheader, &fg_single, refine, nrank, i);
129  sprintf(fname, "%s.%d", fheader, i);
130  }
131  fstr_out_log("loading dist mesh from %s\n", fname);
132  mesh[i] = HECMW_get_dist_mesh(fname);
133  if (!mesh[i]) return NULL;
134  }
135  }
136  *area_number = area_n;
137 
138  return mesh;
139 }
140 
145 void fstr_free_mesh(struct hecmwST_local_mesh** mesh, int area_n) {
146  int i;
147 
148  if (!mesh) return;
149 
150  for (i = 0; i < area_n; i++) {
151  HECMW_dist_free(mesh[i]);
152  }
153  HECMW_free(mesh);
154  return;
155 }
156 
161 int fstr_get_step_n(char* name_ID, int nrank) {
162  FILE* fp;
163  int step, fg_text;
164  char* fheader;
165  char fname[HECMW_FILENAME_LEN + 1];
166 
167  if (nrank == 0) {
168  if ((fheader = HECMW_ctrl_get_result_fileheader(name_ID, 1, &fg_text)) ==
169  NULL)
170  return 0;
171  } else {
172  if ((fheader = HECMW_ctrl_get_result_fileheader_sub(name_ID, 1, nrank, 0,
173  &fg_text)) == NULL)
174  return 0;
175  }
176 
177  step = 1;
178  while (1) {
179  sprintf(fname, "%s.0.%d", fheader, step);
180  fstr_out_log("try open : %s ... ", fname);
181  fp = fopen(fname, "r");
182  if (!fp) {
183  fstr_out_log("fail\n");
184  fstr_out_log("step number is %d\n", step - 1);
185  return step - 1;
186  } else {
187  fstr_out_log("success\n");
188  fclose(fp);
189  }
190  step++;
191  }
192 }
193 
198 fstr_res_info** fstr_get_all_result(char* name_ID, int step, int area_n,
199  int refine, int nrank) {
200  char* fheader;
201  char fname[HECMW_FILENAME_LEN + 1];
202  fstr_res_info** res;
203  struct hecmwST_result_data* data;
204  int i, j, k, count, num, nnode, nelem, flag, fg_text;
205  int *node_gid, *elem_gid;
206  int refine_nnode = 0;
207 
208  if (nrank == 0) {
209  if ((fheader = HECMW_ctrl_get_result_fileheader(name_ID, step,
210  &fg_text)) == NULL)
211  return 0;
212  }
213 
214  res = HECMW_malloc(area_n * sizeof(fstr_res_info*));
215  if (!res) return NULL;
216 
217  for (i = 0; i < area_n; i++) {
218  res[i] = HECMW_malloc(sizeof(fstr_res_info));
219  if (!res[i]) return NULL;
220 
221  if (nrank != 0) {
223  name_ID, step, nrank, i, &fg_text)) == NULL)
224  return 0;
225  }
226  sprintf(fname, "%s.%d.%d", fheader, i, step);
228  if (!data) return NULL;
229  nnode = HECMW_result_get_nnode();
230  node_gid = HECMW_malloc(nnode * sizeof(int));
231  if (!node_gid) return NULL;
232  HECMW_result_get_nodeID(node_gid);
233  nelem = HECMW_result_get_nelem();
234  elem_gid = HECMW_malloc(nelem * sizeof(int));
235  if (!elem_gid) return NULL;
236  if (data->ne_component) HECMW_result_get_elemID(elem_gid);
237 
238  if (refine) {
239  res[i]->result = HECMW_malloc(sizeof(struct hecmwST_result_data));
240  if (!res[i]->result) return NULL;
241 
242  res[i]->result->ng_component = data->ng_component;
243  res[i]->result->ng_dof = HECMW_malloc(data->ng_component * sizeof(int));
244  if (!res[i]->result->ng_dof) return NULL;
245  res[i]->result->global_label =
246  HECMW_malloc(data->ng_component * sizeof(char*));
247  if (!res[i]->result->global_label) return NULL;
248  for (j = 0; j < data->ng_component; j++) {
249  res[i]->result->ng_dof[j] = data->ng_dof[j];
250  res[i]->result->global_label[j] = HECMW_strdup(data->global_label[j]);
251  }
252 
253  res[i]->result->nn_component = data->nn_component;
254  res[i]->result->nn_dof = HECMW_malloc(data->nn_component * sizeof(int));
255  if (!res[i]->result->nn_dof) return NULL;
256  res[i]->result->node_label =
257  HECMW_malloc(data->nn_component * sizeof(char*));
258  if (!res[i]->result->node_label) return NULL;
259  num = 0;
260  for (j = 0; j < data->nn_component; j++) {
261  res[i]->result->nn_dof[j] = data->nn_dof[j];
262  res[i]->result->node_label[j] = HECMW_strdup(data->node_label[j]);
263  num += data->nn_dof[j];
264  }
265 
266  count = 1;
267  flag = 0;
268  for (j = 1; j < nnode; j++) {
269  if (flag == refine) break;
270  count++;
271  if (node_gid[j] > 0 && node_gid[j - 1] < 0) flag++;
272  if (node_gid[j] < 0 && node_gid[j] > node_gid[j - 1]) flag++;
273  }
274  count--;
275  fstr_out_log("\narea:%d -- refined_nn_internal:%d", i, count);
276  refine_nnode += count;
277 
278  count = 0;
279  for (j = 0; j < nnode; j++)
280  if (node_gid[j] > 0) count++;
281  res[i]->nnode_gid = count;
282  res[i]->result->node_val_item =
283  HECMW_malloc(num * count * sizeof(double));
284  if (!res[i]->result->node_val_item) return NULL;
285  count = 0;
286  for (j = 0; j < nnode; j++) {
287  if (node_gid[j] > 0) {
288  for (k = 0; k < num; k++) {
289  res[i]->result->node_val_item[count++] =
290  data->node_val_item[num * j + k];
291  }
292  }
293  }
294 
295  res[i]->result->ne_component = data->ne_component;
296  res[i]->result->ne_dof = HECMW_malloc(data->ne_component * sizeof(int));
297  if (!res[i]->result->ne_dof) return NULL;
298  res[i]->result->elem_label =
299  HECMW_malloc(data->ne_component * sizeof(char*));
300  if (!res[i]->result->elem_label) return NULL;
301  num = 0;
302  for (j = 0; j < data->ne_component; j++) {
303  res[i]->result->ne_dof[j] = data->ne_dof[j];
304  res[i]->result->elem_label[j] = HECMW_strdup(data->elem_label[j]);
305  num += data->ne_dof[j];
306  }
307 
308  count = 0;
309  for (j = 0; j < nelem; j++)
310  if (elem_gid[j] > 0) count++;
311  fstr_out_log("\narea:%d -- ne_original from result:%d", i, count);
312  res[i]->nelem_gid = count;
313  res[i]->result->elem_val_item =
314  HECMW_malloc(num * count * sizeof(double));
315  if (!res[i]->result->elem_val_item) return NULL;
316  count = 0;
317  for (j = 0; j < nelem; j++) {
318  if (elem_gid[j] > 0) {
319  for (k = 0; k < num; k++) {
320  res[i]->result->elem_val_item[count++] =
321  data->elem_val_item[num * j + k];
322  }
323  }
324  }
325 
329 
330  res[i]->node_gid = HECMW_malloc(res[i]->nnode_gid * sizeof(int));
331  if (!res[i]->node_gid) return NULL;
332  count = 0;
333  for (j = 0; j < nnode; j++) {
334  if (node_gid[j] > 0) res[i]->node_gid[count++] = node_gid[j];
335  }
336  free(node_gid);
337 
338  res[i]->elem_gid = HECMW_malloc(res[i]->nelem_gid * sizeof(int));
339  if (!res[i]->elem_gid) return NULL;
340  count = 0;
341  for (j = 0; j < nelem; j++) {
342  if (elem_gid[j] > 0) res[i]->elem_gid[count++] = elem_gid[j];
343  }
344  free(elem_gid);
345  } else {
346  res[i]->result = data;
347  res[i]->nnode_gid = nnode;
348  res[i]->node_gid = node_gid;
349  res[i]->nelem_gid = nelem;
350  res[i]->elem_gid = elem_gid;
351  }
352  }
353 
354  if (refine) fstr_out_log("\ntotal refined_nn_internal:%d\n", refine_nnode);
355 
356  return res;
357 }
358 
364  int refine) {
365  int i, j, k, l_id, area;
366  int gitem, nitem, eitem, count, irec;
367  struct hecmwST_result_data* data;
368 
369  gitem = 0;
370  for (i = 0; i < res[0]->result->ng_component; i++)
371  gitem += res[0]->result->ng_dof[i];
372  nitem = 0;
373  for (i = 0; i < res[0]->result->nn_component; i++)
374  nitem += res[0]->result->nn_dof[i];
375  eitem = 0;
376  for (i = 0; i < res[0]->result->ne_component; i++)
377  eitem += res[0]->result->ne_dof[i];
378 
379  data = HECMW_malloc(sizeof(struct hecmwST_result_data));
380  data->ng_dof = HECMW_malloc(res[0]->result->ng_component * sizeof(int));
381  data->global_label = HECMW_malloc(res[0]->result->ng_component * sizeof(char*));
382  data->global_val_item = HECMW_malloc(gitem * sizeof(double));
383  data->nn_dof = HECMW_malloc(res[0]->result->nn_component * sizeof(int));
384  data->node_label = HECMW_malloc(res[0]->result->nn_component * sizeof(char*));
385  data->node_val_item = HECMW_malloc(nitem * glt->node_n * sizeof(double));
386  data->ne_dof = HECMW_malloc(res[0]->result->ne_component * sizeof(int));
387  data->elem_label = HECMW_malloc(res[0]->result->ne_component * sizeof(char*));
388  data->elem_val_item = HECMW_malloc(eitem * glt->elem_n * sizeof(double));
389 
390  data->ng_component = res[0]->result->ng_component;
391  for (i = 0; i < res[0]->result->ng_component; i++) {
392  data->ng_dof[i] = res[0]->result->ng_dof[i];
393  data->global_label[i] = HECMW_strdup(res[0]->result->global_label[i]);
394  }
395  for (i = 0; i < gitem; i++) {
396  data->global_val_item[i] = res[0]->result->global_val_item[i];
397  }
398  count = 0;
399  for (i = 0; i < glt->node_n; i++) {
400  l_id = glt->nrec[i].local;
401  area = glt->nrec[i].area;
402  irec = nitem * l_id;
403  for (j = 0; j < res[0]->result->nn_component; j++) {
404  for (k = 0; k < res[0]->result->nn_dof[j]; k++) {
405  data->node_val_item[count++] = res[area]->result->node_val_item[irec++];
406  }
407  }
408  }
409  data->nn_component = res[0]->result->nn_component;
410  for (i = 0; i < res[0]->result->nn_component; i++) {
411  data->nn_dof[i] = res[0]->result->nn_dof[i];
412  data->node_label[i] = HECMW_strdup(res[0]->result->node_label[i]);
413  }
414 
415  count = 0;
416  for (i = 0; i < glt->elem_n; i++) {
417  l_id = glt->erec[i].local;
418  area = glt->erec[i].area;
419  irec = eitem * l_id;
420  for (j = 0; j < res[0]->result->ne_component; j++) {
421  for (k = 0; k < res[0]->result->ne_dof[j]; k++) {
422  if (refine) {
423  data->elem_val_item[count++] = 0.0;
424  } else {
425  data->elem_val_item[count++] =
426  res[area]->result->elem_val_item[irec++];
427  }
428  }
429  }
430  }
431  data->ne_component = res[0]->result->ne_component;
432  for (i = 0; i < res[0]->result->ne_component; i++) {
433  data->ne_dof[i] = res[0]->result->ne_dof[i];
434  data->elem_label[i] = HECMW_strdup(res[0]->result->elem_label[i]);
435  }
436 
437  return data;
438 }
439 
444 void fstr_free_result(fstr_res_info** res, int area_n) {
445  int i;
446 
447  if (!res) return;
448 
449  for (i = 0; i < area_n; i++) {
450  HECMW_result_free(res[i]->result);
451  HECMW_free(res[i]->node_gid);
452  HECMW_free(res[i]->elem_gid);
453  HECMW_free(res[i]);
454  }
455  HECMW_free(res);
456  return;
457 }
458 
463 static int cmp_global_glt(const fstr_gl_rec* g1, const fstr_gl_rec* g2) {
464  return (g1->global - g2->global);
465 }
466 
467 typedef int (*cmp_func)(const void*, const void*);
468 
469 fstr_glt* fstr_create_glt(struct hecmwST_local_mesh** mesh, int area_n) {
470  int i, j, k, eid, count;
471  int all_n, all_e;
472  int area_e;
473  fstr_gl_rec* nrec;
474  fstr_gl_rec* erec;
475  fstr_glt* glt;
476  int* area_etype_list;
477 
478  all_n = 0;
479  for (i = 0; i < area_n; i++) {
480  fstr_out_log("area:%d -- nn_internal:%d\n", i, mesh[i]->nn_internal);
481  all_n += mesh[i]->nn_internal;
482  }
483  fstr_out_log("total nn_internal:%d\n", all_n);
484 
485  nrec = HECMW_malloc(sizeof(fstr_gl_rec) * all_n);
486  if (!nrec) return NULL;
487 
488  count = 0;
489  for (i = 0; i < area_n; i++) {
490  for (j = 0; j < mesh[i]->nn_internal; j++) {
491  nrec[count].global = mesh[i]->global_node_ID[j];
492  nrec[count].local = j;
493  nrec[count].area = i;
494  count++;
495  }
496  }
497 
498  qsort(nrec, all_n, sizeof(fstr_gl_rec), (cmp_func)cmp_global_glt);
499 
500  all_e = 0;
501  for (i = 0; i < area_n; i++) {
502  area_e = 0;
503  area_etype_list = HECMW_malloc(sizeof(int) * mesh[i]->n_elem);
504  for (j = 0; j < mesh[i]->n_elem_type; j++) {
505  for (k = mesh[i]->elem_type_index[j]; k < mesh[i]->elem_type_index[j+1]; k++) {
506  area_etype_list[k] = mesh[i]->elem_type_item[j];
507  }
508  }
509 
510  for (j = 0; j < mesh[i]->ne_internal; j++) {
511  eid = mesh[i]->elem_internal_list[j] - 1;
512  if ( HECMW_is_etype_patch(area_etype_list[eid]) ) continue;
513  if ( HECMW_is_etype_link(area_etype_list[eid]) ) continue;
514  area_e++;
515  }
516 
517  HECMW_free(area_etype_list);
518  all_e += area_e;
519  fstr_out_log("area:%d -- ne_internal:%d\n", i, area_e);
520  }
521  fstr_out_log("total ne_internal:%d\n", all_e);
522 
523  erec = HECMW_malloc(sizeof(fstr_gl_rec) * all_e);
524  if (!erec) return NULL;
525 
526  count = 0;
527  for (i = 0; i < area_n; i++) {
528 
529  area_etype_list = HECMW_malloc(sizeof(int) * mesh[i]->n_elem);
530  for (j = 0; j < mesh[i]->n_elem_type; j++) {
531  for (k = mesh[i]->elem_type_index[j]; k < mesh[i]->elem_type_index[j+1]; k++) {
532  area_etype_list[k] = mesh[i]->elem_type_item[j];
533  }
534  }
535 
536  for (j = 0; j < mesh[i]->ne_internal; j++) {
537  eid = mesh[i]->elem_internal_list[j] - 1;
538  if ( HECMW_is_etype_patch(area_etype_list[eid]) ) continue;
539  if ( HECMW_is_etype_link(area_etype_list[eid]) ) continue;
540 
541  erec[count].global = mesh[i]->global_elem_ID[eid];
542  erec[count].local = eid;
543  erec[count].area = i;
544  count++;
545  }
546 
547  HECMW_free(area_etype_list);
548  }
549 
550  qsort(erec, all_e, sizeof(fstr_gl_rec), (cmp_func)cmp_global_glt);
551 
552  glt = HECMW_malloc(sizeof(fstr_glt));
553  if (!glt) return NULL;
554  glt->nrec = nrec;
555  glt->erec = erec;
556  glt->node_n = all_n;
557  glt->elem_n = all_e;
558 
559  return glt;
560 }
561 
567  if (!glt) return;
568 
569  HECMW_free(glt->nrec);
570  HECMW_free(glt->erec);
571  HECMW_free(glt);
572  return;
573 }
574 
580  struct hecmwST_local_mesh* mesh;
581  int i;
582 
583  mesh = HECMW_calloc(1, sizeof(struct hecmwST_local_mesh));
584  mesh->global_node_ID = HECMW_malloc(glt->node_n * sizeof(int));
585  mesh->global_elem_ID = HECMW_malloc(glt->elem_n * sizeof(int));
586 
587  for (i = 0; i < glt->node_n; i++) {
588  mesh->global_node_ID[i] = glt->nrec[i].global;
589  }
590  mesh->n_node = glt->node_n;
591 
592  for (i = 0; i < glt->elem_n; i++) {
593  mesh->global_elem_ID[i] = glt->erec[i].global;
594  }
595  mesh->n_elem = glt->elem_n;
596 
597  return mesh;
598 }
599 
605  if (!mesh) return;
606 
609  HECMW_free(mesh);
610  return;
611 }
HECMW_result_free_elemID
void HECMW_result_free_elemID(void)
Definition: hecmw_result.c:235
fstr_get_step_n
int fstr_get_step_n(char *name_ID, int nrank)
Check the number of steps (check for the existence of files)
Definition: fstr_rmerge_util.c:161
hecmw_etype.h
fstr_gl_rec::area
int area
Definition: fstr_rmerge_util.h:33
hecmwST_result_data
Definition: hecmw_result.h:11
hecmwST_local_mesh::global_node_ID
int * global_node_ID
Definition: hecmw_struct.h:168
HECMW_ctrl_get_result_fileheader_sub
char * HECMW_ctrl_get_result_fileheader_sub(char *name_ID, int istep, int n_rank, int i_rank, int *fg_text)
Definition: hecmw_control.c:2331
hecmwST_result_data::global_label
char ** global_label
Definition: hecmw_result.h:21
fstr_get_all_local_mesh
struct hecmwST_local_mesh ** fstr_get_all_local_mesh(char *name_ID, int nrank, int *area_number, int *refine)
Read all distributed meshes.
Definition: fstr_rmerge_util.c:95
HECMW_dist_free
void HECMW_dist_free(struct hecmwST_local_mesh *mesh)
Definition: hecmw_dist_free.c:218
HECMW_malloc
#define HECMW_malloc(size)
Definition: hecmw_malloc.h:20
fstr_glt::nrec
fstr_gl_rec * nrec
Definition: fstr_rmerge_util.h:41
hecmw_ctrl_meshfile::refine
int refine
Definition: hecmw_control.h:32
mesh
struct hecmwST_local_mesh * mesh
Definition: hecmw_repart.h:71
hecmwST_local_mesh::elem_type_item
int * elem_type_item
Definition: hecmw_struct.h:194
HECMW_result_read_by_fname
struct hecmwST_result_data * HECMW_result_read_by_fname(char *filename)
Definition: hecmw_result.c:165
hecmwST_local_mesh
Definition: hecmw_struct.h:139
fstr_glt::elem_n
int elem_n
Definition: fstr_rmerge_util.h:44
HECMW_ctrl_get_meshfiles_header_sub
struct hecmw_ctrl_meshfiles * HECMW_ctrl_get_meshfiles_header_sub(char *name_ID, int n_rank, int i_rank)
Definition: hecmw_control.c:2219
fstr_gl_rec
Global ID, local ID and belonging area record.
Definition: fstr_rmerge_util.h:30
fstr_free_result
void fstr_free_result(fstr_res_info **res, int area_n)
Definition: fstr_rmerge_util.c:444
fstr_out_log
void fstr_out_log(const char *fmt,...)
Log output.
Definition: fstr_rmerge_util.c:34
fstr_glt::erec
fstr_gl_rec * erec
Definition: fstr_rmerge_util.h:42
hecmwST_local_mesh::n_elem
int n_elem
Definition: hecmw_struct.h:184
fstr_res_info
Utility for reading and processing results computed in parallel.
Definition: fstr_rmerge_util.h:18
hecmwST_local_mesh::ne_internal
int ne_internal
Definition: hecmw_struct.h:186
hecmw_dist_free.h
fstr_gl_rec::global
int global
Definition: fstr_rmerge_util.h:31
hecmwST_result_data::ne_component
int ne_component
Definition: hecmw_result.h:17
HECMW_calloc
#define HECMW_calloc(nmemb, size)
Definition: hecmw_malloc.h:21
hecmwST_local_mesh::n_node
int n_node
Definition: hecmw_struct.h:161
hecmw_io_dist.h
fstr_free_glmesh
void fstr_free_glmesh(struct hecmwST_local_mesh *mesh)
Delete a single region mesh.
Definition: fstr_rmerge_util.c:604
HECMW_result_get_nnode
int HECMW_result_get_nnode(void)
Definition: hecmw_result.c:200
fstr_res_info::node_gid
int * node_gid
Definition: fstr_rmerge_util.h:21
HECMW_is_etype_link
int HECMW_is_etype_link(int etype)
Definition: hecmw_etype.c:1987
HECMW_CTRL_FTYPE_HECMW_DIST
#define HECMW_CTRL_FTYPE_HECMW_DIST
Definition: hecmw_control.h:14
fstr_set_log_fp
void fstr_set_log_fp(FILE *log_fp)
Set file pointer for log output.
Definition: fstr_rmerge_util.c:27
HECMW_result_free_nodeID
void HECMW_result_free_nodeID(void)
Definition: hecmw_result.c:230
HECMW_strdup
#define HECMW_strdup(s)
Definition: hecmw_malloc.h:23
HECMW_ctrl_free_meshfiles
void HECMW_ctrl_free_meshfiles(struct hecmw_ctrl_meshfiles *meshfiles)
Definition: hecmw_control.c:2066
hecmwST_local_mesh::n_elem_type
int n_elem_type
Definition: hecmw_struct.h:192
hecmw_ctrl_meshfile::type
int type
Definition: hecmw_control.h:12
hecmw_io_get_mesh.h
hecmwST_result_data::node_val_item
double * node_val_item
Definition: hecmw_result.h:25
data
CNFData data
Definition: neu_reporter.cpp:18
HECMW_get_mesh
struct hecmwST_local_mesh * HECMW_get_mesh(char *name_ID)
Definition: hecmw_io_get_mesh.c:62
HECMW_is_etype_patch
int HECMW_is_etype_patch(int etype)
Definition: hecmw_etype.c:2048
fstr_res_info::result
struct hecmwST_result_data * result
Definition: fstr_rmerge_util.h:23
hecmwST_local_mesh::elem_type_index
int * elem_type_index
Definition: hecmw_struct.h:193
hecmwST_result_data::nn_dof
int * nn_dof
Definition: hecmw_result.h:19
fstr_create_glt
fstr_glt * fstr_create_glt(struct hecmwST_local_mesh **mesh, int area_n)
Create table for global ID, local ID and belonging area records fstr_glt.
Definition: fstr_rmerge_util.c:469
fstr_create_glmesh
struct hecmwST_local_mesh * fstr_create_glmesh(fstr_glt *glt)
Create a single region mesh.
Definition: fstr_rmerge_util.c:579
HECMW_result_get_elemID
int * HECMW_result_get_elemID(int *buff)
Definition: hecmw_result.c:222
hecmwST_result_data::nn_component
int nn_component
Definition: hecmw_result.h:16
hecmwST_result_data::elem_label
char ** elem_label
Definition: hecmw_result.h:23
fstr_res_info::nelem_gid
int nelem_gid
Definition: fstr_rmerge_util.h:20
fstr_rmerge_util.h
fstr_glt
Table for global ID, local ID and belonging area records.
Definition: fstr_rmerge_util.h:40
hecmwST_local_mesh::nn_internal
int nn_internal
Definition: hecmw_struct.h:164
hecmw_ctrl_meshfiles
Definition: hecmw_control.h:39
HECMW_result_get_nelem
int HECMW_result_get_nelem(void)
Definition: hecmw_result.c:202
hecmw_ctrl_meshfile::filename
char * filename
Definition: hecmw_control.h:34
fstr_glt::node_n
int node_n
Definition: fstr_rmerge_util.h:43
fstr_free_glt
void fstr_free_glt(fstr_glt *glt)
Delete fstr_glt.
Definition: fstr_rmerge_util.c:566
cmp_func
int(* cmp_func)(const void *, const void *)
Definition: fstr_rmerge_util.c:467
HECMW_get_dist_mesh
struct hecmwST_local_mesh * HECMW_get_dist_mesh(char *fname)
Definition: hecmw_io_dist.c:1662
fstr_get_all_result
fstr_res_info ** fstr_get_all_result(char *name_ID, int step, int area_n, int refine, int nrank)
Read all area data of step.
Definition: fstr_rmerge_util.c:198
hecmwST_result_data::global_val_item
double * global_val_item
Definition: hecmw_result.h:24
hecmwST_result_data::node_label
char ** node_label
Definition: hecmw_result.h:22
hecmw_ctrl_meshfiles::meshfiles
struct hecmw_ctrl_meshfile * meshfiles
Definition: hecmw_control.h:42
fstr_gl_rec::local
int local
Definition: fstr_rmerge_util.h:32
hecmwST_result_data::elem_val_item
double * elem_val_item
Definition: hecmw_result.h:26
fstr_res_info::nnode_gid
int nnode_gid
Definition: fstr_rmerge_util.h:19
fstr_res_info::elem_gid
int * elem_gid
Definition: fstr_rmerge_util.h:22
HECMW_result_free
void HECMW_result_free(struct hecmwST_result_data *result)
Definition: hecmw_result.c:21
fstr_all_result
struct hecmwST_result_data * fstr_all_result(fstr_glt *glt, fstr_res_info **res, int refine)
Combine data in all areas of the step.
Definition: fstr_rmerge_util.c:363
hecmwST_result_data::ng_component
int ng_component
Definition: hecmw_result.h:15
NULL
#define NULL
Definition: hecmw_io_nastran.c:30
HECMW_free
#define HECMW_free(ptr)
Definition: hecmw_malloc.h:24
hecmwST_result_data::ng_dof
int * ng_dof
Definition: hecmw_result.h:18
HECMW_FILENAME_LEN
#define HECMW_FILENAME_LEN
Definition: hecmw_config.h:72
HECMW_result_get_nodeID
int * HECMW_result_get_nodeID(int *buff)
Definition: hecmw_result.c:214
hecmwST_local_mesh::global_elem_ID
int * global_elem_ID
Definition: hecmw_struct.h:190
hecmw_util.h
HECMW_HEADER_LEN
#define HECMW_HEADER_LEN
Definition: hecmw_config.h:68
fstr_free_mesh
void fstr_free_mesh(struct hecmwST_local_mesh **mesh, int area_n)
Delete mesh.
Definition: fstr_rmerge_util.c:145
HECMW_ctrl_get_result_fileheader
char * HECMW_ctrl_get_result_fileheader(char *name_ID, int istep, int *fg_text)
Definition: hecmw_control.c:2321
hecmwST_local_mesh::elem_internal_list
int * elem_internal_list
Definition: hecmw_struct.h:187
hecmwST_result_data::ne_dof
int * ne_dof
Definition: hecmw_result.h:20
hecmw_ctrl_meshfiles::n_mesh
int n_mesh
Definition: hecmw_control.h:40