






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







(0,0) (^) (0,NumCols-1)
(HoleXStart,HoleYStart) (HoleXStart,HoleYEnd)
(HoleXEnd,HoleYStart)
(NumRows-1,0) (NumRows-1,NumCols-1)
(HoleXEnd,HoleYStart)
x-h,y x,y (^) x+h,y
x,y+h
x, y-h
#include <assert.h>
#include <fstream.h> #include "ezwin.h" #include "display.h" #include "pipe.h"
const float WindowWidth = 15.0; const float WindowHeight = 15.0; const float WindowX = 1.0; const float WindowY = 1.0;
// Create the pipe. The parameters are as follows (in order). // The pipe is a 40 x 40 array (rows x cols). The hole top is at row 16, // the hole bottom is row 24. The left surface of the hole is at column 16 // and the right surface is at row 24. // The temperature of the fluid (InnerTemp) is 200 and the
// temperature of the top surface (TopTemp) is 349.
Pipe P(40, 40, 16, 24, 16, 24, 200, 349);
// Set Epsilon and initialize Residual const double Epsilon = 0.5; double Residual = 2.0;
int ApiMain() {
// Instantiate a display for pipe P PipeDisplay Display("Pipe Cross-Section", P, WindowWidth, WindowHeight, Position(WindowX, WindowY)); // Open a output stream to write the starting and ending configurations ofstream DataOut("pipe.dat"); DataOut << "Initial Configuration Data" << endl; DataOut << P;
// Begin the computation while (Residual > Epsilon) { Residual = P.Iterate(); Display.PlotPipe(P); }
// Tell the user the program is done and write the final data to the file DataOut << "Computation complete" << endl; DataOut << P;
cout << "Computation Complete" << endl; cout << "Enter a character to remove the display " << endl;
char x; cin >> x; return 0; }
// User is shutting down the program int ApiEnd() { return 0; }
x-h,y x,y (^) x+h,y
x,y+h
x, y-h
char x; cin >> x; return 0; }
// User is shutting down the program int ApiEnd() { return 0; }