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