FrontISTR  5.7.0
Large-scale structural analysis program with finit element method
hecmw_dlb_output_result.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 "hecmw_repart.h"
7 
10  char *resultfile_dist) {
11  FILE *fp;
12  int i, j, k;
13  int tn_component, tmp_count;
14 
15  if ((fp = fopen(resultfile_dist, "w")) == NULL)
16  HECMW_dlb_print_exit("ERROR: HEC-MW-VIS-E0011: Cannot open output file");
17  fprintf(fp, "Dynamic_load_balancing_result\n");
18  fprintf(fp, "%d %d\n", mesh->n_node, mesh->n_elem);
19  fprintf(fp, "%d %d\n", data->nn_component, data->ne_component);
20  if (data->nn_component > 0) {
21  for (i = 0; i < data->nn_component; i++)
22  fprintf(fp, "%d ", data->nn_dof[i]);
23  fprintf(fp, "\n");
24  for (i = 0; i < data->nn_component; i++)
25  fprintf(fp, "%s\n", data->node_label[i]);
26  tn_component = 0;
27  for (i = 0; i < data->nn_component; i++) tn_component += data->nn_dof[i];
28  if (tn_component <= 5) {
29  for (i = 0; i < mesh->n_node; i++) {
30  for (j = 0; j < tn_component; j++)
31  fprintf(fp, "%e ", data->node_val_item[i * tn_component + j]);
32  fprintf(fp, "\n");
33  }
34  } else {
35  tmp_count = 0;
36  for (i = 0; i < mesh->n_node; i++) {
37  for (j = 0; j < tn_component; j++) {
38  fprintf(fp, "%e ", data->node_val_item[i * tn_component + j]);
39  tmp_count++;
40  if (tmp_count == 5) {
41  tmp_count = 0;
42  fprintf(fp, "\n");
43  }
44  }
45  }
46  }
47  }
48  return;
49 }
hecmwST_result_data
Definition: hecmw_result.h:11
if
if(!(yy_init))
Definition: hecmw_ablex.c:1823
mesh
struct hecmwST_local_mesh * mesh
Definition: hecmw_repart.h:71
hecmwST_local_mesh
Definition: hecmw_struct.h:139
hecmw_repart.h
hecmwST_local_mesh::n_elem
int n_elem
Definition: hecmw_struct.h:184
hecmwST_local_mesh::n_node
int n_node
Definition: hecmw_struct.h:161
data
CNFData data
Definition: neu_reporter.cpp:18
NULL
#define NULL
Definition: hecmw_io_nastran.c:30
HECMW_dlb_print_exit
void HECMW_dlb_print_exit(char *var)
Definition: hecmw_dlb_mem_util.c:16
HECMW_put_result_from_structure
void HECMW_put_result_from_structure(struct hecmwST_local_mesh *mesh, struct hecmwST_result_data *data, char *resultfile_dist)
Definition: hecmw_dlb_output_result.c:8