FrontISTR  5.2.0
Large-scale structural analysis program with finit element method
hecmw_vis_combine.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_vis_combine.h"
7 
8 #include <stdlib.h>
9 #include <string.h>
10 #include <math.h>
11 #include "hecmw_vis_comm_util.h"
13 #include "hecmw_malloc.h"
14 
15 static void find_minmax_disp(struct surface_module *sf, Result *result,
16  HECMW_Comm VIS_COMM, double disp_min[5],
17  double disp_max[5], int pesize) {
18  int i, j, ii;
19  double l_disp_min[5], l_disp_max[5], tmp;
20 
21  for (i = 0; i < 5; i++) {
22  l_disp_min[i] = 1.0E17;
23  l_disp_max[i] = -1.0E17;
24  }
25  for (ii = 0; ii < sf[0].surface_style; ii++) {
26  for (i = 0; i < result[ii].n_vertex; i++) {
27  for (j = 0; j < 3; j++) {
28  if (l_disp_min[j + 1] > result[ii].disp[i * 3 + j])
29  l_disp_min[j + 1] = result[ii].disp[i * 3 + j];
30  if (l_disp_max[j + 1] < result[ii].disp[i * 3 + j])
31  l_disp_max[j + 1] = result[ii].disp[i * 3 + j];
32  }
33  tmp = sqrt(result[ii].disp[i * 3] * result[ii].disp[i * 3] +
34  result[ii].disp[i * 3 + 1] * result[ii].disp[i * 3 + 1] +
35  result[ii].disp[i * 3 + 2] * result[ii].disp[i * 3 + 2]);
36  if (l_disp_min[0] > tmp) l_disp_min[0] = tmp;
37  if (l_disp_max[0] < tmp) l_disp_max[0] = tmp;
38  if (l_disp_min[4] > result[ii].color[i])
39  l_disp_min[4] = result[ii].color[i];
40  if (l_disp_max[4] < result[ii].color[i])
41  l_disp_max[4] = result[ii].color[i];
42  }
43  }
44  if (pesize > 1) {
45  HECMW_Allreduce(l_disp_min, disp_min, 5, HECMW_DOUBLE, HECMW_MIN, VIS_COMM);
46  HECMW_Allreduce(l_disp_max, disp_max, 5, HECMW_DOUBLE, HECMW_MAX, VIS_COMM);
47  } else {
48  for (i = 0; i < 5; i++) {
49  disp_min[i] = l_disp_min[i];
50  disp_max[i] = l_disp_max[i];
51  }
52  }
53  return;
54 }
55 
57  struct hecmwST_local_mesh *mesh,
58  struct hecmwST_result_data *data, int tvertex,
59  int tpatch, int *color_list, double *minvalue,
60  double *maxvalue, Result *result, char *outfile,
61  HECMW_Comm VIS_COMM) {
62  int i, j, ii;
63  double color, *mivalue, *mavalue;
64  int mynode, pesize;
65  HECMW_Status stat;
66  double *vcoord, *coord, *vcolor, *ccolor;
67  int s_vertex, s_patch;
68  int *c_colorid, *v_colorid;
69 
70  int *c_style, *vc_style;
71  int *n_vertex, *n_patch;
72  int *plist, *pplist;
73  int nbase, pbase;
74  int n_node, n_element;
75  double r, g, b;
76  FILE *outfp;
77  double rgbrange[3], value;
78  double range[6], minx, miny, minz, maxx, maxy, maxz, tminx, tminy, tminz,
79  tmaxx, tmaxy, tmaxz, trange[6];
80  double *cdisp, *vdisp, *tdisp, *tcolor, disp_min[5], disp_max[5], tmp;
81  int icol, isid, isop, istyp, itopo;
82 
83  HECMW_Comm_size(VIS_COMM, &pesize);
84  HECMW_Comm_rank(VIS_COMM, &mynode);
85  find_patch_minmax_sf(result, sf, range);
86  for (i = 0; i < 6; i++) trange[i] = 0.0;
87  minx = range[0];
88  maxx = range[1];
89  miny = range[2];
90  maxy = range[3];
91  minz = range[4];
92  maxz = range[5];
93  HECMW_Barrier(VIS_COMM);
94  if (pesize > 1) {
95  HECMW_Allreduce(&minx, &tminx, 1, HECMW_DOUBLE, HECMW_MIN, VIS_COMM);
96 
97  HECMW_Allreduce(&maxx, &tmaxx, 1, HECMW_DOUBLE, HECMW_MAX, VIS_COMM);
98  HECMW_Allreduce(&miny, &tminy, 1, HECMW_DOUBLE, HECMW_MIN, VIS_COMM);
99  HECMW_Allreduce(&maxy, &tmaxy, 1, HECMW_DOUBLE, HECMW_MAX, VIS_COMM);
100  HECMW_Allreduce(&minz, &tminz, 1, HECMW_DOUBLE, HECMW_MIN, VIS_COMM);
101  HECMW_Allreduce(&maxz, &tmaxz, 1, HECMW_DOUBLE, HECMW_MAX, VIS_COMM);
102  } else {
103  tminx = minx;
104  tmaxx = maxx;
105  tminy = miny;
106  tmaxy = maxy;
107  tminz = minz;
108  tmaxz = maxz;
109  }
110  rgbrange[0] = rgbrange[1] = rgbrange[2] = 1.0;
111  mivalue = (double *)HECMW_calloc(data->nn_component, sizeof(double));
112  mavalue = (double *)HECMW_calloc(data->nn_component, sizeof(double));
113  if ((mivalue == NULL) || (mavalue == NULL))
114  HECMW_vis_memory_exit("mivalue, mavalue");
115  if (pesize > 1) {
116  HECMW_Allreduce(minvalue, mivalue, data->nn_component, HECMW_DOUBLE,
117  HECMW_MIN, VIS_COMM);
118  HECMW_Allreduce(maxvalue, mavalue, data->nn_component, HECMW_DOUBLE,
119  HECMW_MAX, VIS_COMM);
120  } else {
121  for (i = 0; i < data->nn_component; i++) {
122  mivalue[i] = minvalue[i];
123  mavalue[i] = maxvalue[i];
124  }
125  }
126 
127  if (mynode != MASTER_PE) {
128  HECMW_Send(&tvertex, 1, HECMW_INT, MASTER_PE, 0, VIS_COMM);
129  HECMW_Send(&tpatch, 1, HECMW_INT, MASTER_PE, 0, VIS_COMM);
130  }
131  if (mynode == MASTER_PE) {
132  n_vertex = (int *)HECMW_calloc(pesize, sizeof(int));
133  n_patch = (int *)HECMW_calloc(pesize, sizeof(int));
134 
135  n_vertex[MASTER_PE] = tvertex;
136  n_patch[MASTER_PE] = tpatch;
137  for (i = 1; i < pesize; i++) {
138  HECMW_Recv(&tvertex, 1, HECMW_INT, i, HECMW_ANY_TAG, VIS_COMM, &stat);
139  n_vertex[i] = tvertex;
140 
141  HECMW_Recv(&tpatch, 1, HECMW_INT, i, HECMW_ANY_TAG, VIS_COMM, &stat);
142  n_patch[i] = tpatch;
143  }
144  n_node = 0;
145  n_element = 0;
146  for (i = 0; i < pesize; i++) {
147  n_node += n_vertex[i];
148  n_element += n_patch[i];
149  }
150  for (i = 0; i < data->nn_component; i++) {
151  if (color_list[i] == 1) {
152  fprintf(stderr,
153  "for the color component %s ,the current minimum color=%e "
154  "maximum color=%e\n",
155  data->node_label[i], mivalue[i], mavalue[i]);
156  /* fprintf(stderr, "Please input the mincolor and maxcolor you would
157 like:\n");
158 scanf("%lf %lf",&mivalue[i], &mavalue[i]);
159  */
160  }
161  }
162 
163  if (sf[1].output_type == 1)
164  strcat(outfile, ".inp");
165  else if (sf[1].output_type == 2)
166  strcat(outfile, ".fec");
167  else if (sf[1].output_type == 4)
168  strcat(outfile, ".neu");
169 
170  outfp = fopen(outfile, "w");
171 
172  if (!outfp)
173  HECMW_vis_print_exit("ERROR: HEC-MW-VIS-E0009: Cannot open output file");
174 
175  if (n_node == 0) {
176  fprintf(stderr, "There is no cross-section.\n");
177  return;
178  }
179 
180  if (sf[1].output_type == 1) {
181  if (sf[1].deform_display_on == 0)
182  fprintf(outfp, "%d %d 1 0 0\n", n_node, n_element);
183  else
184  fprintf(outfp, "%d %d 2 0 0\n", n_node, n_element);
185 
186  } else if (sf[1].output_type == 2)
187  fprintf(outfp, "%d %d %d\n", n_node, n_element, 0);
188  else if (sf[1].output_type == 4) {
189  put_neutral_head(outfp);
190  /* start writing material data */
191  /* put_neutral_601(outfp, mesh); */
192  put_neutral_402(outfp, mesh);
193  fprintf(outfp, " -1\n");
194  fprintf(outfp, " 403\n");
195  }
196  }
197 
198  if (mynode != 0) {
199  if (tvertex > 0) {
200  vcoord = (double *)HECMW_calloc(tvertex * 3, sizeof(double));
201  if (vcoord == NULL) HECMW_vis_memory_exit("vcoord");
202 
203  s_vertex = 0;
204  for (ii = 0; ii < sf[0].surface_style; ii++) {
205  if (result[ii].n_vertex > 0) {
206  for (i = 0; i < result[ii].n_vertex; i++) {
207  for (j = 0; j < 3; j++)
208  vcoord[(i + s_vertex) * 3 + j] = result[ii].vertex[i * 3 + j];
209  }
210  s_vertex += result[ii].n_vertex;
211  }
212  }
213  HECMW_Send(vcoord, tvertex * 3, HECMW_DOUBLE, MASTER_PE, 0, VIS_COMM);
214  /*
215 outfp = fopen(outfile2, "w");
216 if(outfp==NULL) {
217 fprintf(stderr, "Couldn't create the tmp files for results: %s---\n", outfile2);
218 exit(0);
219 }
220 for(i=0;i<tvertex;i++)
221 fprintf(outfp, "%lf %lf %lf\n", vcoord[i*3], vcoord[i*3+1], vcoord[i*3+2]);
222 fclose(outfp);
223  */
224  }
225  }
226 
227  if (mynode == 0) {
228  if (n_vertex[0] > 0) {
229  vcoord = (double *)HECMW_calloc(n_vertex[0] * 3, sizeof(double));
230  if (vcoord == NULL) HECMW_vis_memory_exit("vcoord");
231  s_vertex = 0;
232  for (ii = 0; ii < sf[0].surface_style; ii++) {
233  if (result[ii].n_vertex > 0) {
234  for (i = 0; i < result[ii].n_vertex; i++) {
235  if (sf[1].output_type == 1)
236  fprintf(outfp, "%d %e %e %e\n", i + s_vertex + 1,
237  result[ii].vertex[i * 3], result[ii].vertex[i * 3 + 1],
238  result[ii].vertex[i * 3 + 2]);
239  else if (sf[1].output_type == 2)
240  fprintf(outfp, "%e %e %e\n", result[ii].vertex[i * 3],
241  result[ii].vertex[i * 3 + 1],
242  result[ii].vertex[i * 3 + 2]);
243  else if (sf[1].output_type == 4)
244  fprintf(outfp, "%d,0,0,1,46,0,0,0,0,0,0,%e,%e,%e,\n",
245  i + s_vertex + 1, result[ii].vertex[i * 3],
246  result[ii].vertex[i * 3 + 1],
247  result[ii].vertex[i * 3 + 2]);
248  for (j = 0; j < 3; j++)
249  vcoord[(i + s_vertex) * 3 + j] = result[ii].vertex[i * 3 + j];
250  }
251  s_vertex += result[ii].n_vertex;
252  }
253  }
254  }
255  for (i = 1; i < pesize; i++) {
256  if (n_vertex[i] > 0) {
257  coord = (double *)HECMW_calloc(n_vertex[i] * 3, sizeof(double));
258  HECMW_Recv(coord, n_vertex[i] * 3, HECMW_DOUBLE, i, HECMW_ANY_TAG,
259  VIS_COMM, &stat);
260  /* sprintf(outfile3, "%s.%d.%d.tmp", outfile1, *timestep, i);
261 tmpfp=fopen(outfile3, "r");
262 if(tmpfp==NULL) {
263 fprintf(stderr, "cannot open the tmpfile %s\n");
264 exit(0);
265 }
266 for(j=0;j<n_vertex[i];j++)
267 fscanf(tmpfp, "%lf %lf %lf", &coord[j*3], &coord[j*3+1],&coord[j*3+2]);
268 fclose(tmpfp);
269  */
270 
271  nbase = 0;
272  for (j = 0; j < i; j++) nbase += n_vertex[j];
273  for (j = 0; j < n_vertex[i]; j++) {
274  if (sf[1].output_type == 1)
275  fprintf(outfp, "%d %e %e %lf\n", nbase + j + 1, coord[j * 3],
276  coord[j * 3 + 1], coord[j * 3 + 2]);
277  else if (sf[1].output_type == 2)
278  fprintf(outfp, "%e %e %e\n", coord[j * 3], coord[j * 3 + 1],
279  coord[j * 3 + 2]);
280  else if (sf[1].output_type == 4)
281  fprintf(outfp, "%d,0,0,1,46,0,0,0,0,0,0,%e,%e,%e,\n", nbase + j + 1,
282  coord[j * 3], coord[j * 3 + 1], coord[j * 3 + 2]);
283  }
284  HECMW_free(coord);
285  }
286  }
287  }
288  /* send patches----- */
289  if (mynode != 0) {
290  if (tpatch > 0) {
291  plist = (int *)HECMW_calloc(tpatch * 3, sizeof(int));
292  if (plist == NULL) HECMW_vis_memory_exit("plist");
293  s_patch = 0;
294  for (ii = 0; ii < sf[0].surface_style; ii++) {
295  if (result[ii].n_patch > 0) {
296  for (i = 0; i < result[ii].n_patch; i++) {
297  for (j = 0; j < 3; j++)
298  plist[(i + s_patch) * 3 + j] = result[ii].patch[i * 3 + j];
299  }
300  s_patch += result[ii].n_patch;
301  }
302  }
303 
304  HECMW_Send(plist, tpatch * 3, HECMW_INT, MASTER_PE, 0, VIS_COMM);
305  }
306  }
307 
308  if (mynode == 0) {
309  if (sf[1].output_type == 4) {
310  fprintf(outfp, " -1\n");
311  fprintf(outfp, " -1\n");
312  fprintf(outfp, " 404\n");
313  isid = mesh->section_ID[0];
314  isop = mesh->section->sect_opt[isid];
315  istyp = 25;
316  if (isop == 1) istyp = 19;
317  if (isop == 2) istyp = 35;
318  itopo = 2;
319  icol = 124;
320  }
321 
322  if (n_patch[0] > 0) {
323  plist = (int *)HECMW_calloc(n_patch[0] * 3, sizeof(int));
324  if (plist == NULL) HECMW_vis_memory_exit("plist");
325  /* for(i=0;i<n_patch[0];i++) {
326 fscanf(pfile, "%d %d %d %d", &id,&v1, &v2, &v3);
327 if(sff->output_type==1)
328 fprintf(FP, "%d 1 tri %d %d %d\n", id,v1, v2, v3);
329 else if(sff->output_type==2)
330 fprintf(FP, "%d %d %d\n", v1, v2, v3);
331 
332 plist[i*3]=v1;
333 plist[i*3+1]=v2;
334 plist[i*3+2]=v3;
335 }
336  */
337  s_patch = 0;
338  for (ii = 0; ii < sf[0].surface_style; ii++) {
339  if (result[ii].n_patch > 0) {
340  for (i = 0; i < result[ii].n_patch; i++) {
341  if (sf[1].output_type == 1)
342  fprintf(outfp, "%d 1 tri %d %d %d\n", i + s_patch + 1,
343  result[ii].patch[i * 3], result[ii].patch[i * 3 + 1],
344  result[ii].patch[i * 3 + 2]);
345  else if (sf[1].output_type == 2)
346  fprintf(outfp, "%d %d %d\n", result[ii].patch[i * 3],
347  result[ii].patch[i * 3 + 1], result[ii].patch[i * 3 + 2]);
348  else if (sf[1].output_type == 4) {
349  fprintf(outfp, "%d, %d,%d,%d,%d,1,0,0,0,0,0,0,0,\n",
350  i + s_patch + 1, icol, isid, istyp, itopo);
351  fprintf(outfp, "%8d, %8d, %8d, 0,0,0,0,0,0,0,\n",
352  result[ii].patch[i * 3], result[ii].patch[i * 3 + 1],
353  result[ii].patch[i * 3 + 2]);
354  fprintf(outfp, "0,0,0,0,0,0,0,0,0,0,\n");
355  fprintf(outfp, "0,0,0,\n");
356  fprintf(outfp, "0,0,0,\n");
357  fprintf(outfp, "0,0,0,\n");
358  fprintf(outfp, "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n");
359  }
360 
361  for (j = 0; j < 3; j++)
362  plist[(i + s_patch) * 3 + j] = result[ii].patch[i * 3 + j];
363  }
364  s_patch += result[ii].n_patch;
365  }
366  }
367  }
368 
369  for (i = 1; i < pesize; i++) {
370  if (n_patch[i] > 0) {
371  pplist = (int *)HECMW_calloc(n_patch[i] * 3, sizeof(int));
372  HECMW_Recv(pplist, n_patch[i] * 3, HECMW_INT, i, HECMW_ANY_TAG,
373  VIS_COMM, &stat);
374  nbase = 0;
375  pbase = 0;
376  for (j = 0; j < i; j++) {
377  nbase += n_vertex[j];
378  pbase += n_patch[j];
379  }
380 
381  for (j = 0; j < n_patch[i]; j++) {
382  if (sf[1].output_type == 1)
383  fprintf(outfp, "%d 1 tri %d %d %d\n", pbase + j + 1,
384  pplist[j * 3] + nbase, pplist[j * 3 + 1] + nbase,
385  pplist[j * 3 + 2] + nbase);
386  else if (sf[1].output_type == 2)
387  fprintf(outfp, "%d %d %d\n", pplist[j * 3] + nbase,
388  pplist[j * 3 + 1] + nbase, pplist[j * 3 + 2] + nbase);
389  else if (sf[1].output_type == 4) {
390  fprintf(outfp, "%d, icol,%d,%d,%d,%d,1,0,0,0,0,0,0,0,\n",
391  pbase + j + 1, icol, isid, istyp, itopo);
392  fprintf(outfp, "%d, %d, %d, 0,0,0,0,0,0,0,0,0,0,0,0,\n",
393  pplist[j * 3] + nbase, pplist[j * 3 + 1] + nbase,
394  pplist[j * 3 + 2] + nbase);
395  fprintf(outfp, "0,0,0,\n");
396  fprintf(outfp, "0,0,0,\n");
397  fprintf(outfp, "0,0,0,\n");
398  fprintf(outfp, "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n");
399  }
400  }
401 
402  HECMW_free(pplist);
403  }
404  }
405  }
406 
407  if (mynode == 0) {
408  if (sf[1].output_type == 4) {
409  put_neutral_middle(outfp);
410  }
411  }
412 
413  if (mynode != 0) {
414  if (tvertex > 0) {
415  vcolor = (double *)HECMW_calloc(tvertex, sizeof(double));
416  if (sf[1].deform_display_on == 1)
417  vdisp = (double *)HECMW_calloc(tvertex * 3, sizeof(double));
418 
419  c_style = (int *)HECMW_calloc(tvertex, sizeof(int));
420  c_colorid = (int *)HECMW_calloc(tvertex, sizeof(int));
421  if ((vcolor == NULL) || (c_style == NULL) || (c_colorid == NULL))
422  HECMW_vis_memory_exit("vcolor, c_style and c_colorid");
423  s_vertex = 0;
424  for (ii = 0; ii < sf[0].surface_style; ii++) {
425  if (result[ii].n_vertex > 0) {
426  for (i = 0; i < result[ii].n_vertex; i++) {
427  vcolor[i + s_vertex] = result[ii].color[i];
428  if (sf[ii + 1].deform_display_on == 1) {
429  vdisp[(i + s_vertex) * 3] = result[ii].disp[i * 3];
430  vdisp[(i + s_vertex) * 3 + 1] = result[ii].disp[i * 3 + 1];
431  vdisp[(i + s_vertex) * 3 + 2] = result[ii].disp[i * 3 + 2];
432  }
433  c_style[i + s_vertex] = sf[ii + 1].display_method;
434  c_colorid[i + s_vertex] = sf[ii + 1].color_comp;
435  }
436  s_vertex += result[ii].n_vertex;
437  }
438  }
439  HECMW_Send(vcolor, tvertex, HECMW_DOUBLE, MASTER_PE, 0, VIS_COMM);
440  HECMW_Send(c_style, tvertex, HECMW_INT, MASTER_PE, 0, VIS_COMM);
441  HECMW_Send(c_colorid, tvertex, HECMW_INT, MASTER_PE, 0, VIS_COMM);
442  if (sf[1].deform_display_on == 1)
443  HECMW_Send(vdisp, tvertex * 3, HECMW_DOUBLE, MASTER_PE, 0, VIS_COMM);
444  }
445 
446  if (tvertex > 0) {
447  HECMW_free(vcoord);
448  HECMW_free(vcolor);
449  HECMW_free(c_style);
450  HECMW_free(c_colorid);
451  if (sf[1].deform_display_on == 1) HECMW_free(vdisp);
452  }
453  if (tpatch > 0) HECMW_free(plist);
454  }
455  if (mynode == 0) {
456  if (sf[1].output_type == 1) {
457  if (sf[1].deform_display_on == 0) {
458  fprintf(outfp, "1 1\n");
459  fprintf(outfp, "data, unit_unknown\n");
460  } else {
461  fprintf(outfp, "2 1 3\n");
462  fprintf(outfp, "data, unit_unknown\n");
463  fprintf(outfp, "disp, unit_unknown\n");
464  }
465  }
466  if (sf[1].output_type == 4) {
467 #ifdef old_version
468  fprintf(outfp, " -1\n");
469  fprintf(outfp, " -1\n");
470  fprintf(outfp, " 409\n");
471  fprintf(outfp, "1\n");
472  fprintf(outfp, "Default XY View\n");
473  fprintf(outfp, "2,0,1,\n");
474  fprintf(outfp, "35.2644,-45.,0.,\n");
475  fprintf(outfp, "%e, %e, %e,\n", (tminx + tmaxx) / 2.0,
476  (tminy + tmaxy) / 2.0, (tminz + tmaxz) / 2.0);
477  fprintf(outfp, "0.90909,1.,0,%e,%e,%e,0.,0.,0.,\n", (tminx + tmaxx) / 2.0,
478  (tminy + tmaxy) / 2.0, (tminz + tmaxz) / 2.0);
479  fprintf(outfp, "%e,%e,%e,\n", (tminx + tmaxx) / 2.0,
480  (tminy + tmaxy) / 2.0, (tminz + tmaxz) / 2.0);
481  fprintf(outfp, "1.,\n");
482  fprintf(outfp, "0.,0.,1.,1.,\n");
483  fprintf(outfp, "2,0,1,1,1,\n");
484  fprintf(outfp, "0,0,0,1,0,0,2,1,0,4000000,\n");
485  fprintf(outfp, "9,\n");
486  fprintf(outfp, "0,0,0,\n");
487  fprintf(outfp, "0,0,0,\n");
488  fprintf(outfp, "0,0,0,\n");
489  fprintf(outfp, "0,0,0,\n");
490  fprintf(outfp, "0,0,0,\n");
491  fprintf(outfp, "0,0,0,\n");
492  fprintf(outfp, "0,0,0,\n");
493  fprintf(outfp, "0,0,0,\n");
494  fprintf(outfp, "0,0,0,\n");
495  fprintf(outfp, "100.,100.,1,7,\n");
496  fprintf(outfp, "0,1,1.,\n");
497  fprintf(outfp, "0.,0.,0.,\n");
498  fprintf(outfp, "0.,0.,1.,\n"); /* sec_nor*/
499  fprintf(outfp, "2.,1.,70.,0.5,\n");
500  fprintf(outfp, "0.,25.,0.,0.,0.,1,100.,1000.,0.,0.,0.,\n");
501  fprintf(outfp, "5.,90.,10.,10.,1.,\n");
502  fprintf(outfp, "4,276,0,0,0,0,0,0,0,0,0.,0.,1.,\n");
503  fprintf(outfp, "0,0,0,0,0,0,14,110,\n");
504  fprintf(outfp, "0,1,1,1,0,1,0,1,1,0,1,1,0,1,1,1,0,0,1,\n");
505  fprintf(outfp, "0,0,0.00000001,25.,100.,0.,0.,0.,20,\n");
506  fprintf(outfp, "0,1,1,0,0,1,20.,0,\n");
507  fprintf(outfp, "12,\n"); /*max_lev*/
508  fprintf(outfp, "0,0.,\n");
509  fprintf(outfp, "0,0.,\n");
510  fprintf(outfp, "0,0.,\n");
511  fprintf(outfp, "0,0.,\n");
512  fprintf(outfp, "0,0.,\n");
513  fprintf(outfp, "0,0.,\n");
514  fprintf(outfp, "0,0.,\n");
515  fprintf(outfp, "0,0.,\n");
516  fprintf(outfp, "0,0.,\n");
517  fprintf(outfp, "0,0.,\n");
518  fprintf(outfp, "0,0.,\n");
519  fprintf(outfp, "0,0.,\n");
520  fprintf(outfp, "0,5,0,0,0,0.,25.,\n");
521  fprintf(outfp, "4,16408,20,16504,100,16488,\n");
522  fprintf(outfp, "0.,0.,\n");
523  fprintf(outfp, "0.,0.,0.,0.,\n");
524  fprintf(outfp, "9,\n"); /*max_xy*/
525  fprintf(outfp, "1.,\n");
526  fprintf(outfp, "1.,\n");
527  fprintf(outfp, "1.,\n");
528  fprintf(outfp, "1.,\n");
529  fprintf(outfp, "1.,\n");
530  fprintf(outfp, "1.,\n");
531  fprintf(outfp, "1.,\n");
532  fprintf(outfp, "1.,\n");
533  fprintf(outfp, "1.,\n");
534  fprintf(outfp, "2,\n"); /*max_xyt*/
535  fprintf(outfp, "<NULL>\n");
536  fprintf(outfp, "<NULL>\n");
537  fprintf(outfp, "0,0,0,0,\n");
538  fprintf(outfp, "0.,0.,0.,0.,\n");
539  fprintf(outfp, "0.,0.,0.,0.,\n");
540  fprintf(outfp, "90,\n");
541  fprintf(outfp, "1,124,1,0,\n");
542  fprintf(outfp, "0,60,1,1,\n");
543  fprintf(outfp, "0,24,0,0,\n");
544  fprintf(outfp, "0,120,1,0,\n");
545  fprintf(outfp, "0,60,0,1,\n");
546  fprintf(outfp, "0,24642,0,1,\n");
547  fprintf(outfp, "0,124,0,1,\n");
548  fprintf(outfp, "0,46,0,1,\n");
549  fprintf(outfp, "0,120,1,1,\n");
550  fprintf(outfp, "0,124,0,1,\n");
551  fprintf(outfp, "0,124,0,0,\n");
552  fprintf(outfp, "1,14,0,1,\n");
553  fprintf(outfp, "0,62,0,0,\n");
554  fprintf(outfp, "0,62,0,0,\n");
555  fprintf(outfp, "0,10,1,1,\n");
556  fprintf(outfp, "0,52,1,1,\n");
557  fprintf(outfp, "0,4,1,1,\n");
558  fprintf(outfp, "0,120,1,1,\n");
559  fprintf(outfp, "0,12,1,1,\n");
560  fprintf(outfp, "0,2,1,1,\n");
561  fprintf(outfp, "0,120,1,1,\n");
562  fprintf(outfp, "0,8312,1,1,\n");
563  fprintf(outfp, "0,24600,0,0,\n");
564  fprintf(outfp, "0,0,0,0,\n");
565  fprintf(outfp, "1,123,0,1,\n");
566  fprintf(outfp, "0,0,0,0,\n");
567  fprintf(outfp, "2,124,0,1,\n");
568  fprintf(outfp, "0,24636,0,0,\n");
569  fprintf(outfp, "0,124,0,0,\n");
570  fprintf(outfp, "0,4,0,0,\n");
571  fprintf(outfp, "0,100,0,0,\n");
572  fprintf(outfp, "0,124,0,0,\n");
573  fprintf(outfp, "0,60,0,0,\n");
574  fprintf(outfp, "0,56,0,0,\n");
575  fprintf(outfp, "0,24,0,0,\n");
576  fprintf(outfp, "0,8216,0,1,\n");
577  fprintf(outfp, "0,4,0,0,\n");
578  fprintf(outfp, "0,124,2,0,\n");
579  fprintf(outfp, "0,0,1,1,\n");
580  fprintf(outfp, "0,0,0,1,\n");
581  fprintf(outfp, "1,124,5,1,\n");
582  fprintf(outfp, "0,0,0,1,\n");
583  fprintf(outfp, "0,24,0,1,\n");
584  fprintf(outfp, "0,124,0,0,\n");
585  fprintf(outfp, "0,100,0,1,\n");
586  fprintf(outfp, "1,100,0,1,\n");
587  fprintf(outfp, "0,0,0,1,\n");
588  fprintf(outfp, "0,16,0,0,\n");
589  fprintf(outfp, "0,124,4,1,\n");
590  fprintf(outfp, "0,62,0,0,\n");
591  fprintf(outfp, "2,124,1,1,\n");
592  fprintf(outfp, "1,8254,0,0,\n");
593  fprintf(outfp, "0,124,1,1,\n");
594  fprintf(outfp, "1,0,5,1,\n");
595  fprintf(outfp, "0,124,0,1,\n");
596  fprintf(outfp, "0,100,0,1,\n");
597  fprintf(outfp, "0,100,0,1,\n");
598  fprintf(outfp, "1,46,0,1,\n");
599  fprintf(outfp, "1,120,0,1,\n");
600  fprintf(outfp, "1,4,0,1,\n");
601  fprintf(outfp, "1,52,0,1,\n");
602  fprintf(outfp, "1,24,0,1,\n");
603  fprintf(outfp, "1,93,0,1,\n");
604  fprintf(outfp, "1,12,0,1,\n");
605  fprintf(outfp, "1,10,0,1,\n");
606  fprintf(outfp, "1,104,0,1,\n");
607  fprintf(outfp, "0,100,1,1,\n");
608  fprintf(outfp, "0,24,1,1,\n");
609  fprintf(outfp, "0,60,1,1,\n");
610  fprintf(outfp, "0,104,1,1,\n");
611  fprintf(outfp, "0,0,0,0,\n");
612  fprintf(outfp, "0,90,1,1,\n");
613  fprintf(outfp, "0,14,1,1,\n");
614  fprintf(outfp, "0,8261,1,1,\n");
615  fprintf(outfp, "0,19,0,0,\n");
616  fprintf(outfp, "1,24,1,1,\n");
617  fprintf(outfp, "0,4,0,0,\n");
618  fprintf(outfp, "0,0,1,0,\n");
619  fprintf(outfp, "0,0,0,0,\n");
620  fprintf(outfp, "0,8201,0,1,\n");
621  fprintf(outfp, "0,0,0,0,\n");
622  fprintf(outfp, "0,0,1,1,\n");
623  fprintf(outfp, "0,0,1,1,\n");
624  fprintf(outfp, "0,0,1,1,\n");
625  fprintf(outfp, "0,0,1,1,\n");
626  fprintf(outfp, "0,0,1,1,\n");
627  fprintf(outfp, "0,0,1,1,\n");
628  fprintf(outfp, "0,0,1,1,\n");
629  fprintf(outfp, "0,0,1,1,\n");
630  fprintf(outfp, "0,0,1,1,\n");
631  fprintf(outfp, "-1,\n");
632  fprintf(outfp, " -1\n");
633 #endif
634  }
635  if (n_vertex[0] > 0) {
636  if ((sf[1].output_type == 4) && (sf[1].deform_display_on == 1)) {
637  fprintf(outfp, " -1\n");
638  fprintf(outfp, " 451\n");
639  /* first find maximum data value */
640  find_minmax_disp(sf, result, VIS_COMM, disp_min, disp_max, pesize);
641  tcolor = (double *)HECMW_calloc(n_node, sizeof(double));
642  tdisp = (double *)HECMW_calloc(n_node * 4, sizeof(double));
643  }
644  if ((sf[1].output_type == 4) && (sf[1].deform_display_on != 1)) {
645  fprintf(outfp, " -1\n");
646  fprintf(outfp, " 451\n");
647  fprintf(outfp, "1,1,1,\n");
648  fprintf(outfp, "%s\n", sf[ii].color_comp_name);
649  tmp = fabs(mavalue[sf[1].color_comp]);
650  if (fabs(mivalue[sf[1].color_comp]) > tmp)
651  tmp = fabs(mivalue[sf[1].color_comp]);
652  fprintf(outfp, "%e %e %e,\n", mivalue[sf[1].color_comp],
653  mavalue[sf[1].color_comp], tmp);
654  fprintf(outfp, "1,0,0,0,0,0,0,0,0,0,\n");
655  fprintf(outfp, "0,0,0,0,0,0,0,0,0,0,\n");
656  fprintf(outfp, "0,0,1,7,\n");
657  fprintf(outfp, "1,1,1,\n");
658  }
659  vcolor = (double *)HECMW_calloc(n_vertex[0], sizeof(double));
660  c_style = (int *)HECMW_calloc(n_vertex[0], sizeof(int));
661  c_colorid = (int *)HECMW_calloc(n_vertex[0], sizeof(int));
662  if (sf[1].deform_display_on == 1)
663  vdisp = (double *)HECMW_calloc(n_vertex[0] * 3, sizeof(double));
664 
665  /* for(i=0;i<n_vertex[0];i++) {
666 fscanf(cfile, "%d %lf %d %d ", &id,&value, &cstyle, &colorid);
667  */
668  s_vertex = 0;
669  for (ii = 0; ii < sf[0].surface_style; ii++) {
670  if (result[ii].n_vertex > 0) {
671  for (i = 0; i < result[ii].n_vertex; i++) {
672  vcolor[i + s_vertex] = result[ii].color[i];
673  c_style[i + s_vertex] = sf[ii + 1].display_method;
674  c_colorid[i + s_vertex] = sf[ii + 1].color_comp;
675  if (sf[ii + 1].deform_display_on == 1) {
676  vdisp[(i + s_vertex) * 3] = result[ii].disp[i];
677  vdisp[(i + s_vertex) * 3 + 1] = result[ii].disp[i * 3 + 1];
678  vdisp[(i + s_vertex) * 3 + 2] = result[ii].disp[i * 3 + 2];
679  }
680 
681  if (sf[ii + 1].display_method != 4) {
682  if (sf[1].normalize_flag == 1) {
683  color = (result[ii].color[i] - mivalue[sf[ii + 1].color_comp]) /
684  (mavalue[sf[ii + 1].color_comp] -
685  mivalue[sf[ii + 1].color_comp]);
686  if (color < 0.0) color = 0.0;
687  if (color > 1.0) color = 1.0;
688  } else {
689  color = result[ii].color[i];
690  if (color < mivalue[sf[ii + 1].color_comp])
691  color = mivalue[sf[ii + 1].color_comp];
692  if (color > mavalue[sf[ii + 1].color_comp])
693  color = mavalue[sf[ii + 1].color_comp];
694  }
695  } else if (sf[ii + 1].display_method == 4)
696  color = result[ii].color[i];
697  if (sf[1].output_type == 1) {
698  if (sf[ii + 1].deform_display_on == 0)
699  fprintf(outfp, "%d %e\n", i + s_vertex + 1, color);
700  else if (sf[ii + 1].deform_display_on == 1)
701  fprintf(outfp, "%d %e %e %e %e\n", i + s_vertex + 1, color,
702  result[ii].disp[i * 3], result[ii].disp[i * 3 + 1],
703  result[ii].disp[i * 3 + 2]);
704 
705  } else if (sf[ii + 1].output_type == 4) {
706  if (sf[ii + 1].deform_display_on == 0)
707  fprintf(outfp, "%d, %e,\n", i + s_vertex + 1,
708  result[ii].color[i]);
709  else if (sf[ii + 1].deform_display_on == 1) {
710  tcolor[i + s_vertex] = result[ii].color[i];
711  tdisp[(i + s_vertex) * 4 + 1] = result[ii].disp[i * 3];
712  tdisp[(i + s_vertex) * 4 + 2] = result[ii].disp[i * 3 + 1];
713  tdisp[(i + s_vertex) * 4 + 3] = result[ii].disp[i * 3 + 2];
714  tdisp[(i + s_vertex) * 4] =
715  sqrt(tdisp[(i + s_vertex) * 4 + 1] *
716  tdisp[(i + s_vertex) * 4 + 1] +
717  tdisp[(i + s_vertex) * 4 + 2] *
718  tdisp[(i + s_vertex) * 4 + 2] +
719  tdisp[(i + s_vertex) * 4 + 3] *
720  tdisp[(i + s_vertex) * 4 + 3]);
721  }
722  } else if (sf[1].output_type == 2) {
723  if (color <= 0.25 * rgbrange[0]) {
724  r = g = 0.0;
725  b = (0.5 * rgbrange[0] - color) * 2 / rgbrange[0];
726  } else if ((color > 0.25 * rgbrange[0]) &&
727  (color <= 0.5 * rgbrange[0])) {
728  r = 0.0;
729  g = (color - 0.25 * rgbrange[0]) * 2 / rgbrange[0];
730  b = (0.5 * rgbrange[0] - color) * 2 / rgbrange[0];
731  } else if ((color > 0.5 * rgbrange[0]) &&
732  (color <
733  ((1 - rgbrange[0] * 0.5) / 2 + 0.5 * rgbrange[0]))) {
734  r = (color - 0.5 * rgbrange[0]) /
735  ((1 - rgbrange[0] * 0.5) / 2) * 0.5;
736  g = (((1 - rgbrange[0] * 0.5) / 2 + 0.5 * rgbrange[0]) -
737  color) /
738  ((1 - rgbrange[0] * 0.5) / 2) * 0.5;
739  b = 0.0;
740  } else if (color >=
741  ((1 - rgbrange[0] * 0.5) / 2 + 0.5 * rgbrange[0])) {
742  r = (color - 0.5 * rgbrange[0]) /
743  ((1 - rgbrange[0] * 0.5) / 2) * 0.5;
744  g = b = 0.0;
745  }
746 
747  /* fprintf(FP, "%d %lf\n",i+1, color);
748  */ fprintf(
749  outfp, "%e %e %e\n", r, g, b);
750  }
751  }
752  s_vertex += result[ii].n_vertex;
753  }
754  }
755  }
756  for (i = 1; i < pesize; i++) {
757  if (n_vertex[i] > 0) {
758  ccolor = (double *)HECMW_calloc(n_vertex[i], sizeof(double));
759  vc_style = (int *)HECMW_calloc(n_vertex[i], sizeof(int));
760  v_colorid = (int *)HECMW_calloc(n_vertex[i], sizeof(int));
761  if (sf[1].deform_display_on == 1)
762  cdisp = (double *)HECMW_calloc(n_vertex[i] * 3, sizeof(double));
763 
764  HECMW_Recv(ccolor, n_vertex[i], HECMW_DOUBLE, i, HECMW_ANY_TAG,
765  VIS_COMM, &stat);
766  HECMW_Recv(vc_style, n_vertex[i], HECMW_INT, i, HECMW_ANY_TAG, VIS_COMM,
767  &stat);
768  HECMW_Recv(v_colorid, n_vertex[i], HECMW_INT, i, HECMW_ANY_TAG,
769  VIS_COMM, &stat);
770  if (sf[1].deform_display_on == 1)
771  HECMW_Recv(cdisp, n_vertex[i] * 3, HECMW_DOUBLE, i, HECMW_ANY_TAG,
772  VIS_COMM, &stat);
773 
774  nbase = 0;
775  for (j = 0; j < i; j++) nbase += n_vertex[j];
776  for (j = 0; j < n_vertex[i]; j++) {
777  value = ccolor[j];
778  if (vc_style[j] != 4) {
779  if (sf[1].output_type == 2) {
780  color = (value - mivalue[v_colorid[j]]) /
781  (mavalue[v_colorid[j]] - mivalue[v_colorid[j]]);
782  if (color > 1.0) color = 1.0;
783  if (color < 0.0) color = 0.0;
784  }
785  if ((sf[1].output_type == 1) || (sf[1].output_type == 4)) {
786  color = value;
787  if (color < mivalue[v_colorid[j]]) color = mivalue[v_colorid[j]];
788  if (color > mavalue[v_colorid[j]]) color = mavalue[v_colorid[j]];
789  if (sf[1].normalize_flag == 1)
790  color = (color - mivalue[v_colorid[j]]) /
791  (mavalue[v_colorid[j]] - mivalue[v_colorid[j]]);
792  }
793  } else if (vc_style[j] == 4)
794  color = value;
795  /* if(color>1.0) color=1.0;
796 if(color<0.0) color=0.0;
797  */
798 
799  if (sf[1].output_type == 2) {
800  if (color <= 0.25 * rgbrange[0]) {
801  r = g = 0.0;
802  b = (0.5 * rgbrange[0] - color) * 2 / rgbrange[0];
803  } else if ((color > 0.25 * rgbrange[0]) &&
804  (color <= 0.5 * rgbrange[0])) {
805  r = 0.0;
806  g = (color - 0.25 * rgbrange[0]) * 2 / rgbrange[0];
807  b = (0.5 * rgbrange[0] - color) * 2 / rgbrange[0];
808  } else if ((color > 0.5 * rgbrange[0]) &&
809  (color <
810  ((1 - rgbrange[0] * 0.5) / 2 + 0.5 * rgbrange[0]))) {
811  r = (color - 0.5 * rgbrange[0]) / ((1 - rgbrange[0] * 0.5) / 2) *
812  0.5;
813  g = (((1 - rgbrange[0] * 0.5) / 2 + 0.5 * rgbrange[0]) - color) /
814  ((1 - rgbrange[0] * 0.5) / 2) * 0.5;
815  b = 0.0;
816  } else if (color >=
817  ((1 - rgbrange[0] * 0.5) / 2 + 0.5 * rgbrange[0])) {
818  r = (color - 0.5 * rgbrange[0]) / ((1 - rgbrange[0] * 0.5) / 2) *
819  0.5;
820  g = b = 0.0;
821  }
822  }
823  if (sf[1].output_type == 1) {
824  if (sf[1].deform_display_on == 0)
825  fprintf(outfp, "%d %e\n", nbase + j + 1, color);
826  else
827  fprintf(outfp, "%d %e %e %e %e\n", nbase + j + 1, color,
828  cdisp[j * 3], cdisp[j * 3 + 1], cdisp[j * 3 + 2]);
829  } else if (sf[1].output_type == 4) {
830  if (sf[1].deform_display_on == 0)
831  fprintf(outfp, "%d, %e,\n", nbase + j + 1, color);
832  else if (sf[1].deform_display_on == 1) {
833  tcolor[nbase + j] = ccolor[j];
834  tdisp[(nbase + j) * 4 + 1] = cdisp[j * 3];
835  tdisp[(nbase + j) * 4 + 2] = cdisp[j * 3 + 1];
836  tdisp[(nbase + j) * 4 + 3] = cdisp[j * 3 + 2];
837  tdisp[(nbase + j) * 4] =
838  sqrt(cdisp[j * 3] * cdisp[j * 3] +
839  cdisp[j * 3 + 1] * cdisp[j * 3 + 1] +
840  cdisp[j * 3 + 2] * cdisp[j * 3 + 2]);
841  }
842  } else if (sf[1].output_type == 2)
843  fprintf(outfp, "%e %e %e\n", r, g, b);
844  }
845  HECMW_free(ccolor);
846  HECMW_free(vc_style);
847  HECMW_free(v_colorid);
848  if (sf[1].deform_display_on == 1) HECMW_free(cdisp);
849  }
850  }
851 
852  if (n_vertex[0] > 0) {
853  HECMW_free(vcoord);
854 
855  HECMW_free(vcolor);
856  HECMW_free(c_style);
857  HECMW_free(c_colorid);
858  if (sf[1].deform_display_on == 1) HECMW_free(vdisp);
859  }
860  if (n_patch[0] > 0) HECMW_free(plist);
861  }
862  if (mynode == 0) {
863  if ((sf[1].output_type == 4) && (sf[1].deform_display_on == 0))
864  fprintf(outfp, " -1\n");
865  else if ((sf[1].output_type == 4) && (sf[1].deform_display_on == 1)) {
866  for (j = 0; j < 5; j++) {
867  }
868  }
869  }
870  if (mynode == 0) fclose(outfp);
871  return;
872 }
873 
874 void put_neutral_head(FILE *outfp) {
875  fprintf(outfp, " -1\n");
876  fprintf(outfp, " 100\n");
877  fprintf(outfp, "<NULL>\n");
878  fprintf(outfp, "8.2,\n");
879  fprintf(outfp, " -1\n");
880  fprintf(outfp, " -1\n");
881  fprintf(outfp, " 405\n");
882  fprintf(outfp, " -1\n");
883  fprintf(outfp, " -1\n");
884  fprintf(outfp, " 475\n");
885  fprintf(outfp, " -1\n");
886  fprintf(outfp, " -1\n");
887  fprintf(outfp, " 410\n");
888  fprintf(outfp, " -1\n");
889  fprintf(outfp, " -1\n");
890  fprintf(outfp, " 413\n");
891  fprintf(outfp, "1,124,\n");
892  fprintf(outfp, "default layer\n");
893  fprintf(outfp, "9999,124,\n");
894  fprintf(outfp, "<NULL>\n");
895  fprintf(outfp, " -1\n");
896  fprintf(outfp, " -1\n");
897  fprintf(outfp, " 570\n");
898  fprintf(outfp, " -1\n");
899  fprintf(outfp, " -1\n");
900  fprintf(outfp, " 571\n");
901  fprintf(outfp, " -1\n");
902  fprintf(outfp, " -1\n");
903  fprintf(outfp, " 572\n");
904  fprintf(outfp, " -1\n");
905  fprintf(outfp, " -1\n");
906  fprintf(outfp, " 573\n");
907  fprintf(outfp, " -1\n");
908 }
909 
910 void put_neutral_601(FILE *outfp, struct hecmwST_local_mesh *mesh) {
911  int i;
912  int im;
913  double ee, pp, rh0, alfa, gg;
914  double rdum[10];
915 
916  fprintf(outfp, " -1\n");
917  fprintf(outfp, " 601\n");
918  for (im = 0; im < mesh->material->n_mat; im++) {
919  fprintf(outfp, "%6d", im + 1);
920  fprintf(outfp, ",-601,55,0,0,1,0,\n");
921  fprintf(outfp, "<NULL>\n");
922  fprintf(outfp, "10,\n");
923  fprintf(outfp, "0,0,0,0,0,0,0,0,0,0,\n");
924  fprintf(outfp, "25,\n");
925  fprintf(outfp, "0,0,0,0,0,0,0,0,0,0,\n");
926  fprintf(outfp, "0,0,0,0,0,0,0,0,0,0,\n");
927  fprintf(outfp, "0,0,0,0,0,\n");
928  fprintf(outfp, "200,\n");
929  ee = mesh->material->mat_val[im * 4];
930  pp = mesh->material->mat_val[im * 4 + 1];
931  rh0 = mesh->material->mat_val[im * 4 + 2];
932  alfa = mesh->material->mat_val[im * 4 + 3];
933  gg = ee * 0.5 / (1.0 + pp);
934  rdum[0] = ee;
935  rdum[1] = ee;
936  rdum[2] = ee;
937  rdum[3] = rdum[4] = rdum[5] = gg;
938  rdum[6] = rdum[7] = rdum[8] = pp;
939  rdum[9] = 0.0;
940  for (i = 0; i < 10; i++) fprintf(outfp, "%9.2e,", rdum[i]);
941  fprintf(outfp, "\n");
942  fprintf(outfp, "0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,\n");
943  fprintf(outfp, "0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,\n");
944  rdum[0] = 0.0;
945  rdum[1] = 0.0;
946  rdum[2] = 0.0;
947  rdum[3] = rdum[4] = rdum[5] = 0.0;
948  rdum[6] = alfa;
949  rdum[7] = rdum[8] = 0.0;
950  rdum[9] = alfa;
951  for (i = 0; i < 10; i++) fprintf(outfp, "%9.2e,", rdum[i]);
952  fprintf(outfp, "\n");
953  rdum[0] = 0.0;
954  rdum[1] = alfa;
955  rdum[2] = 0.0;
956  rdum[3] = rdum[4] = rdum[5] = 0.0;
957  rdum[6] = 0.0;
958  rdum[7] = rdum[8] = 0.0;
959  rdum[9] = rh0;
960  for (i = 0; i < 10; i++) fprintf(outfp, "%9.2e,", rdum[i]);
961  fprintf(outfp, "\n");
962 
963  fprintf(outfp, "0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,\n");
964  fprintf(outfp, "0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,\n");
965  fprintf(outfp, "0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,\n");
966  fprintf(outfp, "0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,\n");
967  fprintf(outfp, "0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,\n");
968  fprintf(outfp, "0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,\n");
969  fprintf(outfp, "0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,\n");
970  fprintf(outfp, "0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,\n");
971  fprintf(outfp, "0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,\n");
972  fprintf(outfp, "0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,\n");
973  fprintf(outfp, "0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,\n");
974  fprintf(outfp, "0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,\n");
975  fprintf(outfp, "0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,\n");
976  fprintf(outfp, "0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,\n");
977  fprintf(outfp, "0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,\n");
978  fprintf(outfp, "50,\n");
979  fprintf(outfp, "0,0,0,0,0,0,0,0,0,0,\n");
980  fprintf(outfp, "0,0,0,0,0,0,0,0,0,0,\n");
981  fprintf(outfp, "0,0,0,0,0,0,0,0,0,0,\n");
982  fprintf(outfp, "0,0,0,0,0,0,0,0,0,0,\n");
983  fprintf(outfp, "0,0,0,0,0,0,0,0,0,0,\n");
984  fprintf(outfp, "70,\n");
985  fprintf(outfp, "0,0,0,0,0,0,0,0,0,0,\n");
986  fprintf(outfp, "0,0,0,0,0,0,0,0,0,0,\n");
987  fprintf(outfp, "0,0,0,0,0,0,0,0,0,0,\n");
988  fprintf(outfp, "0,0,0,0,0,0,0,0,0,0,\n");
989  fprintf(outfp, "0,0,0,0,0,0,0,0,0,0,\n");
990  fprintf(outfp, "0,0,0,0,0,0,0,0,0,0,\n");
991  fprintf(outfp, "0,0,0,0,0,0,0,0,0,0,\n");
992  }
993  fprintf(outfp, " -1\n");
994  return;
995 }
996 
997 void put_neutral_402(FILE *outfp, struct hecmwST_local_mesh *mesh) {
998  int im, idum[6], i;
999 
1000  fprintf(outfp, " -1\n");
1001  fprintf(outfp, " 402\n");
1002  for (im = 0; im < mesh->section->n_sect; im++) {
1003  idum[0] = im + 1;
1004  idum[1] = 110;
1005  idum[2] = mesh->section->sect_mat_ID_item[im];
1006  if (mesh->section->sect_type[im] == 1)
1007  idum[3] = 25;
1008  else if (mesh->section->sect_type[im] == 2)
1009  idum[3] = 17;
1010  else if (mesh->section->sect_type[im] == 3)
1011  idum[3] = 5;
1012  else if (mesh->section->sect_type[im] == 4)
1013  idum[3] = 9;
1014  idum[4] = 1;
1015  idum[5] = 0;
1016  for (i = 0; i < 6; i++) fprintf(outfp, "%6i,", idum[i]);
1017  fprintf(outfp, "\n");
1018  fprintf(outfp, "<NULL>\n");
1019  fprintf(outfp, "0,0,0,0,\n");
1020  fprintf(outfp, "90,\n");
1021  fprintf(outfp, "0,0,0,0,0,0,0,0,\n");
1022  fprintf(outfp, "0,0,0,0,0,0,0,0,\n");
1023  fprintf(outfp, "0,0,0,0,0,0,0,0,\n");
1024  fprintf(outfp, "0,0,0,0,0,0,0,0,\n");
1025  fprintf(outfp, "0,0,0,0,0,0,0,0,\n");
1026  fprintf(outfp, "0,0,0,0,0,0,0,0,\n");
1027  fprintf(outfp, "0,0,0,0,0,0,0,0,\n");
1028  fprintf(outfp, "0,0,0,0,0,0,0,0,\n");
1029  fprintf(outfp, "0,0,0,0,0,0,0,0,\n");
1030  fprintf(outfp, "0,0,0,0,0,0,0,0,\n");
1031  fprintf(outfp, "0,0,0,0,0,0,0,0,\n");
1032  fprintf(outfp, "0,0,\n");
1033  fprintf(outfp, "190,\n");
1034  for (i = 0; i < 38; i++) fprintf(outfp, "0.,0.,0.,0.,0.,\n");
1035  fprintf(outfp, "0,\n");
1036  fprintf(outfp, "0,\n");
1037  }
1038  fprintf(outfp, " -1\n");
1039 
1040  return;
1041 }
1042 
1043 void put_neutral_middle(FILE *outfp) {
1044  fprintf(outfp, " -1\n");
1045  fprintf(outfp, " 615\n");
1046  fprintf(outfp, " -1\n");
1047  fprintf(outfp, " -1\n");
1048  fprintf(outfp, " 514\n");
1049  fprintf(outfp, " -1\n");
1050  fprintf(outfp, " -1\n");
1051  fprintf(outfp, " 506\n");
1052  fprintf(outfp, " -1\n");
1053  fprintf(outfp, " -1\n");
1054  fprintf(outfp, " 507\n");
1055  fprintf(outfp, " -1\n");
1056  fprintf(outfp, " -1\n");
1057  fprintf(outfp, " 408\n");
1058  fprintf(outfp, " -1\n");
1059 
1060  /* put View : BLOCK NO. = 409 */
1061  /* put_neutral_409(outfp);
1062  */
1063 
1064  fprintf(outfp, " -1\n");
1065  fprintf(outfp, " 411\n");
1066  fprintf(outfp, " -1\n");
1067  fprintf(outfp, " -1\n");
1068  fprintf(outfp, " 420\n");
1069  fprintf(outfp, " -1\n");
1070  fprintf(outfp, " -1\n");
1071  fprintf(outfp, " 822\n");
1072  fprintf(outfp, " -1\n");
1073  fprintf(outfp, " -1\n");
1074  fprintf(outfp, " 412\n");
1075  fprintf(outfp, "1,1,0,0,0,\n");
1076  fprintf(outfp, " -1\n");
1077  fprintf(outfp, " -1\n");
1078  fprintf(outfp, " 450\n");
1079  fprintf(outfp, "1,\n");
1080  fprintf(outfp, "hecmw_FSTR_result\n");
1081  fprintf(outfp, "0,0,\n");
1082  fprintf(outfp, "0.,\n");
1083  fprintf(outfp, "1,\n");
1084  fprintf(outfp, "<NULL>\n");
1085  fprintf(outfp, " -1\n");
1086 }
1087 
1088 void put_neutral_409(FILE *outfp) {
1089  /*
1090 !C==put View : BLOCK NO. = 409 )
1091  */
1092  fprintf(outfp, " -1\n");
1093  fprintf(outfp, " 409\n");
1094  fprintf(outfp, "1,\n");
1095  fprintf(outfp, "Default XY View\n");
1096  fprintf(outfp, "2,0,1,\n");
1097  /* write(INEU,*) '35.2644,-45.,0.,'
1098  */
1099  fprintf(outfp, "0.,0.,0.,\n");
1100  fprintf(outfp, "2.5,1.25,1.5,\n");
1101  fprintf(outfp, "1.,1.,0,0.,0.,0.,0.,0.,0.,\n");
1102  fprintf(outfp, "1.03572,0.51035,0.,\n");
1103  fprintf(outfp, "1.2574,\n");
1104  fprintf(outfp, "0.,0.,1.,1.,\n");
1105  fprintf(outfp, "2,0,1,1,0,\n");
1106  fprintf(outfp, "-1,-1,0,1,0,1,1,60031,0,4000000,\n");
1107  fprintf(outfp, "9,\n");
1108  fprintf(outfp, "0,0,0,\n");
1109  fprintf(outfp, "0,0,0,\n");
1110  fprintf(outfp, "0,0,0,\n");
1111  fprintf(outfp, "0,0,0,\n");
1112  fprintf(outfp, "0,0,0,\n");
1113  fprintf(outfp, "0,0,0,\n");
1114  fprintf(outfp, "0,0,0,\n");
1115  fprintf(outfp, "0,0,0,\n");
1116  fprintf(outfp, "0,0,0,\n");
1117  fprintf(outfp, "100.,100.,1,7,\n");
1118  fprintf(outfp, "0,1,1.,\n");
1119  fprintf(outfp, "0.,0.,0.,\n");
1120  fprintf(outfp, "0.,0.,1.,\n");
1121  fprintf(outfp, "0,1,0,0,\n");
1122  fprintf(outfp, "0.,0.,0.,\n");
1123  fprintf(outfp, "1.,0.,0.,\n");
1124  fprintf(outfp, "0.,0.,0.,\n");
1125  fprintf(outfp, "0.,1.,0.,\n");
1126  fprintf(outfp, "2.,1.,70.,0.5,\n");
1127  fprintf(outfp, "0.,0.,0.,0.,0.,0,100.,1000.,0.,0.,0.,100.,-100.,1,\n");
1128  fprintf(outfp, "5.,90.,10.,10.,1.,\n");
1129  fprintf(outfp, "4,176,0,0,0,0,0,0,0,0,0.,0.,0.,\n");
1130  fprintf(outfp, "0,0,0,0,0,0,14,110,\n");
1131  fprintf(outfp, "0,1,1,1,0,1,0,1,1,0,1,1,0,1,1,1,0,0,1,\n");
1132  fprintf(outfp, "0,0,0.00000001,25.,100.,0.,0.,0.,20,\n");
1133  fprintf(outfp, "0,1,1,0,0,1,20.,0,\n");
1134  fprintf(outfp, "12,\n");
1135  fprintf(outfp, "0,0.,\n");
1136  fprintf(outfp, "0,0.,\n");
1137  fprintf(outfp, "0,0.,\n");
1138  fprintf(outfp, "0,0.,\n");
1139  fprintf(outfp, "0,0.,\n");
1140  fprintf(outfp, "0,0.,\n");
1141  fprintf(outfp, "0,0.,\n");
1142  fprintf(outfp, "0,0.,\n");
1143  fprintf(outfp, "0,0.,\n");
1144  fprintf(outfp, "0,0.,\n");
1145  fprintf(outfp, "0,0.,\n");
1146  fprintf(outfp, "0,0.,\n");
1147  fprintf(outfp, "0,5,0,0,0,0.,25.,\n");
1148  fprintf(outfp, "4,16408,20,16504,100,16488,\n");
1149  fprintf(outfp, "0.,0.,\n");
1150  fprintf(outfp, "0.,0.,0.,0.,\n");
1151  fprintf(outfp, "9,\n");
1152  fprintf(outfp, "1.,\n");
1153  fprintf(outfp, "1.,\n");
1154  fprintf(outfp, "1.,\n");
1155  fprintf(outfp, "1.,\n");
1156  fprintf(outfp, "1.,\n");
1157  fprintf(outfp, "1.,\n");
1158  fprintf(outfp, "1.,\n");
1159  fprintf(outfp, "1.,\n");
1160  fprintf(outfp, "1.,\n");
1161  fprintf(outfp, "2,\n");
1162  fprintf(outfp, "<NULL>\n");
1163  fprintf(outfp, "<NULL>\n");
1164  fprintf(outfp, "0,0,0,0,\n");
1165  fprintf(outfp, "0.,0.,0.,0.,\n");
1166  fprintf(outfp, "0.,0.,0.,0.,\n");
1167  fprintf(outfp, "90,1,124,1,0,\n");
1168  fprintf(outfp, "0,60,0,0,\n");
1169  fprintf(outfp, "0,24,0,0,\n");
1170  fprintf(outfp, "0,100,0,0,\n");
1171  fprintf(outfp, "0,2,0,0,\n");
1172  fprintf(outfp, "0,24580,0,0,\n");
1173  fprintf(outfp, "0,124,0,0,\n");
1174  fprintf(outfp, "0,46,0,0,\n");
1175  fprintf(outfp, "0,120,0,0,\n");
1176  fprintf(outfp, "0,124,0,1,\n");
1177  fprintf(outfp, "0,124,0,0,\n");
1178  fprintf(outfp, "0,12,0,1,\n");
1179  fprintf(outfp, "0,62,0,0,\n");
1180  fprintf(outfp, "0,62,0,0,\n");
1181  fprintf(outfp, "0,10,0,0,\n");
1182  fprintf(outfp, "0,52,0,0,\n");
1183  fprintf(outfp, "0,4,0,0,\n");
1184  fprintf(outfp, "0,120,0,0,\n");
1185  fprintf(outfp, "0,12,0,0,\n");
1186  fprintf(outfp, "0,2,0,0,\n");
1187  fprintf(outfp, "0,120,0,0,\n");
1188  fprintf(outfp, "0,8312,0,0,\n");
1189  fprintf(outfp, "0,24600,0,0,\n");
1190  fprintf(outfp, "0,0,0,0,\n");
1191  fprintf(outfp, "1,74,0,1,\n");
1192  fprintf(outfp, "0,0,0,0,\n");
1193  fprintf(outfp, "3,124,0,1,\n");
1194  fprintf(outfp, "0,24636,0,0,\n");
1195  fprintf(outfp, "0,0,0,0,\n");
1196  fprintf(outfp, "0,4,0,0,\n");
1197  fprintf(outfp, "0,100,0,0,\n");
1198  fprintf(outfp, "0,124,0,1,\n");
1199  fprintf(outfp, "0,60,0,1,\n");
1200  fprintf(outfp, "0,56,0,1,\n");
1201  fprintf(outfp, "0,24,0,0,\n");
1202  fprintf(outfp, "0,8216,0,1,\n");
1203  fprintf(outfp, "0,4,0,0,\n");
1204  fprintf(outfp, "0,124,2,0,\n");
1205  fprintf(outfp, "0,0,1,1,\n");
1206  fprintf(outfp, "0,0,0,1,\n");
1207  fprintf(outfp, "1,124,5,1,\n");
1208  fprintf(outfp, "0,0,0,1,\n");
1209  fprintf(outfp, "0,24,0,1,\n");
1210  fprintf(outfp, "0,124,0,0,\n");
1211  fprintf(outfp, "0,100,0,1,\n");
1212  fprintf(outfp, "1,100,0,1,\n");
1213  fprintf(outfp, "0,0,0,1,\n");
1214  fprintf(outfp, "0,16,0,0,\n");
1215  fprintf(outfp, "0,124,4,1,\n");
1216  fprintf(outfp, "0,62,0,0,\n");
1217  fprintf(outfp, "2,124,1,1,\n");
1218  fprintf(outfp, "1,8254,0,0,\n");
1219  fprintf(outfp, "0,124,1,1,\n");
1220  fprintf(outfp, "1,0,5,1,\n");
1221  fprintf(outfp, "0,124,0,1,\n");
1222  fprintf(outfp, "0,100,0,1,\n");
1223  fprintf(outfp, "0,100,0,1,\n");
1224  fprintf(outfp, "1,46,0,1,\n");
1225  fprintf(outfp, "1,120,0,1,\n");
1226  fprintf(outfp, "1,4,0,1,\n");
1227  fprintf(outfp, "1,52,0,1,\n");
1228  fprintf(outfp, "1,24,0,1,\n");
1229  fprintf(outfp, "1,93,0,1,\n");
1230  fprintf(outfp, "1,12,0,1,\n");
1231  fprintf(outfp, "1,10,0,1,\n");
1232  fprintf(outfp, "1,104,0,1,\n");
1233  fprintf(outfp, "0,100,0,0,\n");
1234  fprintf(outfp, "0,24,0,0,\n");
1235  fprintf(outfp, "0,60,0,0,\n");
1236  fprintf(outfp, "0,104,0,0,\n");
1237  fprintf(outfp, "0,0,0,0,\n");
1238  fprintf(outfp, "0,0,1,1,\n");
1239  fprintf(outfp, "0,0,1,1,\n");
1240  fprintf(outfp, "0,0,1,1,\n");
1241  fprintf(outfp, "0,0,1,1,\n");
1242  fprintf(outfp, "0,0,1,1,\n");
1243  fprintf(outfp, "0,4,0,0,\n");
1244  fprintf(outfp, "0,0,1,0,\n");
1245  fprintf(outfp, "0,0,0,0,\n");
1246  fprintf(outfp, "0,0,1,1,\n");
1247  fprintf(outfp, "0,0,1,1,\n");
1248  fprintf(outfp, "0,0,1,1,\n");
1249  fprintf(outfp, "0,0,1,1,\n");
1250  fprintf(outfp, "0,0,1,1,\n");
1251  fprintf(outfp, "0,0,1,1,\n");
1252  fprintf(outfp, "0,0,1,1,\n");
1253  fprintf(outfp, "0,62,1,1,\n");
1254  fprintf(outfp, "0,60,4,0,\n");
1255  fprintf(outfp, "0,0,1,1,\n");
1256  fprintf(outfp, "0,0,1,1,\n");
1257  fprintf(outfp, "-1,\n");
1258  fprintf(outfp, " -1\n");
1259 
1260  return;
1261 }
int HECMW_Comm_rank(HECMW_Comm comm, int *rank)
Definition: hecmw_comm.c:18
int HECMW_Comm_size(HECMW_Comm comm, int *size)
Definition: hecmw_comm.c:37
int HECMW_Allreduce(void *sendbuf, void *recvbuf, int count, HECMW_Datatype datatype, HECMW_Op op, HECMW_Comm comm)
Definition: hecmw_comm.c:364
int HECMW_Send(void *buffer, int count, HECMW_Datatype datatype, int dest, int tag, HECMW_Comm comm)
Definition: hecmw_comm.c:193
int HECMW_Barrier(HECMW_Comm comm)
Definition: hecmw_comm.c:95
int HECMW_Recv(void *buffer, int count, HECMW_Datatype datatype, int source, int tag, HECMW_Comm comm, HECMW_Status *status)
Definition: hecmw_comm.c:235
#define HECMW_INT
Definition: hecmw_config.h:48
#define HECMW_MAX
Definition: hecmw_config.h:56
MPI_Status HECMW_Status
Definition: hecmw_config.h:36
#define HECMW_DOUBLE
Definition: hecmw_config.h:50
MPI_Comm HECMW_Comm
Definition: hecmw_config.h:30
#define HECMW_MIN
Definition: hecmw_config.h:54
int HECMW_ANY_TAG
struct hecmwST_local_mesh * mesh
Definition: hecmw_repart.h:71
#define NULL
#define HECMW_calloc(nmemb, size)
Definition: hecmw_malloc.h:21
#define HECMW_free(ptr)
Definition: hecmw_malloc.h:24
#define MASTER_PE
Definition: hecmw_repart.h:17
void put_neutral_middle(FILE *outfp)
void put_neutral_409(FILE *outfp)
void put_neutral_402(FILE *outfp, struct hecmwST_local_mesh *mesh)
void put_neutral_head(FILE *outfp)
void HECMW_vis_combine(struct surface_module *sf, struct hecmwST_local_mesh *mesh, struct hecmwST_result_data *data, int tvertex, int tpatch, int *color_list, double *minvalue, double *maxvalue, Result *result, char *outfile, HECMW_Comm VIS_COMM)
void put_neutral_601(FILE *outfp, struct hecmwST_local_mesh *mesh)
void find_patch_minmax_sf(Result *result, struct surface_module *sf, double range[6])
void HECMW_vis_print_exit(char *var)
void HECMW_vis_memory_exit(char *var)
CNFData data
struct hecmwST_section * section
Definition: hecmw_struct.h:244
struct hecmwST_material * material
Definition: hecmw_struct.h:245
double * mat_val
Definition: hecmw_struct.h:44
int * sect_mat_ID_item
Definition: hecmw_struct.h:28