			     MGCG Method

						June 15, 2000


***     Copyright notice


Copyright(C) 2000 Osamu Tatebe, all rights reserved, no warranty.

This software is a free software.  All rights of this software belong
to Osamu Tatebe.  You can redistribute this whole package as it is if
you do not modify and inform me by E-mail.


*** 1.  Description


MGCG method is a conjugate gradient with multigrid preconditioner.
This library solves a linear system of equations whose coefficient
matrix has five diagonals that typically arises from discritization
of two-dimensional problem.


*** 2.  Function declaration and parameters


      SUBROUTINE MGCG(G_LEV, NUM_C, G_M1, G_M2, G_M3,
     $                A1, B, X, ITER, EPS, WS, IER)

      INPUT:

        G_LEV     Num. of grids
        NUM_C     Num. of iterations on the coarsest grid
        G_M1(G_LEV)   Array of num. of grid points in x-direction
        G_M2(G_LEV)   Array of num. of grid points in y-direction
        G_M3(G_LEV)   Array of num. of grid points in z-direction
        A1(NUM_DIAG, N * 8/7)  Coefficient matrices
        B(N)      Right-hand term
        X(N1)     Initial approximate
        ITER      Maximum number of iterations
        EPS       Epsilon 

      WORK SPACE:

        WS(*)
                  Work array of dimension 2 * N + 2 * N1 + N * 8/7 + N * 22/7 + N1 * 8/7

      OUTPUT:

        X(N1)     Approximate solution
        ITER      Num. of iterations until convergence
        IER       Error code

      where N = G_M1(1) * G_M2(1) * G_M3(1)
        and N1 = (G_M1(1) + 2) * (G_M2(1) + 2) * (G_M3(1) + 2).


*** 3.  Matrices


Matrix is stored by compressing in row.  Since matrix on each grid
level has seven diagonals, each matrix is stored in 7 by N array when
the matrix is N by N.  For example, coefficients of the i'th equation
are stored in A[1..7, i] where

 A[1,i] x[i-M2] + A[2,i] x[i-M1] + A[3,i] x[i-1] + A[4,i] x[i]
                + A[5,i] x[i+1] + A[6,i] x[i+M1] + A[7,i] x[i+M2] = b[i].

Each matrix is stored to one 7 by NN array in order of grid level,
where NN is a sum of unknowns of each grid level.


*** 4.  Sample problem


This library includes sample main program that solves several problems 
of three-dimensional Poisson equation.


*** 5.  User-defined coarsening and boundary condition


This library provides restriction and prolongation for standard
coarsening.  To use semicoarsening or matrix-dependent coarsening, it
is necessary to rewrite 'rest_s.f' and 'prog_s.f'.


*** 6.  Questions and comments


When problems occur, you feel freely to contact me by E-mail:

	tatebe@etl.go.jp

Your comments and questions are always welcome.


*** 7.  References


[1] Osamu Tatebe, The Multigrid Preconditioned Conjugate Gradient
Method, Proceedings of Sixth Copper Mountain Conference on Multigrid
Methods, NASA Conference Publication 3224, pp.621-634, 1993
http://www.etl.go.jp/~tatebe/research/paper/CM93-letter.ps.gz (59K)
http://www.etl.go.jp/~tatebe/research/paper/CM93-A4.ps.gz     (59K)
http://www.mgnet.org/mgnet/Conferences/CopperMtn93/tatebe.ps.gz

[2] Osamu Tatebe and Yoshio Oyanagi, Efficient Implementation of the
Multigrid Preconditioned Conjugate Gradient Method on Distributed
Memory Machines, Proceedings of Supercomputing '94, IEEE Computer
Society, pp.194-203, 1994
http://www.etl.go.jp/~tatebe/research/paper/SC94-letter.ps.gz (98K)
http://www.etl.go.jp/~tatebe/research/paper/SC94-A4.ps.gz     (98K)
http://www.acm.org/pubs/articles/proceedings/supercomputing/198354/
p194-tatebe/p194-tatebe.pdf

[3] Osamu Tatebe, MGCG METHOD: A ROBUST AND HIGHLY PARALLEL ITERATIVE
METHOD, Ph.D Thesis, University of Tokyo, March, 1997
http://www.etl.go.jp/~tatebe/research/paper/PhD-tatebe.ps.gz (330K)
