31 if ((contfp = fopen(
"hecmw_vis.ini",
"r")) ==
NULL) {
33 if ((contfp = fopen(contfile,
"r")) ==
NULL)
55 const char *outfile,
const char *buf1) {
61 int visual_id, init_flag;
76 "ERROR: HEC-MW-VIS-E0009: Cannot open output directory");
82 for (visual_id = 0; visual_id <
psf->
num_of_psf; visual_id++) {
84 fprintf(stderr,
" Start visualize PSF %d at timestep %d\n",
85 visual_id + 1, timestep);
92 if (timestep >= 1000) {
93 snprintf(outfile1,
sizeof(outfile1),
"%s_psf%d.%d", outfile, visual_id + 1, timestep);
94 snprintf(body,
sizeof(body),
"%s_psf%d.%d", buf1, visual_id + 1, timestep);
95 }
else if ((timestep >= 100) && (timestep <= 999)) {
96 snprintf(outfile1,
sizeof(outfile1),
"%s_psf%d.0%d", outfile, visual_id + 1, timestep);
97 snprintf(body,
sizeof(body),
"%s_psf%d.0%d", buf1, visual_id + 1, timestep);
98 }
else if ((timestep >= 10) && (timestep <= 99)) {
99 snprintf(outfile1,
sizeof(outfile1),
"%s_psf%d.00%d", outfile, visual_id + 1, timestep);
100 snprintf(body,
sizeof(body),
"%s_psf%d.00%d", buf1, visual_id + 1, timestep);
101 }
else if (timestep <= 9) {
102 snprintf(outfile1,
sizeof(outfile1),
"%s_psf%d.000%d", outfile, visual_id + 1, timestep);
103 snprintf(body,
sizeof(body),
"%s_psf%d.000%d", buf1, visual_id + 1, timestep);
106 if (timestep >= 1000) {
107 snprintf(outfile1,
sizeof(outfile1),
"%s_psf.%d", outfile, timestep);
108 snprintf(body,
sizeof(body),
"%s_psf.%d", buf1, timestep);
109 }
else if ((timestep >= 100) && (timestep <= 999)) {
110 snprintf(outfile1,
sizeof(outfile1),
"%s_psf.0%d", outfile, timestep);
111 snprintf(body,
sizeof(body),
"%s_psf.0%d", buf1, timestep);
112 }
else if ((timestep >= 10) && (timestep <= 99)) {
113 snprintf(outfile1,
sizeof(outfile1),
"%s_psf.00%d", outfile, timestep);
114 snprintf(body,
sizeof(body),
"%s_psf.00%d", buf1, timestep);
115 }
else if (timestep <= 9) {
116 snprintf(outfile1,
sizeof(outfile1),
"%s_psf.000%d", outfile, timestep);
117 snprintf(body,
sizeof(body),
"%s_psf.000%d", buf1, timestep);
121 outfile1, body, VIS_COMM);
128 for (visual_id = 0; visual_id <
pvr->
num_of_pvr; visual_id++) {
130 fprintf(stderr,
" Start visualize PVR %d at timestep %d\n",
131 visual_id + 1, timestep);
137 if (timestep >= 1000)
138 snprintf(outfile1,
sizeof(outfile1),
"%s_pvr%d.%d", outfile, visual_id + 1, timestep);
139 else if ((timestep >= 100) && (timestep <= 999))
140 snprintf(outfile1,
sizeof(outfile1),
"%s_pvr%d.0%d", outfile, visual_id + 1, timestep);
141 else if ((timestep >= 10) && (timestep <= 99))
142 snprintf(outfile1,
sizeof(outfile1),
"%s_pvr%d.00%d", outfile, visual_id + 1,
144 else if (timestep <= 9)
145 snprintf(outfile1,
sizeof(outfile1),
"%s_pvr%d.000%d", outfile, visual_id + 1,
148 if (timestep >= 1000)
149 snprintf(outfile1,
sizeof(outfile1),
"%s_pvr.%d", outfile, timestep);
150 else if ((timestep >= 100) && (timestep <= 999))
151 snprintf(outfile1,
sizeof(outfile1),
"%s_pvr.0%d", outfile, timestep);
152 else if ((timestep >= 10) && (timestep <= 99))
153 snprintf(outfile1,
sizeof(outfile1),
"%s_pvr.00%d", outfile, timestep);
154 else if (timestep <= 9)
155 snprintf(outfile1,
sizeof(outfile1),
"%s_pvr.000%d", outfile, timestep);
170 char *outfile, *buf1;
176 ret = visualize_render(
mesh,
data, timestep, outfile, buf1);
187 char *outfile_raw, *buf1_raw;
200 ret = visualize_render(
mesh,
data, timestep, outfile, buf1);
int HECMW_Comm_rank(HECMW_Comm comm, int *rank)
HECMW_Comm HECMW_comm_get_comm(void)
int HECMW_Comm_size(HECMW_Comm comm, int *size)
int HECMW_Comm_free(HECMW_Comm *comm)
int HECMW_Comm_dup(HECMW_Comm comm, HECMW_Comm *new_comm)
#define HECMW_FILENAME_LEN
char * HECMW_ctrl_get_result_filebody(char *name_ID)
char * HECMW_ctrl_get_control_file(char *name_ID)
int HECMW_ctrl_is_subdir(void)
char * HECMW_ctrl_get_result_fileheader(char *name_ID, int istep, int *fg_text)
int HECMW_ctrl_make_subdir(char *filename)
struct hecmwST_local_mesh * mesh
#define HECMW_malloc(size)
void HECMW_vis_print_exit(char *var)
void HECMW_vis_memory_exit(char *var)
void HECMW_vis_pvr_rendering(struct hecmwST_local_mesh *mesh, struct hecmwST_result_data *data, int *timestep, int *init_flag, int num_of_pvr, Parameter_vr *vr, int stat_para[NUM_CONTROL_PVR], char *outfile, HECMW_Comm VIS_COMM)
void HECMW_vis_read_control(FILE *fp, int pesize, int mynode, PSF_link *psf, PVR_link *pvr)
void HECMW_vis_psf_rendering(struct hecmwST_local_mesh *mesh, struct hecmwST_result_data *data, int *timestep, struct surface_module *sf, Parameter_rendering *sr, int stat_para[NUM_CONTROL_PSF], char *outfile1, char *body, HECMW_Comm VIS_COMM)
int HECMW_visualize_init_by_comm(HECMW_Comm VIS_COMM)
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)
int HECMW_visualize_by_addfname(struct hecmwST_local_mesh *mesh, struct hecmwST_result_data *data, int timestep, char *addfname)
struct _psf_link_struct * next_psf
int stat_para[NUM_CONTROL_PSF]
struct surface_module * sf
struct _pvr_link_struct * next_pvr
int stat_para[NUM_CONTROL_PVR]