.. _homework6: ========================================== Homework 6 ========================================== .. comment :: Not yet assigned and may change slightly. Due Thursday, May 26, 2011, by 11:00pm PDT, by pushing to your bitbucket repository. The goals of this homework are to * Better understand Jacobi iteration * Gain some experience with MPI. Make sure you update your clone of the class repository before doing this assignment:: $ cd $CLASSHG $ hg pull -u # pulls and updates You should also create a directory `$MYHG/homeworks/homework6` to work in since this is where your modified versions of the files will eventually need to be. See * :ref:`mpi` * :ref:`mpi_sub` * :ref:`slides` for Lectures 18-23 The directory `$CLASSHG/codes/fortran/heat2d` contains main program and subroutine that together solve a two-dimensional steady state heat conduction problem by Jacobi iteration. The problem is the *Poisson problem* :math:`u_{xx} + u_{yy} = f(x,y)` on the unit square :math:`0\leq x\leq 1, 0\leq y\leq 1` with boundary conditions that specify the values of :math:`u` at all points around the boundary. The equations are solved on an :math:`n \times n` Cartesian grid with :math:`n^2` interior points (the grid points are indexed from 0 to :math:`n+1` in each direction with the first and last being boundary points where the values are specified). The grid points are equally spaced with :math:`\Delta x = \Delta y = h`. The code is currently set to solve the above problem with :math:`f(x,y) = 0` and boundary values **Left boundary:** :math:`u(x,y) = 0` for :math:`x=0` and :math:`0\leq y \leq 1` **Right boundary:** :math:`u(x,y) = \left\{ \begin{array}{ll} 1&~~x=1, ~0.3