  We present an efficient MPI-parallel geometric multigrid library for quadtree
(2D) or octree (3D) grids with adaptive refinement. Cartesian 2D/3D and
cylindrical 2D geometries are supported, with second-order discretizations for
the elliptic operators. Periodic, Dirichlet, and Neumann boundary conditions
can be handled, as well as free-space boundary conditions for 3D Poisson
problems, for which we use an FFT-based solver on the coarse grid. Scaling
results up to 1792 cores are presented. The library can be used to extend
adaptive mesh refinement frameworks with an elliptic solver, which we
demonstrate by coupling it to MPI-AMRVAC. Several test cases are presented in
which the multigrid routines are used to control the divergence of the magnetic
field in magnetohydrodynamic simulations.
