#include "FunDef.h" void Outputfile(char *filename, LNODE *ptr, int outtype, double t) { // This function output results to a file // Arguments: // *filename: name of the file // *ptr: pointer to the grid considred // outtype: variable to specify what is the output required ofstream OutFile; double dx, dy, x, y; int nx, ny, i, j; cout.precision(6); dx = ptr->data.dx; dy = ptr->data.dy; nx = ptr->data.sizex; ny = ptr->data.sizey; x = ptr->data.xpSW; y = ptr->data.ypSW; OutFile.open(filename); if (OutFile.good()==0){ cerr << "\n Error opening output file...\n"; exit(0); } OutFile << "For time t = " << setw(15) << t << "\n"; for (j=0; jdata.xpSW; for (i=0; idata.h[i][j]+ptr->data.s[i][j] << "\n"; else if (outtype==2) OutFile << setw(15) << x << setw(15) << y << setw(15) << ptr->data.c[i][j] << "\n"; else if (outtype==3) OutFile << setw(15) << x << setw(15) << y << setw(15) << ptr->data.p[i][j] << "\n"; else if (outtype==4) OutFile << setw(15) << x << setw(15) << y << setw(15) << ptr->data.s[i][j] << "\n"; else if (outtype==5) OutFile << setw(15) << x << setw(15) << y << setw(15) << ptr->data.res_h[i][j] << "\n"; else if (outtype==6) OutFile << setw(15) << x << setw(15) << y << setw(15) << ptr->data.res_c[i][j] << "\n"; else if (outtype==7) OutFile << setw(15) << x << setw(15) << y << setw(15) << ptr->data.res_p[i][j] << "\n"; else if (outtype==8) OutFile << setw(15) << x << setw(15) << y << setw(15) << ptr->data.rhs_h[i][j] << "\n"; else if (outtype==9) OutFile << setw(15) << x << setw(15) << y << setw(15) << ptr->data.rhs_c[i][j] << "\n"; else if (outtype==10) OutFile << setw(15) << x << setw(15) << y << setw(15) << ptr->data.rhs_p[i][j] << "\n"; else if (outtype==11) OutFile << setw(15) << x << setw(15) << y << setw(15) << ptr->data.hr[i][j] << "\n"; else if (outtype==12) OutFile << setw(15) << x << setw(15) << y << setw(15) << ptr->data.visco[i][j] << "\n"; else if (outtype==13) OutFile << setw(15) << x << setw(15) << y << setw(15) << ptr->data.sig[i][j] << "\n"; x += dx; } y+=dy; } OutFile.close(); }