33 fprintf(stderr,
"Error in WriteTecplot3D(): This functions is hardcoded for 3-dimensional ");
34 fprintf(stderr,
"problems only. Instead, ndims=%d.\n",ndims);
45 fprintf(stderr,
"Error: could not open %s for writing.\n",f);
50 fprintf(out,
"VARIABLES=\"I\",\"J\",\"K\",\"X\",\"Y\",\"Z\",");
51 char varname[3] =
"00";
52 for (i = 0; i < nvars; i++) {
53 fprintf(out,
"\"%s\",",varname);
54 if (varname[1] ==
'9') { varname[0]++; varname[1] =
'0'; }
58 fprintf(out,
"ZONE I=%d,J=%d,K=%d,F=POINT\n",imax,jmax,kmax);
65 for (i=0; i<ndims; i++) fprintf(out,
"%4d ",index[i]);
66 for (i=0; i<ndims; i++) {
67 int j,offset = 0;
for (j=0; j<i; j++) offset += dim[j];
68 fprintf(out,
"%+1.16E ",x[offset+index[i]]);
70 for (i=0; i<nvars; i++) fprintf(out,
"%+1.16E ",u[nvars*p+i]);
Some basic definitions and macros.
#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.
int WriteTecplot3D(int ndims, int nvars, int *dim, double *x, double *u, char *f, int *index)