FrontISTR 5.2.0
Large-scale structural analysis program with finit element method
Loading...
Searching...
No Matches
visualizer.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 "hecmw_struct.h"
9#include "hecmw_result.h"
10#include "hecmw_util.h"
11#include "hecmw_io.h"
12#include "hecmw_visualizer.h"
13
14extern PSF_link *psf;
15extern PVR_link *pvr;
16
17int main(int argc, char **argv) {
18 int i;
21 char *resultfile, resultfile1[HECMW_FILENAME_LEN];
22 int min_step, max_step, interval, timestep;
23 PSF_link *tp1;
24 PVR_link *tv1;
25 int fg_text;
26 int mynode;
27
28 if (HECMW_init(&argc, &argv)) abort();
29
30 mesh = HECMW_get_mesh("fstrMSH");
32
34
36
37 min_step = 100000000;
38 max_step = -10000000;
39 tp1 = psf->next_psf;
40 tv1 = pvr->next_pvr;
41 for (i = 0; i < psf->num_of_psf; i++) {
42 if ((tp1->visual_start_step != -1) && (tp1->visual_start_step < min_step))
43 min_step = tp1->visual_start_step;
44 if ((tp1->visual_end_step != -1) && (tp1->visual_end_step > max_step))
45 max_step = tp1->visual_end_step;
46 interval = tp1->visual_interval_step;
47 tp1 = tp1->next_psf;
48 }
49 for (i = 0; i < pvr->num_of_pvr; i++) {
50 if ((tv1->visual_start_step != -1) && (tv1->visual_start_step < min_step))
51 min_step = tv1->visual_start_step;
52 if ((tv1->visual_end_step != -1) && (tv1->visual_end_step > max_step))
53 max_step = tv1->visual_end_step;
54 interval = tp1->visual_interval_step;
55 tv1 = tv1->next_pvr;
56 }
57 if ((min_step == 100000000) && (max_step == -10000000)) {
58 min_step = 1;
59 max_step = 1;
60 interval = 1;
61 }
62
63 for (timestep = min_step; timestep <= max_step; timestep++) {
64 if ((timestep % interval) != 0 && timestep != max_step) continue;
65
66 resultfile = HECMW_ctrl_get_result_fileheader("fstrRES", timestep,
67 &fg_text);
68 sprintf(resultfile1, "%s.%d.%d", resultfile, mynode, timestep);
69 data = HECMW_result_read_by_fname(resultfile1);
71
72 HECMW_visualize(mesh, data, timestep);
73
75 }
76
78
80
82
83 return 0;
84}
int HECMW_Comm_rank(HECMW_Comm comm, int *rank)
Definition: hecmw_comm.c:18
HECMW_Comm HECMW_comm_get_comm(void)
Definition: hecmw_comm.c:699
#define HECMW_FILENAME_LEN
Definition: hecmw_config.h:72
char * HECMW_ctrl_get_result_fileheader(char *name_ID, int istep, int *fg_text)
void HECMW_dist_free(struct hecmwST_local_mesh *mesh)
struct hecmwST_local_mesh * mesh
Definition: hecmw_repart.h:71
int HECMW_finalize(void)
Definition: hecmw_finalize.c:9
int HECMW_init(int *argc, char ***argv)
Definition: hecmw_init.c:24
struct hecmwST_local_mesh * HECMW_get_mesh(char *name_ID)
#define NULL
struct hecmwST_result_data * HECMW_result_read_by_fname(char *filename)
Definition: hecmw_result.c:168
void HECMW_result_free(struct hecmwST_result_data *result)
Definition: hecmw_result.c:25
void HECMW_abort(HECMW_Comm comm)
Definition: hecmw_util.c:88
int HECMW_visualize(struct hecmwST_local_mesh *mesh, struct hecmwST_result_data *data, int timestep)
int HECMW_visualize_init(void)
int HECMW_visualize_finalize(void)
CNFData data
HECMW_Comm HECMW_COMM
Definition: hecmw_struct.h:208
int main()
Definition: varray_test.c:10
PVR_link * pvr
PSF_link * psf