PCGAMGMC#

A geometric algebraic Multigrid Monte Carlo sampler wrapped as a PETSc PC.

Options databse keys#

  • -pc_gamgmc_mg_type - The type of the underlying multigrid PC. Can be mg or gamg. Default is gamg (i.e. algebraic Multigrid Monte Carlo).

Notes#

This is essentially a wrapper around PETSc’s PCMG or PCGAMG multigrid preconditioner that handles the case where the system matrix is of type MATLRC which represents a low-rank update of a matrix \(A + B \Sigma^{-1} B^T\). If the matrix is a simple MATAIJ matrix, then PCMG/PCGAMG could also be used directly.

The underyling multigrid PC can be configured using the options database by prepending the prefix gamgmc_. For example, a three-level MGMC sampler to generate 100 samples with MulticolorGibbs samplers used as random smoothers on each level using four iterations on the coarsest level and two iterations on the remaining levels can be configured with the following options:

-ksp_type richardson -pc_type gamgmc
-pc_gamgmc_mg_type gamg
-gamgmc_mg_levels_ksp_type richardson
-gamgmc_mg_levels_pc_type mcgibbs
-gamgmc_mg_coarse_ksp_type richardson
-gamgmc_mg_coarse_pc_type mcgibbs
-gamgmc_mg_levels_ksp_max_it 2
-gamgmc_mg_coarse_ksp_max_it 4
-gamgmc_pc_mg_levels 3
-ksp_max_it 100
Note that you have to provide additional information about the coarser grid matrices and grid transfer operators if you want to use the geometric version of this sampler by attaching a DM to the outer KSP via KSPSetDM(ksp, dm).

The underlying PCGAMG preconditioner can also be extracted using the function PCGAMGMCGetInternalPC(PC, PC*).