Although parallel execution generally produces performance gains only for large arrays (for the meaning of "large", see Section 6.1.1), this example uses a small grid size of 8 by 8 for ease of illustration. Adding two extra rows and columns to hold the boundary conditions, we need a 10 by 10 array. Since the choice of initial values for the interior grid points has no effect on the final steady-state values, they are all arbitrarily initialized at 10 degrees. The edge elements are initialized at 0, 50, and 100 degrees, which are the boundary conditions of the example. This yields the following initial array:
-- -- |50 0 0 0 0 0 0 0 0 50 | |50 10 10 10 10 10 10 10 10 50 | |50 10 10 10 10 10 10 10 10 50 | |50 10 10 10 10 10 10 10 10 50 | |50 10 10 10 10 10 10 10 10 50 | |50 10 10 10 10 10 10 10 10 50 | |50 10 10 10 10 10 10 10 10 50 | |50 10 10 10 10 10 10 10 10 50 | |50 10 10 10 10 10 10 10 10 50 | |50 100 100 100 100 100 100 100 100 50 | -- --
After one iteration, the following is produced:
-- -- |50 0 0 0 0 0 0 0 0 50 | |50 17.5 7.5 7.5 7.5 7.5 7.5 7.5 17.5 50 | |50 20 10 10 10 10 10 10 20 50 | |50 20 10 10 10 10 10 10 20 50 | |50 20 10 10 10 10 10 10 20 50 | |50 20 10 10 10 10 10 10 20 50 | |50 20 10 10 10 10 10 10 20 50 | |50 20 10 10 10 10 10 10 20 50 | |50 42.5 32.5 32.5 32.5 32.5 32.5 32.5 42.5 50 | |50 100 100 100 100 100 100 100 100 50 | -- --
After 203 iterations, the steady-state solution is achieved to 2 decimal places. Notice that values reflected about the vertical axis of symmetry are the same and that values reflected about the horizontal axis of symmetry have the property that they sum to 100.
-- -- |50 0 0 0 0 0 0 0 0 50 | |50 26.37 17.83 14.48 13.28 13.28 14.48 17.83 26.37 50 | |50 37.66 30.45 26.82 25.34 25.34 26.82 30.45 37.66 50 | |50 43.81 39.49 37.02 35.94 35.94 37.02 39.49 43.81 50 | |50 48.10 46.68 45.83 45.44 45.44 45.83 46.68 48.10 50 | |50 51.90 53.32 54.17 54.56 54.56 54.17 53.32 51.90 50 | |50 56.19 60.51 62.98 64.06 64.06 62.98 60.51 56.19 50 | |50 62.34 69.55 73.18 74.66 74.66 73.18 69.55 62.34 50 | |50 73.63 82.17 85.52 86.72 86.72 85.52 82.17 73.63 50 | |50 100 100 100 100 100 100 100 100 50 | -- --