Documentation of 'edu.rit.clu.heat.HotSpotAnimation' Java class
HotSpotAnimation
edu.rit.clu.heat

Class HotSpotAnimation



  • public class HotSpotAnimation
    extends java.lang.Object
    Class HotSpotAnimation is a sequential program that calculates the temperature distribution over a metal plate with hot spots. The program generates a GIF image file after each iteration; the image files can later be combined into an animated image file.

    Usage: java edu.rit.clu.heat.HotSpotAnimation 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. At the beginning, and after each iteration, the program outputs a GIF color image H+2 pixels high and W+2 pixels wide. Each pixel's hue depends on the corresponding mesh point's temperature. A temperature of 0.0 is blue; a temperature of 100.0 is red; intermediate temperatures are intermediate hues. The output image file name on the command line is imagefile.gif; the GIF image files are named imagefile_0.gif, imagefile_1.gif, and so on.

    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.

    Note: In order to generate the GIF image files, this program must be run using JDK 1.6.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static void main(java.lang.String[] args)
      Main program.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • main

        public static void main(java.lang.String[] args)
                         throws java.lang.Exception
        Main program.
        Throws:
        java.lang.Exception

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.