Info file for mgsor.f Armando de O. Fortuna 1. What is mgsor? Mgsor is a program designed to demonstrate the power of the multigrid technique, by comparing it against other popular iterative solution methods such as Gauss-Seidel and SOR. It is written in Fortran 77. 2. What does it do? The program solves the Laplace equation in cartesian coordinates, discretized with the 5-point approximation to the derivatives. The code can be easily modified to solve the Poisson equation. 3. Which solution methods does it implement: Quite a few: * Line SOR * Line Gauss-Seidel * Point Gauss-Seidel * Point SOR * All of the above combined with red/black ordering of the unknowns * Linear multigrid using any of the above smoothers 4. How do I choose which method to use? At runtime, the user simply answers a few questions regarding the execution parameters (including solver, n# of grids, SOR relaxation parameter, etc.) and the program solves the Laplace equation. It can save the RMS of the residual to a file, so that it can be later plotted against the iteration or mg cycle number. 5. Which features of multigrid have been implemented? At runtime, the user can select * the number of grids: between 1 and the maximum allowed by the program (10) or by the particular problem size being solved (depends...) * the startup grid: finest/coarsest * the initial mg cycle (if starting from the coarsest grid): direct or FMV * the main mg cycle (after reaching the finest grid or starting from it): V or W. 6. How do I change the maximum number of grids? The maximum number of grids that can be used is determined by the size of the finest grid. By recursively dividing the fine grid by 2, eventually one gets to a grid with 4 or fewer points in each direction (assuming a square fine grid). Simply count the number of divisions and you'll have the maximum number of grids you can use. The program is, however, limited to a maximum of 10 grids (there is no code in it to support more than 10 grids - such code can, of course, be easily added), which gives, for a square problem, a maximum fine grid size of 2049 by 2049. (Obs.: the fine grid size should always be of the form (2^n)+1). 7. Modifying the code The code is heavily commented, and should not be difficult to customize to suit one's particular needs. 8. Compiling the code To compile the code, type 'make'. If you prefer to do it manually, f77 mgsor.f -o mgsor The code should be easily compiled on almost any UNIX system (it has been tested on Solaris and Linux). If your linker/loader does not like the etime() function (which returns the execution time), replace it by the appropriate function for your system. 9. Contacting the author I can be reached at fortuna@lcad.icmsc.sc.usp.br Enjoy! Armando Fortuna 08/01/98