Example 5
This example solves the 2-D Laplacian problem with zero boundary conditions on an nxn grid. The number of unknowns is N=n^2. The standard 5-point stencil is used, and we solve for the interior nodes only.
This example solves the same problem as Example 3. Available solvers are AMG, PCG, and PCG with AMG or Parasails preconditioners.
Example 9
This code solves a system corresponding to a discretization of the biharmonic problem treated as a system of equations on the unit square. Specifically, instead of solving Delta^2(u) = f with zero boundary conditions for u and Delta(u), we solve the system A x = b, where
A = [ Delta -I ; 0 Delta], x = [ u ; v] and b = [ 0 ; f] The corresponding boundary conditions are u = 0 and v = 0.
The domain is split into an N x N processor grid. Thus, the given number of processors should be a perfect square. Each processor's piece of the grid has n x n cells with n x n nodes. We use cell-centered variables, and, therefore, the nodes are not shared. Note that we have two variables, u and v, and need only one part to describe the domain. We use the standard 5-point stencil to discretize the Laplace operators. The boundary conditions are incorporated as in Example 3.
We recommend viewing Examples 3, 6 and 7 before this example.