Class HotSpotGray
- java.lang.Object
-
- edu.rit.clu.heat.HotSpotGray
-
public class HotSpotGray extends java.lang.ObjectClass HotSpotGray is a sequential program that calculates the temperature distribution over a metal plate with hot spots.Usage: java edu.rit.clu.heat.HotSpotGray imagefile H W rl1 cl1 ru1 cu1 temp1 [ rl2 cl2 ru2 cu2 temp2 . . . ]
imagefile = Output image file name
H = Mesh height in pixels (H >= 1)
W = Mesh width in pixels (W >= 1)
rl1 = First hot spot lower row (1 <= rl1 <= W)
cl1 = First hot spot lower column (1 <= cl1 <= W)
ru1 = First hot spot upper row (1 <= ru1 <= W)
cu1 = First hot spot upper column (1 <= cu1 <= W)
temp1 = First hot spot temperature (0.0 <= temp1 <= 100.0)The program sets up a mesh of equally-spaced points with H+2 rows and W+2 columns. The temperature of each boundary point [r,c], where r = 0, r = H+1, c = 0, or c = W+1, is fixed at 0.0. The temperatures at certain interior points, known as "hot spots," are fixed at certain values greater than 0.0. Specifically, the temperature of each point in the rectangle from [rl1,cl1] to [ru1,cu1] inclusive is fixed at temp1, the temperature of each point in the rectangle from [rl2,cl2] to [ru2,cu2] inclusive is fixed at temp2, and so on. The program calculates the temperature at every interior point (other than the hot spots) using successive overrelaxation with Chebyshev acceleration and red-black updating. The program outputs a PJG grayscale image H+2 pixels high and W+2 pixels wide. Each pixel's gray level depends on the corresponding mesh point's temperature. A temperature of 0.0 is black; a temperature of 100.0 is white; intermediate temperatures are intermediate shades of gray. The PJG image file is named imagefile.
The computation is performed sequentially in a single processor. The program measures the computation's running time. This establishes a benchmark for measuring the computation's running time on a parallel processor.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidmain(java.lang.String[] args)Main program.
-
DMelt 3.0 © DataMelt by jWork.ORG