Project: Multigrid Methods

In this project we will learn three ways of implementating multigrid methods: from matrix-free version to matrix-only version depending on how much information on the grid and PDE is provided.

Contents

Multigrid on Uniform Grids for Poisson Equations

We consider linear finite element or equivalently 5-point stencil discretization of the Poisson equation on a uniform grid of [0,1]^2 with size h. For simplicity, we assume h = 1/2^L and zero Dirichlet bounary condition.

set(gcf,'Units','normal'); set(gcf,'Position',[0,0,0.4,0.3]);
[node,elem] = squarequadmesh([0,1,0,1],0.25);
subplot(1,2,1); showmesh(node,elem);
[node,elem] = uniformrefinequad(node,elem);
subplot(1,2,2); showmesh(node,elem);

Step 1 Smoother

Step 2 Two-Grid method

Step 3 V-cycle Multi-grid method

Choose one of the following approach to implement the MG.
u = u + Vcycle(r,J); % correction form
u = Vcycle(u,J); % direct update form

Multigrid on Hierarchical Grids

We consider linear finite element discretization of the Poisson equation on grids obtained by uniform refinement of a coarse grid.

[node,elem] = circlemesh(0,0,1,0.25);
subplot(1,2,1); showmesh(node,elem);
[node,elem] = uniformrefine(node,elem);
subplot(1,2,2); showmesh(node,elem);
 - Min quality 0.8507 - Mean quality 0.9612 - Uniformity 3.93% 

Step 1 Hierarchical Meshes

Generate the initial grid by

[node,elem] = circlemesh(0,0,1,0.25);
 - Min quality 0.8507 - Mean quality 0.9612 - Uniformity 3.93% 

Step 2 Transfer Operator and Smoothers

Step 3 V-cycle Multigrid

Be careful on the boundary nodes. Restrict smoothing to interiori nodes only and enforce the residual on boundary nodes to be zero.

Algebraic Multigrid Method

We consider solving an SPD matrix equation Ax = b, where A could be obtained as the finite element discretization on a unstructured grids. A coarsening of the graph of A is needed and restriction and prolongation can be constructued based on the coarsening.

Step 1 Matrix

The mesh is only used to generate the matrix. In the later step, only the generated matrix is used.

load lakemesh.mat;
figure; clf; showmesh(node,elem);
A = assemblematrix(node,elem);

Step 2 Coarsening

Use coarsenAMGc to get a set of coarse nodes.

help coarsenAMGc
  COARSENAMGC coarsen the graph of A.
 
  isC = coarsenAMGc(A) terturns a logical array to make a set of nodes as
  the coarse ndoes based on As, a strong connectness matrix modified from
  A. The strong connectness is slightly different with the standard
  definition.
 
  [isC,As] = coarsenAMGc(A,theta) accepts the parameter theta to define the
  strong connectness. The default setting is theta = 0.025. It also outputs
  the strong connectness matrix As which could be used in the constrction
  of prolongation and restriction.
 
  Example
    load lakemesh
    A = assemblematrix(node,elem);
    [isC,As] = coarsenAMGc(A);
 
  See also: coarsenAMGrs, interpolationAMGs, amg
 
  Reference page in Help browser
        <a href="matlab:ifem coarseAMGdoc">coarsenAMGdoc</a> 
 
  Copyright (C) Long Chen. See COPYRIGHT.txt for details. 

Step 3 Transfer Operator and Smoothers

Use interpolationAMGs to get restriction and prolongation operators.

help interpolationAMGs
  INTERPOLATIONAMGS construct prolongation and restriction matrices
 
  [Pro,Res] = interpolatoinAMGs(A,isC) construct prolongation and
  restriction matrices use standard matrix-dependent interpolation. 
 
  In the input, A is a SPD matrix and isC is a logical array to indicate
  nodes in coarse matrix. In the output Pro and Res are prolongation and
  restriction matrices satisfying Res = Pro'.
 
  The submatrix A_{cf} is used to construct the interpolation of values on
  fine nodes from that of coarse nodes. The weight is normalized to
  preserve the constant.
 
  Example
    load lakemesh
    A = assemblematrix(node,elem);
    [isC,As] = coarsenAMGc(A);
    [Pro,Res] = interpolationAMGs(As,isC);
 
  See also: coarsenAMGc, amg
 
  Copyright (C) Long Chen. See COPYRIGHT.txt for details. 

Step 4 V-cycle Multigrid used with PCG

Follow the Step 3 in part 2 to code a V-cycle. Then use the V-cycle as a preconditioner in PCG.

Test the robustness of the solver, apply uniformrefine to a mesh and generate corresponding matrix. List the iteration steps and CPU time for different size of matrices.