FrontISTR 5.2.0
Large-scale structural analysis program with finit element method
Loading...
Searching...
No Matches
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}
if(!(yy_init))
Definition: hecmw_ablex.c:1305
struct hecmwST_local_mesh * mesh
Definition: hecmw_repart.h:71
void HECMW_dlb_print_exit(char *var)
void HECMW_put_result_from_structure(struct hecmwST_local_mesh *mesh, struct hecmwST_result_data *data, char *resultfile_dist)
#define NULL
CNFData data