1
$\begingroup$

Consider a potential/poisson equation on a very large, complicated geometry. Currently, an self-written FEM and linear solvers from NumPy are used. Performance is, of course, not good enough for larger problems.

I'd like to switch to PETSc and use algebraic multigrid preconditioners. Surprisingly, I could not find good documentation or examples on algebraic multigrid in PETSc. Are there any good examples? Or is it maybe to early to use algebraic multigrid, if I don't want to go into development too deep?

(This question is mainly intended to find more documentation about algebraic multigrid in PETSc, but please let me know if my approach is generally a bad idea.)

$\endgroup$
2
$\begingroup$

AMG can be used with all examples in PETSc. There are three robust implementations that you might want to use

  • -pc_type gamg is a native (smoothed) aggregation method.
  • -pc_type ml is a smoothed aggregation implementation from the ML project (part of Trilinos). Configure PETSc with --download-ml to make this solver available.
  • -pc_type hypre is a classical AMG implementation (BoomerAMG from Hypre). Configure PETSc with --download-hypre to make this solver available.
$\endgroup$
  • $\begingroup$ That's about what I already found in the documentation... But I'd be really glad to find a complete example plus (hopefully) some extensive documentation. $\endgroup$ – Michael Jul 9 '17 at 11:20
  • 1
    $\begingroup$ @Michael Can you be more specific about what you hope to learn? Every example is a "complete example" in a limited sense and lots of the tests use multigrid. Many of the slide decks on the tutorials page discuss multigrid configuration and diagnostics. Ultimately, you have to get your hands dirty using the solver diagnostics and multigrid configuration options (-help shows all relevant options; you can pipe its output through grep). $\endgroup$ – Jed Brown Jul 13 '17 at 23:25
  • $\begingroup$ So far, I simply didn't find a complete example code with algebraic multigrid, even though I browsed trough lots of resources. $\endgroup$ – Michael Jul 15 '17 at 21:27
  • 2
    $\begingroup$ As I stated above, every example in PETSc is an AMG example because it requires no specific code, just run any example with the run-time argument -pc_type gamg. If you're interested is solving a particular kind of equation, perhaps 3D elasticity, then there are specific examples. If not, I'd recommend starting with src/snes/examples/tutorials/ex5.c which solves the Bratu equation. $\endgroup$ – Jed Brown Jul 17 '17 at 18:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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