PCMulticolorGibbs#
A MulticolorMulticolorGibbs sampler wrapped as a PETSc PC.
Options database keys#
-pc_mcgibbs_omega- the SOR parameter (default is omega = 1)
Notes#
This implements a MulticolorGibbs sampler wrapped as a PETSc PC. In parallel this uses a multicolour Gauss-Seidel implementation to obtain a true parallel Gibbs sampler.
Implemented for PETSc’s MATAIJ and MATLRC formats. The latter is used for matrices of the form \(A + B \Sigma^{-1} B^T\) which come up in Bayesian linear inverse problems with Gaussian priors.
This is supposed to be used in conjunction with KSPRICHARDSON, either as a stand-alone sampler or as a random smoother in Multigrid Monte Carlo. As a stand-alone sampler, its usage is as follows:
KSPSetType(ksp, KSPRICHARDSON);
KSPGetPC(KSP, &pc);
PCSetType(pc, "mcgibbs");
KSPSetUp(ksp);
...
KSPSolve(ksp, b, x); // This performs the sampling
PCSetSampleCallback(pc, SampleCallback, &ctx, NULL);
ctx is a user defined context (can also be NULL) that is passed to the callback along with the sample.
Functions#
Warning
doxygenfunction: Cannot find function “PCMulticolorGibbsGetPetscRandom” in doxygen xml output for project “ParMGMC” from directory: build/xml
-
PetscErrorCode PCMulticolorGibbsSetOmega(PC pc, PetscReal omega)#
Sets the MulticolorGibbs-SOR parameter. Default is omega = 1.