This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Functions | |
void | printfree (FILE *fptr, real2D u, real2D v, real2D ap, interface in, int nx, int ny) |
|
Definition at line 18 of file printfree.c. References BU, BV, fmodmax(), INP, INU, INV, interface::n, real, real2D, SCALE, interface::x, XFIG, XFIG_BLACK, XFIG_BLUE, XFIG_CENTER, XFIG_GREEN, XFIG_MAGENTA, XFIG_RED, XFIG_SOLID, XFIG_TIMES_ROMAN, XfigBox(), XfigCircle(), XfigLine(), XfigPolyLine(), XfigText(), XfigVector(), interface::y, and YFIG.
00022 { 00023 int i, j, *x, *y; 00024 real maxu, maxv; 00025 char s[256]; 00026 int xs = 2, xe = nx - 1, ys = 2, ye = ny - 1; 00027 00028 fprintf(fptr, "#FIG 2.1\n80 1\n"); 00029 for (i = xs; i <= xe; i++) { 00030 XfigLine(fptr, XFIG((real)i), YFIG(ys), XFIG((real)i), YFIG(ye), 00031 XFIG_SOLID, 1, XFIG_BLACK); 00032 sprintf(s, "%d", i); 00033 XfigText(fptr, XFIG((real)i + 0.5), YFIG((real)ys - 0.2), 00034 XFIG_CENTER, XFIG_TIMES_ROMAN, 24, 00035 XFIG_BLACK, 0.0, s); 00036 } 00037 for (j = ys; j <= ye; j++) { 00038 XfigLine(fptr, XFIG(xs), YFIG((real)j), XFIG(xe), YFIG((real)j), 00039 XFIG_SOLID, 1, XFIG_BLACK); 00040 sprintf(s, "%d", j); 00041 XfigText(fptr, XFIG((real)xs - 0.5), YFIG((real)j + 0.75), 00042 XFIG_CENTER, XFIG_TIMES_ROMAN, 24, 00043 XFIG_BLACK, 0.0, s); 00044 } 00045 00046 maxu = fmodmax(u, nx, ny, &i, &j); 00047 maxv = fmodmax(v, nx, ny, &i, &j); 00048 maxu = maxv > maxu ? maxv : maxu; 00049 maxu = maxu == 0.0 ? 1.0 : maxu; 00050 /* 00051 for (i = 2; i < nx; i++) 00052 for (j = 2; j < ny; j++) { */ 00053 for (i = xs; i <= xe; i++) 00054 for (j = ys; j <= ye; j++) { 00055 if (!INU(i,j) && BU(i,j)) 00056 XfigVector(fptr, XFIG((real)i), YFIG(0.5 + (real)j), 00057 SCALE*u[i][j]/maxu, 0.0, 00058 XFIG_SOLID, 1, XFIG_BLUE); 00059 else if (INU(i,j)) 00060 XfigVector(fptr, XFIG((real)i), YFIG(0.5 + (real)j), 00061 SCALE*u[i][j]/maxu, 0.0, 00062 XFIG_SOLID, 1, XFIG_RED); 00063 if (!INV(i,j) && BV(i,j)) 00064 XfigVector(fptr, XFIG(0.5 + (real)i), YFIG((real)j), 00065 0.0, SCALE*v[i][j]/maxu, 00066 XFIG_SOLID, 1, XFIG_GREEN); 00067 else if (INV(i,j)) 00068 XfigVector(fptr, XFIG(0.5 + (real)i), YFIG((real)j), 00069 0.0, SCALE*v[i][j]/maxu, 00070 XFIG_SOLID, 1, XFIG_MAGENTA); 00071 if (INP(i,j)) 00072 XfigBox(fptr, XFIG(0.5 + (real)i) - SCALE/20., 00073 YFIG(0.5 + (real)j) - SCALE/20., 00074 XFIG(0.5 + (real)i) + SCALE/20., 00075 YFIG(0.5 + (real)j) + SCALE/20., 00076 XFIG_SOLID, 2, XFIG_BLACK); 00077 } 00078 00079 x = (int *)malloc(in.n*sizeof(int)); 00080 y = (int *)malloc(in.n*sizeof(int)); 00081 for (i = 0; i < in.n; i++) { 00082 x[i] = XFIG(in.x[i]); 00083 y[i] = YFIG(in.y[i]); 00084 } 00085 XfigPolyLine(fptr, x, y, in.n, XFIG_SOLID, 1, XFIG_BLACK); 00086 for (i = 0; i < in.n; i++) { 00087 XfigCircle(fptr, x[i], y[i], SCALE/20., 00088 XFIG_SOLID, 2, XFIG_BLACK); 00089 sprintf(s, "%d", i + 1); 00090 XfigText(fptr, x[i] + 12, y[i], 00091 XFIG_CENTER, XFIG_TIMES_ROMAN, 20, 00092 XFIG_BLACK, 0.0, s); 00093 } 00094 free(x); free(y); 00095 00096 } |