11
$\begingroup$

I would like to understand more details about the implementation of Algebraic Multigrid Methods (AMG). I have been reading "A Multigrid Tutorial", which is quite good and explain all the details of the interpolation, coarse-grid operator and coarse grid selection for AMG. However, I think, there is nothing like playing around and reading a code.

So, I would like to ask if anyone knows any classical AMG "example code", like the geometric multigrid FORTRAN code available at the end of "Multigrid Methods" (SIAM) by S. F. McCormick. It is quite hard to get a high quality and production code like BoomerAMG to learn more about the method.

$\endgroup$
1
  • $\begingroup$ Are you specifically interested in classical AMG (as opposed to *smoothed aggregation)? If so, please state this in the question. $\endgroup$
    – Jed Brown
    Feb 14, 2012 at 0:04

4 Answers 4

10
$\begingroup$

BoomerAMG is a part of the Hypre package, which is dead simple to acquire. A much less complex code if you're starting out looking at these methods might be PyAMG.

$\endgroup$
2
  • $\begingroup$ Yes, I had a look at PyAMG, which is a very nice code, but it has all this stuff about wrapping C/C++ code in Python, it implements different AMG methods other than the "classical" one, and so on. I was looking for something simpler, that people use for teaching. $\endgroup$ Feb 13, 2012 at 14:05
  • 4
    $\begingroup$ Unfortunately, the general experience with using and trying to contribute to AMG codes is that if you don't have a multitude of options you aren't able to solve anything approaching an interesting problem. Therefore, your typical AMG package will include a number of options for connectedness approximation, interpolator construction and smoothing that is certainly hard to parse by code reading. That being said, the classical AMG is dead simple, and implementing it yourself or having your students try to do this themselves (depending on their skill level) may be the way to go. $\endgroup$ Feb 13, 2012 at 22:56
3
$\begingroup$

I highly recommend Alfio Borizi's introduction to algebraic multigrid method. There is a sample fortran 77 code in appendix A.

$\endgroup$
5
  • $\begingroup$ I think he is asking about implementations, not more literature. $\endgroup$ Feb 13, 2012 at 14:33
  • 2
    $\begingroup$ @JackPoulson: It has an implementation in the appendix. $\endgroup$
    – Paul
    Feb 13, 2012 at 14:37
  • 2
    $\begingroup$ Sorry, apparently I cannot read this morning. Upvoted. $\endgroup$ Feb 13, 2012 at 14:55
  • 1
    $\begingroup$ @Paul: I might be wrong, but I think this a geometric multigrid code for Poisson problem (which works for the nonlinear case as well). $\endgroup$ Feb 13, 2012 at 19:38
  • $\begingroup$ @BernardoM.R.: I just found this postscript file... It has lots of concrete examples of prolongation and restriction operators for model problems. It doesn't really have a full code though, but it may still be of some use to you. $\endgroup$
    – Paul
    Feb 13, 2012 at 23:34
1
$\begingroup$

There is also the ML package that's part of Trilinos. Its reputation is equally good as that of BoomerAMG/hypre.

A newer Trilinos package for AMG is called MueLu, I believe, and should also be available in the more recent releases.

All of these are open source.

$\endgroup$
1
  • 1
    $\begingroup$ MueLu has not been released and last time I talked to him, Ray didn't expect a public release for another year or so. Note that ML and MueLu (to the extent that I have heard what is in it) are based on smoothed aggregation which is quite a different algorithm from classical AMG (on which BoomerAMG is based). $\endgroup$
    – Jed Brown
    Feb 14, 2012 at 0:07
1
$\begingroup$

I've been working on this implementation for a little while. It's Python/Numpy/Scipy. It's not algebraic multigrid--you have to supply your own restriction operator. But if it's an education implementation in which you're interested, I would welcome some pull requests to add such capability.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.