3 Solving Nearest Neighbor Problems

This chapter presents an example of a nearest neighbor problem, an important class of problems for which High Performance Fortran (HPF) is useful. As an example of such a problem, this chapter concerns the problem of heat flow through a homogeneous two-dimensional object, when the edges are held at a constant temperature. The code presented approximates the steady state heat distribution after the heat flow has stabilized, given the initial temperature distribution and the boundary conditions. An iterative approach is used that gives estimates (increasingly accurate with each iteration) of the final temperature of a sampling of points distributed evenly across the object.