33 fprintf(stderr,
"Error in WriteTecplot2D(): This functions is hardcoded for 2-dimensional ");
34 fprintf(stderr,
"problems only. Instead, ndims=%d.\n",ndims);
44 fprintf(stderr,
"Error: could not open %s for writing.\n",f);
49 fprintf(out,
"VARIABLES=\"I\",\"J\",\"X\",\"Y\",");
50 char varname[3] =
"00";
51 for (i = 0; i < nvars; i++) {
52 fprintf(out,
"\"%s\",",varname);
53 if (varname[1] ==
'9') { varname[0]++; varname[1] =
'0'; }
57 fprintf(out,
"ZONE I=%d,J=%d,F=POINT\n",imax,jmax);
64 for (i=0; i<ndims; i++) fprintf(out,
"%4d ",index[i]);
65 for (i=0; i<ndims; i++) {
66 int j,offset = 0;
for (j=0; j<i; j++) offset += dim[j];
67 fprintf(out,
"%+1.16E ",x[offset+index[i]]);
69 for (i=0; i<nvars; i++) fprintf(out,
"%+1.16E ",u[nvars*p+i]);
Some basic definitions and macros.
int WriteTecplot2D(int ndims, int nvars, int *dim, double *x, double *u, char *f, int *index)
#define _ArrayIndex1D_(N, imax, i, ghost, index)
#define _ArraySetValue_(x, size, value)
#define _ArrayIncrementIndex_(N, imax, i, done)
Contains macros and function definitions for common array operations.